From b952ae47fd8693640331ca8f2d626ba9c936c338 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Tue, 30 Sep 2025 15:45:26 +0200 Subject: [PATCH 01/10] feat!: trailing slash never for endpoints with file extension --- src/content/docs/en/guides/upgrade-to/v6.mdx | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index 15aeac1e474a8..c09c1f49a23ce 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -89,6 +89,8 @@ Check that both your development environment and your deployment environment are ### Vite 7.0 + + Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler. #### What should I do? @@ -287,6 +289,8 @@ In most cases, the only action needed is to review your existing project's deplo ### Changed: `i18n.routing.redirectToDefaultLocale` default value + + In Astro v5.0, the `i18n.routing.redirectToDefaultLocale` default value was `true`. 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`. @@ -309,6 +313,26 @@ export default defineConfig({ ``` Learn more about [Internationalization routing](/en/guides/internationalization/#routing). +value + +### Changed: endpoints with a file extension cannot be accessed with a trailing slash + + + +In Astro v5.0, endpoints with a pathname ending with a file extension (eg. `/src/pages/sitemap.xml.ts`) could be accessed with a trailing slash (`/sitemap.xml/`) or without (`/sitemap.xml`), no matter the value of `build.trailingSlash`. + +In Astro v6.0, these endpoints can only be accessed without a trailing slash. + +#### What should I do? + +Review your links and remove any referencing an endpoint ending witha file a file extension and a trailing slash: + +```html del={1} ins={2} title="src/pages/index.astro" +Sitemap +Sitemap +``` + +Learn more about [`build.trailingSlash`](https://docs.astro.build/en/reference/configuration-reference/#trailingslash). ## Breaking Changes From f7335454578e4348c85dfce7cfca551e473948a5 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Tue, 30 Sep 2025 16:18:29 +0200 Subject: [PATCH 02/10] Update src/content/docs/en/guides/upgrade-to/v6.mdx --- src/content/docs/en/guides/upgrade-to/v6.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index c09c1f49a23ce..61dd342bb4ff8 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -313,7 +313,6 @@ export default defineConfig({ ``` Learn more about [Internationalization routing](/en/guides/internationalization/#routing). -value ### Changed: endpoints with a file extension cannot be accessed with a trailing slash From 1a99e27ad93ae85e8c3e73c9099ec1873f51f62b Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Tue, 30 Sep 2025 16:18:37 +0200 Subject: [PATCH 03/10] Update src/content/docs/en/guides/upgrade-to/v6.mdx Co-authored-by: Matt Kane --- src/content/docs/en/guides/upgrade-to/v6.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index 61dd342bb4ff8..9a87190e73460 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -324,7 +324,7 @@ In Astro v6.0, these endpoints can only be accessed without a trailing slash. #### What should I do? -Review your links and remove any referencing an endpoint ending witha file a file extension and a trailing slash: +Review your links and remove any referencing an endpoint ending with a file extension and a trailing slash: ```html del={1} ins={2} title="src/pages/index.astro" Sitemap From 8b5893d871a4d6c87d3f0d60bd50c8fde2cce02d Mon Sep 17 00:00:00 2001 From: Junseong Park Date: Wed, 1 Oct 2025 12:57:14 +0900 Subject: [PATCH 04/10] Update src/content/docs/en/guides/upgrade-to/v6.mdx --- src/content/docs/en/guides/upgrade-to/v6.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index 9a87190e73460..d2a2e0f651ff3 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -331,7 +331,7 @@ Review your links and remove any referencing an endpoint ending with a file exte Sitemap ``` -Learn more about [`build.trailingSlash`](https://docs.astro.build/en/reference/configuration-reference/#trailingslash). +Learn more about [`build.trailingSlash`](/en/reference/configuration-reference/#trailingslash). ## Breaking Changes From 35446b9bbd1cf4127f6155ca90e390ce146eac75 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Wed, 1 Oct 2025 16:52:40 +0200 Subject: [PATCH 05/10] Apply suggestions from code review Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> --- src/content/docs/en/guides/upgrade-to/v6.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index d2a2e0f651ff3..bcd4471b213af 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -320,7 +320,7 @@ export default defineConfig({ In Astro v5.0, endpoints with a pathname ending with a file extension (eg. `/src/pages/sitemap.xml.ts`) could be accessed with a trailing slash (`/sitemap.xml/`) or without (`/sitemap.xml`), no matter the value of `build.trailingSlash`. -In Astro v6.0, these endpoints can only be accessed without a trailing slash. +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? From 22ed4f2f09834fd2a21de5e3e1034cdcd3197e80 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Wed, 1 Oct 2025 17:35:15 +0200 Subject: [PATCH 06/10] Update src/content/docs/en/guides/upgrade-to/v6.mdx Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> --- src/content/docs/en/guides/upgrade-to/v6.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index bcd4471b213af..c3b44ae34f8f7 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -318,7 +318,7 @@ export default defineConfig({ -In Astro v5.0, endpoints with a pathname ending with a file extension (eg. `/src/pages/sitemap.xml.ts`) could be accessed with a trailing slash (`/sitemap.xml/`) or without (`/sitemap.xml`), no matter the value of `build.trailingSlash`. +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. From 57a7ac327846142bcef654db0ac551ab0ae87394 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Wed, 1 Oct 2025 17:35:49 +0200 Subject: [PATCH 07/10] Update src/content/docs/en/guides/upgrade-to/v6.mdx Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> --- src/content/docs/en/guides/upgrade-to/v6.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index c3b44ae34f8f7..c435c7925f0cd 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -324,7 +324,7 @@ In Astro v6.0, these endpoints can only be accessed without a trailing slash. Th #### What should I do? -Review your links and remove any referencing an endpoint ending with a file extension and a trailing slash: +Review your links to your custom endpoints that include a file extension in the URL and remove any trailing slashes: ```html del={1} ins={2} title="src/pages/index.astro" Sitemap From bbb953c301e4a0b694b27ca58f86925a2caefc77 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Wed, 1 Oct 2025 17:38:54 +0200 Subject: [PATCH 08/10] feat --- src/content/docs/en/guides/endpoints.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/content/docs/en/guides/endpoints.mdx b/src/content/docs/en/guides/endpoints.mdx index 3329a1bd64dad..d4c9bff5a65ff 100644 --- a/src/content/docs/en/guides/endpoints.mdx +++ b/src/content/docs/en/guides/endpoints.mdx @@ -47,6 +47,8 @@ import type { APIRoute } from "astro"; export const GET: APIRoute = async ({ params, request }) => {...} ``` +Note that these endpoints can only be accessed without a trailing slash, regardless of your [`build.trailingSlash`](/en/reference/configuration-reference/#trailingslash) configuration. + ### `params` and Dynamic routing Endpoints support the same [dynamic routing](/en/guides/routing/#dynamic-routes) features that pages do. Name your file with a bracketed parameter name and export a [`getStaticPaths()` function](/en/reference/routing-reference/#getstaticpaths). Then, you can access the parameter using the `params` property passed to the endpoint function: From 26259cab1309c0abde3efb66a5ae89466196a3f5 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Wed, 1 Oct 2025 17:59:09 +0200 Subject: [PATCH 09/10] Apply suggestions from code review Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> --- src/content/docs/en/guides/endpoints.mdx | 2 +- src/content/docs/en/guides/upgrade-to/v6.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/en/guides/endpoints.mdx b/src/content/docs/en/guides/endpoints.mdx index d4c9bff5a65ff..51f9c9c65904b 100644 --- a/src/content/docs/en/guides/endpoints.mdx +++ b/src/content/docs/en/guides/endpoints.mdx @@ -47,7 +47,7 @@ import type { APIRoute } from "astro"; export const GET: APIRoute = async ({ params, request }) => {...} ``` -Note that these endpoints can only be accessed without a trailing slash, regardless of your [`build.trailingSlash`](/en/reference/configuration-reference/#trailingslash) configuration. +Note that endpoints whose URLs include a file extension (e.g. `src/pages/sitemap.xml.ts`) can only be accessed without a trailing slash (e.g. `/sitemap.xml`), regardless of your [`build.trailingSlash`](/en/reference/configuration-reference/#trailingslash) configuration. ### `params` and Dynamic routing diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index c435c7925f0cd..3bdbb3609f4e8 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -331,7 +331,7 @@ Review your links to your custom endpoints that include a file extension in the Sitemap ``` -Learn more about [`build.trailingSlash`](/en/reference/configuration-reference/#trailingslash). +Learn more about [custom endpoints](/en/guides/endpoints/). ## Breaking Changes From 277a9b70f664885f7f7cf0928b538df2c92a5d18 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Wed, 1 Oct 2025 18:12:41 +0200 Subject: [PATCH 10/10] feat: move --- src/content/docs/en/guides/upgrade-to/v6.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/docs/en/guides/upgrade-to/v6.mdx b/src/content/docs/en/guides/upgrade-to/v6.mdx index 3bdbb3609f4e8..b440448e608f9 100644 --- a/src/content/docs/en/guides/upgrade-to/v6.mdx +++ b/src/content/docs/en/guides/upgrade-to/v6.mdx @@ -314,6 +314,10 @@ export default defineConfig({ Learn more about [Internationalization routing](/en/guides/internationalization/#routing). +## Breaking Changes + +The following changes are considered breaking changes in Astro v5.0. Breaking changes may or may not provide temporary backwards compatibility. If you were using these features, you may have to update your code as recommended in each entry. + ### Changed: endpoints with a file extension cannot be accessed with a trailing slash @@ -333,10 +337,6 @@ Review your links to your custom endpoints that include a file extension in the Learn more about [custom endpoints](/en/guides/endpoints/). -## Breaking Changes - -The following changes are considered breaking changes in Astro v5.0. Breaking changes may or may not provide temporary backwards compatibility. If you were using these features, you may have to update your code as recommended in each entry. - ## Community Resources Know a good resource for Astro v5.0? [Edit this page](https://github.com/withastro/docs/edit/main/src/content/docs/en/guides/upgrade-to/v6.mdx) and add a link below!