Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions .changeset/beige-clowns-read.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,4 @@
'astro': major
---

Removes `entryPoints` on `astro:build:ssr` hook (Integration API)

In Astro 5.0, `functionPerRoute` was deprecated. That meant that `entryPoints` on the `astro:build:ssr` hook was always empty. Astro integrations may have continued to work, even while `entryPoints` was not providing any useful data.

Astro 6.0 removes the `entryPoints` map passed to this hook entirely. Integrations may no longer include `entryPoints`.

#### What should I do?

Remove any instance of `entryPoints` passed to `astro:build:ssr`. This should be safe to remove because this logic was not providing any useful data, but you may need to restructure your code accordingly for its removal:

```diff
// my-integration.mjs
const integration = () => {
return {
name: 'my-integration',
hooks: {
'astro:build:ssr': (params) => {
- someLogic(params.entryPoints)
},
}
}
}
```
Removes `entryPoints` on `astro:build:ssr` hook (Integration API) - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#removed-entrypoints-on-astrobuildssr-hook-integration-api))
19 changes: 1 addition & 18 deletions .changeset/busy-olives-chew.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,4 @@
'astro': major
---

Removes the deprecated `emitESMImage()` function

In Astro 5.6.2, the `emitESMImage()` function was deprecated in favor of `emitImageMetadata()`, which removes two deprecated arguments that were not meant to be exposed for public use: `_watchMode` and `experimentalSvgEnabled`.

Astro 6.0 removes `emitESMImage()` entirely. Update to `emitImageMetadata()` to keep your current behavior.

#### What should I do?

Replace all occurrences of the `emitESMImage()` with `emitImageMetadata()` and remove unused arguments:

```diff
-import { emitESMImage } from 'astro/assets/utils';
+import { emitImageMetadata } from 'astro/assets/utils';

const imageId = '/images/photo.jpg';
-const result = await emitESMImage(imageId, false, false);
+const result = await emitImageMetadata(imageId);
```
Removes the deprecated `emitESMImage()` function - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#removed-emitesmimage))
37 changes: 1 addition & 36 deletions .changeset/cuddly-worlds-beam.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,4 @@
'astro': major
---

Removes `routes` on `astro:build:done` hook (Integration API)

In Astro 5.0, accessing `routes` on the `astro:build:done` hook was deprecated in favour of a new `astro:routes:resolved` hook. However, Astro integrations may have continued to function using the `routes` array.

Astro 6.0 removes the `routes` array passed to this hook entirely. Instead, the `astro:routes:resolved` hook must be used.

#### What should I do?

Remove any instance of `routes` passed to `astro:build:done` in your Astro integration and replace it with the new `astro:routes:resolved` hook. You can access `distURL` on the newly exposed `assets` map:

```diff
// my-integration.mjs
const integration = () => {
+ let routes
return {
name: 'my-integration',
hooks: {
+ 'astro:routes:resolved': (params) => {
+ routes = params.routes
+ },
'astro:build:done': ({
- routes
+ assets
}) => {
+ for (const route of routes) {
+ const distURL = assets.get(route.pattern)
+ if (distURL) {
+ Object.assign(route, { distURL })
+ }
+ }
console.log(routes)
}
}
}
}
```
Removes `routes` on `astro:build:done` hook (Integration API) - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#removed-routes-on-astrobuilddone-hook-integration-api))
16 changes: 1 addition & 15 deletions .changeset/cyan-crews-cross.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,4 @@
'astro': major
---

Removes the old `app.render()` signature (Adapter API)

In Astro 4.0, the `app.render()` signature that allowed passing `routeData` and `locals` as optional arguments was deprecated in favor of a single optional `renderOptions` argument.

Astro 6.0 removes this signature entirely. Attempting to pass these separate arguments will now cause an error in your project.

#### What should I do?

Review your `app.render` calls and pass `routeData` and `locals` as properties of an object instead of as multiple independent arguments:

```diff
// my-adapter/entrypoint.ts
-app.render(request, routeData, locals)
+app.render(request, { routeData, locals })
```
Removes the old `app.render()` signature (Adapter API) - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#removed-old-apprender-signature-adapter-api))
17 changes: 1 addition & 16 deletions .changeset/dull-mangos-travel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,4 @@
'astro': major
---

Removes `prefetch()` `with` option

In Astro 4.8.4, the `with` option of the programmatic `prefetch()` function was deprecated in favor of a more sensible default behavior that no longer required specifying the priority of prefetching for each page.

Astro 6.0 removes this option entirely and it is no longer possible to configure the priority of prefetching by passing the `with` option. Attempting to do so will now cause errors.

By default, Astro's prefetching now uses an automatic approach that will always try to use `<link rel="prefetch>` if supported, or will fall back to `fetch()`.

#### What should I do?

Review your `prefetch()` calls and remove the `with` option if it still exists:

```diff
-prefetch('/about', { with: 'fetch' });
+prefetch('/about');
```
Removes `prefetch()` `with` option - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#removed-prefetch-with-option))
23 changes: 1 addition & 22 deletions .changeset/fast-bushes-fall.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,5 @@
'astro': major
---

Deprecates `Astro` in `getStaticPaths()`

In Astro 5.x, it was possible to access an `Astro` object inside `getStaticPaths()`. However, despite being typed the same as the `Astro` object accessible in the frontmatter, this object only had `site` and `generator` properties. This could lead to confusion about which `Astro` object properties were available inside `getStaticPaths()`.

Astro 6.0 deprecates this object for `getStaticPaths()` to avoid confusion and improves error handling when attempting to access `Astro` values that are unavailable. Using `Astro.site` or `Astro.generator` within `getStaticPaths()` will now log a deprecation warning, and accessing any other property will throw a specific error with a helpful message. In a future major version, this object will be removed entirely, and accessing `Astro.site` or `Astro.generator` will also throw an error.

#### What should I do?

Update your `getStaticPaths()` function if you were attempting to access any `Astro` properties inside its scope. Remove `Astro.generator` entirely, and replace all occurrences of `Astro.site()` with `import.meta.env.SITE`:

```diff
---
// src/pages/blog/[slug].astro
import { getPages } from "../../../utils/data";

export async function getStaticPaths() {
- console.log(Astro.generator);
- return getPages(Astro.site);
+ return getPages(import.meta.env.SITE);
}
---
```
Deprecates `Astro` in `getStaticPaths()` - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#deprecated-astro-in-getstaticpaths))

15 changes: 1 addition & 14 deletions .changeset/giant-areas-press.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,4 @@
'astro': major
---

Updates trailing slash behavior of endpoint URLs.

In Astro v5.0, custom endpoints whose URL ended in a file extension (e.g. `/src/pages/sitemap.xml.ts` ) could be accessed with a trailing slash (`/sitemap.xml/`) or without (`/sitemap.xml`), regardless of the value configured for `build.trailingSlash`.

In Astro v6.0, these endpoints can only be accessed without a trailing slash. This is true regardless of your `build.trailingSlash` configuration.

#### What should I do?

Review your links to your custom endpoints that include a file extension in the URL and remove any trailing slashes:

```diff
-<a href="/sitemap.xml/">Sitemap</a>
+<a href="/sitemap.xml">Sitemap</a>
```
Updates trailing slash behavior of endpoint URLs - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#changed-endpoints-with-a-file-extension-cannot-be-accessed-with-a-trailing-slash))
18 changes: 1 addition & 17 deletions .changeset/good-camels-pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,4 @@
'astro': major
---

Updates Markdown heading ID generation

In Astro 5.x, an additional default processing step to Markdown stripped trailing hyphens from the end of IDs for section headings ending in special characters. This provided a cleaner `id` value, but could lead to incompatibilities rendering your Markdown across platforms.

In Astro 5.5, the `experimental.headingIdCompat` flag was introduced to allow you to make the IDs generated by Astro for Markdown headings compatible with common platforms like GitHub and npm, using the popular [`github-slugger`](https://github.com/Flet/github-slugger) package.

Astro 6.0 removes this experimental flag and makes this the new default behavior in Astro: trailing hyphens from the end of IDs for headings ending in special characters are no longer removed.

#### What should I do?

If you have manual links to headings, you may need to update some anchor link values with a new trailing hyphen.

If you were previously using this experimental feature, remove this experimental flag from your configuration.

If you were previously using the `rehypeHeadingIds` plugin directly to enforce compatibility, remove the `headingIdCompat` option as it no longer exists.

See the [Astro 6.0 upgrade guide](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-markdown-heading-id-generation) for upgrade examples, and instructions to create a custom rehype plulgin if you want to keep the old ID generation for backward compatibility reasons.
Updates Markdown heading ID generation - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#changed-markdown-heading-id-generation))
18 changes: 1 addition & 17 deletions .changeset/green-garlics-heal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,4 @@
'astro': major
---

Deprecates `import.meta.env.ASSETS_PREFIX`

In Astro 5.x, it was possible to access `build.assetsPrefix` in your Astro config via the built-in environment variable `import.meta.env.ASSETS_PREFIX`. However, Astro v5.7.0 introduced the `astro:config` virtual model to expose a non-exhaustive, serializable, type-safe version of the Astro configuration which included access to `build.assetsPrefix` directly. This became the preferred way to access the prefix for Astro-generated asset links when set, although the environment variable still existed.

Astro 6.0 deprecates this variable in favor of `build.assetsPrefix` from the `astro:config/server` module.

#### What should I do?

Replace any occurances of `import.meta.env.ASSETS_PREFIX` with the `build.assetsPrefix` import from `astro:config/server`. This is a drop-in replacement to provide the existing value, and no other changes to your code should be necessary:

```diff
import { someLogic } from "./utils"
+import { build } from "astro:config/server"

-someLogic(import.meta.env.ASSETS_PREFIX)
+someLogic(build.assetsPrefix)
```
Deprecates `import.meta.env.ASSETS_PREFIX` - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#deprecated-importmetaenvassets_prefix))
12 changes: 1 addition & 11 deletions .changeset/honest-deer-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,4 @@
'astro': major
---

Changes the values allowed in `params` returned by `getStaticPaths()`.

In Astro 5.x, `getStaticPaths()` could return `params` of type number, which would always be stringified by Astro. However, that could be confusing because it conflicted with `Astro.params` types.

Astro 6.0 removes this behavior: `getStaticPaths()` must now return string or undefined `params` values.

#### What should I do?

Review your dynamic routes using `getStaticPaths()` and convert any number params to strings.

For more guidance, see [the v6 upgrade guide entry for this breaking change](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-getstaticpaths-cannot-return-params-of-type-number).
Changes the values allowed in `params` returned by `getStaticPaths()` - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#changed-getstaticpaths-cannot-return-params-of-type-number))
21 changes: 1 addition & 20 deletions .changeset/kind-pears-behave.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,4 @@
'@astrojs/language-server': patch
---

Removes `Astro.glob()`

In Astro 5.0, `Astro.glob()` was deprecated in favor of using `getCollection()` to query your collections, and `import.meta.glob()` to query other source files in your project.

Astro 6.0 removes `Astro.glob()` entirely. Update to `import.meta.glob()` to keep your current behavior.

#### What should I do?

Replace all use of `Astro.glob()` with `import.meta.glob()`. Note that `import.meta.glob()` no longer returns a `Promise`, so you may have to update your code accordingly. You should not require any updates to your glob patterns.

```astro
---
// src/pages/blog.astro
-const posts = await Astro.glob('./posts/*.md');
+const posts = Object.values(import.meta.glob('./posts/*.md', { eager: true }));
---
{posts.map((post) => <li><a href={post.url}>{post.frontmatter.title}</a></li>)}
```

Where appropriate, consider using content collections to organize your content, which has its own newer, more performant querying functions.
Removes the previously deprecated `Astro.glob()` - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#removed-astroglob))
26 changes: 1 addition & 25 deletions .changeset/pretty-forks-smash.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,4 @@
'astro': major
---

Removes the `handleForms` prop for the `<ClientRouter />` component

In Astro 4.0, the `handleForms` prop of the `<ClientRouter />` component was deprecated, as it was no longer necessary to opt in to handling `submit` events for `form` elements. This functionality has been built in by default and the property, if still included in your project, silently had no impact on form submission.

Astro 6.0 removes this prop entirely and it now must be removed to avoid errors in your project.

#### What should I do?

Remove the `handleForms` property from your `<ClientRouter />` component if it exists. It has provided no additional functionality, and so removing it should not change any behavior in your project:

```diff
---
// title="src/pages/index.astro
import { ClientRouter } from "astro:transitions";
---
<html>
<head>
- <ClientRouter handleForms />
+ <ClientRouter />
</head>
<body>
<!-- stuff here -->
</body>
</html>
```
Removes the `handleForms` prop for the `<ClientRouter />` component - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#removed-handleforms-prop-for-the-clientrouter--component))
25 changes: 1 addition & 24 deletions .changeset/puny-poems-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,4 @@
'astro': major
---

Increases minimum Node.js version to 22.12.0

Node 18 reached its End of Life in March 2025 and Node 20 is scheduled to reach its End of Life in April 2026.

Astro v6.0 drops Node 18 and Node 20 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 `22.12.0` or higher**.

1. Check your local version of Node using:

```sh
node -v
```

2. Check your deployment environment's own documentation to verify that they support Node 22.

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

```bash
# .nvmrc
22.12.0
```
Increases minimum Node.js version to 22.12.0 - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#node-22))
23 changes: 1 addition & 22 deletions .changeset/rich-horses-begin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,4 @@
'astro': major
---

Removes the deprecated `<ViewTransitions />` component

In Astro 5.0, the `<ViewTransitions />` component was renamed to `<ClientRouter />` to clarify the role of the component. The new name makes it more clear that the features you get from Astro's `<ClientRouter />` routing component are slightly different from the native CSS-based MPA router. However, a deprecated version of the `<ViewTransitions />` component still existed and may have functioned in Astro 5.x.

Astro 6.0 removes the `<ViewTransitions />` component entirely and it can no longer be used in your project. Update to the `<ClientRouter />` component to continue to use these features.

#### What should I do?

Replace all occurrences of the `ViewTransitions` import and component with `ClientRouter`:

```diff
// src/layouts/MyLayout.astro"
- import { ViewTransitions } from 'astro:transitions';
+ import { ClientRouter } from 'astro:transitions';
<html>
<head>
...
- <ViewTransitions />
+ <ClientRouter />
</head>
</html>
```
Removes the deprecated `<ViewTransitions />` component - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#removed-viewtransitions--component))
24 changes: 1 addition & 23 deletions .changeset/sad-lines-hear.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,4 @@
'astro': major
---

Changes the default routing configuration value of `i18n.routing.redirectToDefaultLocale` from `true` to `false`.

In Astro v5.0, `i18n.routing.redirectToDefaultLocale` was `true` by default. When combined with the `i18n.routing.prefixDefaultLocale` default value of `false`, the resulting redirects could cause infinite loops.

In Astro v6.0, `i18n.routing.redirectToDefaultLocale` now defaults to `false`. Additionally, it can now only be used if `i18n.routing.prefixDefaultLocale` is set to `true`.

#### What should I do?

Review your Astro `i18n` config as you may now need to explicitly set values for `redirectToDefaultLocale` and `prefixDefaultLocale` to recreate your project's previous behavior.

```diff
// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
i18n: {
routing: {
prefixDefaultLocale: true,
+ redirectToDefaultLocale: true
}
}
})
```
Changes the default routing configuration value of `i18n.routing.redirectToDefaultLocale` from `true` to `false` - ([v6 upgrade guidance](https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/upgrade-to/v6/#changed-i18nroutingredirecttodefaultlocale-default-value))
Loading
Loading