Skip to content

Commit

Permalink
Add Steps component to v2.mdx (#8111)
Browse files Browse the repository at this point in the history
Co-authored-by: Houston (Bot) <[email protected]>
Co-authored-by: Sergio A. Arevalo Soria <[email protected]>
Co-authored-by: Atharva <[email protected]>
Co-authored-by: Reuben Tier <[email protected]>
  • Loading branch information
5 people authored May 2, 2024
1 parent 3aa6626 commit d12edce
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/content/docs/en/guides/upgrade-to/v2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: Upgrade to Astro v2
description: How to upgrade your project to the latest version of Astro.
i18nReady: true
---
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
import { FileTree } from '@astrojs/starlight/components';

import { Steps } from '@astrojs/starlight/components';

This guide will help you migrate from Astro v1 to Astro v2.

Expand Down Expand Up @@ -61,6 +61,7 @@ Astro v2.0 drops Node 14 support entirely, so that all Astro users can take adva

Check that both your development environment and your deployment environment are using **Node `16.12.0` or later**.

<Steps>
1. Check your local version of Node using:

```sh
Expand All @@ -69,11 +70,10 @@ Astro v2.0 drops Node 14 support entirely, so that all Astro users can take adva
```
If your local development environment needs upgrading, [install Node](https://nodejs.org/en/download/).


2. Check your [deployment environment's](/en/guides/deploy/) own documentation to verify that they support Node 16.

You can specify Node `16.12.0` for your Astro project either in a dashboard configuration setting, or a `.nvmrc` file.

</Steps>

### Reserved: `src/content/`

Expand Down Expand Up @@ -132,7 +132,6 @@ Astro v2.0 removes this configuration option entirely because its behavior is no

Applying remark and rehype plugins in your Markdown configuration **no longer disables Astro's default plugins**. GitHub-Flavored Markdown and Smartypants are now applied whether or not custom `remarkPlugins` or `rehypePlugins` are configured.


##### What should I do?

Remove `extendDefaultPlugins` in your configuration. This is now Astro's default behavior in v2.0, and you can delete this line without any replacement.
Expand Down Expand Up @@ -250,14 +249,12 @@ export default defineConfig({

Revisit your Markdown and MDX configuration and compare your existing config with the new options available.


### Changed: Plugin access to frontmatter

In v1.x, remark and rehype plugins did not have access to user frontmatter. Astro merged plugin frontmatter with your file's frontmatter, without passing the file frontmatter to your plugins.

Astro v2.0 gives remark and rehype plugins access to user frontmatter via frontmatter injection. This allows plugin authors to modify a user's existing frontmatter, or compute new properties based on other properties.


#### What should I do?

Check any remark and rehype plugins you have written to see whether their behavior has changed. Note that `data.astro.frontmatter` is now the _complete_ Markdown or MDX document's frontmatter, rather than an empty object.
Expand All @@ -268,7 +265,6 @@ In v1.x, Astro's RSS package allowed you to use `items: import.meta.glob(...)` t

Astro v2.0 introduces a `pagesGlobToRssItems()` wrapper to the `items` property.


#### What should I do?

Import, then wrap your existing function containing `import.meta.glob()` with the `pagesGlobToRssItems()` helper.
Expand Down Expand Up @@ -370,7 +366,6 @@ const allPosts = await Astro.glob('./posts/*.md');

In v1.0, Astro deprecated `Astro.canonicalURL` for constructing a canonical URL.


Astro v2.0 removes this option entirely. `Astro.canonicalURL` in your code will cause an error.

#### What should I do?
Expand Down

0 comments on commit d12edce

Please sign in to comment.