From d12edce5a2d542e33f1549e75af3b201a34eac29 Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Thu, 2 May 2024 13:39:20 -0300 Subject: [PATCH] Add Steps component to `v2.mdx` (#8111) Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> Co-authored-by: Sergio A. Arevalo Soria Co-authored-by: Atharva Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com> --- src/content/docs/en/guides/upgrade-to/v2.mdx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/content/docs/en/guides/upgrade-to/v2.mdx b/src/content/docs/en/guides/upgrade-to/v2.mdx index b5e6fc9daf5fb..d009b82f21ad2 100644 --- a/src/content/docs/en/guides/upgrade-to/v2.mdx +++ b/src/content/docs/en/guides/upgrade-to/v2.mdx @@ -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. @@ -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**. + 1. Check your local version of Node using: ```sh @@ -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. - + ### Reserved: `src/content/` @@ -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. @@ -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. @@ -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. @@ -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?