diff --git a/src/content/docs/en/guides/integrations-guide/cloudflare.mdx b/src/content/docs/en/guides/integrations-guide/cloudflare.mdx index 0d5d4b4cf0dfa..5ca718d01f493 100644 --- a/src/content/docs/en/guides/integrations-guide/cloudflare.mdx +++ b/src/content/docs/en/guides/integrations-guide/cloudflare.mdx @@ -109,7 +109,7 @@ See Cloudflare's documentation for [working with environment variables](https:// ```js // pages/[id].json.js -export function get({ params }) { +export function GET({ params }) { // Access environment variables per request inside a function const serverUrl = import.meta.env.SERVER_URL; const result = await fetch(serverUrl + "/user/" + params.id); diff --git a/src/content/docs/en/guides/integrations-guide/netlify.mdx b/src/content/docs/en/guides/integrations-guide/netlify.mdx index bd5e6fd987ec5..7cd84245495bf 100644 --- a/src/content/docs/en/guides/integrations-guide/netlify.mdx +++ b/src/content/docs/en/guides/integrations-guide/netlify.mdx @@ -274,7 +274,7 @@ We check for common mime types for audio, image, and video files. To include spe import fs from 'node:fs'; -export function get() { +export function GET() { const buffer = fs.readFileSync('../image.jpg'); // Return the buffer directly, @astrojs/netlify will base64 encode the body diff --git a/src/content/docs/en/guides/upgrade-to/v3.mdx b/src/content/docs/en/guides/upgrade-to/v3.mdx index 8369d51831045..2bcbbde07d28a 100644 --- a/src/content/docs/en/guides/upgrade-to/v3.mdx +++ b/src/content/docs/en/guides/upgrade-to/v3.mdx @@ -80,11 +80,11 @@ See [the changelog](https://github.com/withastro/astro/blob/main/packages/astro/ Node 16 is scheduled to reach its End of Life in September 2023. -Astro v3.0 drops Node 16 support entirely, so that all Astro users can take advantage of Node's more modern features. +Astro v3.0 drops Node 16 support entirely so that all Astro users can take advantage of Node's more modern features. #### What should I do? - Check that both your development environment and your deployment environment are using **Node `18.14.1` or later**. + Check that both your development environment and your deployment environment are using **Node `18.14.1` or higher**. 1. Check your local version of Node using: @@ -92,13 +92,15 @@ Astro v3.0 drops Node 16 support entirely, so that all Astro users can take adva node -v ``` - 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 18. - You can specify Node `18.14.1` for your Astro project either in a dashboard configuration setting, or a `.nvmrc` file. + You can specify Node `18.14.1` for your Astro project either in a dashboard configuration setting or a `.nvmrc` file. +```bash title=".nvmrc" +18.14.1 +``` ### Removed: Support for TypeScript 4 In Astro v2.x, the `tsconfig.json` presets include support for both TypeScript 4.x and 5.x. @@ -121,7 +123,7 @@ Astro v3.0 removes this integration from the codebase entirely. Astro's new solu #### What should I do? -Remove the `@astrojs/image` integration from your project. You will need to not only uninstall the integration, but also update or remove any import statements and existing `` and `` components. You might also need to configure a preferred default image processing service. +Remove the `@astrojs/image` integration from your project. You will need to not only uninstall the integration but also update or remove any import statements and existing `` and `` components. You might also need to configure a preferred default image processing service. You will find [complete, step-by-step instructions for removing the old image integration](/en/guides/images/#remove-astrojsimage) in our Images guide. @@ -141,7 +143,7 @@ export default defineConfig({ ### Removed: `` component -In Astro v2.x, Astro deprecated the `` component and moved it to an external package. +In Astro v1.x, Astro deprecated the `` component and moved it to an external package. Astro v3.0 completely removes the package `@astrojs/markdown-component`. Astro's `` component will no longer work in your project. @@ -277,7 +279,7 @@ If you were relying on Astro to transform kebab-case in your styles, update your Do we want an example of returning an array of an array, requiring flattening? ::: -In Astro v2.x, the return value of [`getStaticPaths()`](/en/reference/api-reference/#getstaticpaths) was automatically flattened to allow you to return an array of array without errors. +In Astro v2.x, the return value of [`getStaticPaths()`](/en/reference/api-reference/#getstaticpaths) was automatically flattened to allow you to return an array of arrays without errors. Astro v3.0 removes automatic flattening of `getStaticPaths()`'s result. @@ -287,9 +289,9 @@ If you're returning an array of arrays instead of an array of _objects_ (as is e An [error message indicating that `getStaticPath()`'s return value must be an array of objects](/en/reference/errors/invalid-get-static-paths-entry/#what-went-wrong) will be provided if you need to update your code. -### Moved: `astro check` is now an external package +### Moved: `astro check` now requires an external package -In Astro v2.x, [`astro check`](/en/reference/cli-reference/#astro-check) was included in Astro by default and its dependencies were bundled in Astro. This meant a larger package whether or not you ever used `astro check`. This also prevented you from having control over the version of TypeScript and the Astro Language Server to use. +In Astro v2.x, [`astro check`](/en/reference/cli-reference/#astro-check) was included in Astro by default, and its dependencies were bundled in Astro. This meant a larger package whether or not you ever used `astro check`. This also prevented you from having control over the version of TypeScript and the Astro Language Server to use. Astro v3.0 moves the `astro check` command out of Astro core and now requires an external package `@astrojs/check`. Additionally, you must install `typescript` in your project to use the `astro check` command. @@ -311,7 +313,7 @@ Update any existing references to `localhost:3000`, for example in tests or in y ### Changed default: import.meta.env.BASE_URL `trailingSlash` -In Astro v2.x, `import.meta.env.BASE_URL` appended your [`base`](/en/reference/configuration-reference/#base) setting with a [trailingSlash](/en/reference/configuration-reference/#trailingslash) by default. `trailingSlash: "ignore"`also appended a trailing slash. +In Astro v2.x, `import.meta.env.BASE_URL` appended your [`base`](/en/reference/configuration-reference/#base) setting with a [trailingSlash](/en/reference/configuration-reference/#trailingslash) by default. `trailingSlash: "ignore"` also appended a trailing slash. Astro v3.0 no longer appends `import.meta.env.BASE_URL` with a trailing slash by default, nor when `trailingSlash: "ignore"` is set. (The existing behavior of `base` in combination with `trailingSlash: "always"` or `trailingSlash: "never"` is unchanged.) @@ -319,7 +321,7 @@ Astro v3.0 no longer appends `import.meta.env.BASE_URL` with a trailing slash by If your `base` already has a trailing slash, no change is needed. -If your `base` does not have a trailing slash, add one if you wish to preserve the previous default (or `trailingSlash: "ignore"`) behaviour: +If your `base` does not have a trailing slash, add one if you wish to preserve the previous default (or `trailingSlash: "ignore"`) behavior: ```js title="astro.config.mjs" del={4} ins={5} import { defineConfig } from "astro/config"; @@ -371,7 +373,7 @@ export default defineConfig({ ### Changed default: `inlineStyleSheets` -In Astro v2.x, all project stylesheets were sent as link tags by default. You could opt in to `"always"` inlining them into `