Skip to content

fix(i18n): only swap whole locale segments when generating fallback routes - #17861

Merged
ematipico merged 1 commit into
withastro:mainfrom
ethanstoner:fix/i18n-fallback-locale-segment
Sep 1, 2026
Merged

ematipico merged 1 commit into
withastro:mainfrom
ethanstoner:fix/i18n-fallback-locale-segment

Conversation

@ethanstoner

Copy link
Copy Markdown
Contributor

Changes

  • createI18nFallbackRoutes builds each fallback route by swapping the source locale segment for the target one via replaceOrKeep. That helper chained two unanchored String.prototype.replace calls:

    return original.replace(`/${from}/`, `/${to}/`).replace(`/${from}`, `/${to}`);

    The first call rewrites the leading segment; the second then runs on the already rewritten string and matches /${from} anywhere in it. Whenever a later path segment happens to start with the locale code, the second call corrupts it:

    route fallback produced expected
    /en/enterprise { es: 'en' } /es/esterprise /es/enterprise
    /en/blog/entry { es: 'en' } /es/blog/estry /es/blog/entry
    /es/estudio { fr: 'es' } /fr/frtudio /fr/estudio

    The resulting type: 'fallback' RouteData carries the mangled route/pathname, and its pattern is compiled from them — so the fallback never matches the URL it was meant to cover.

  • Match on whole path segments instead. This mirrors how routes are grouped by locale earlier in the same function (route.route.split('/').includes(locale)), so the two stay consistent.

  • Changeset added (astro, patch).

Both code paths that reach replaceOrKeep are affected: fallback targeting a non-default locale (e.g. { fr: 'es' }), and any fallback under prefixDefaultLocale: true.

Related: #14020 introduced replaceOrKeep; #14690 fixed the neighbouring "filename starts with a locale key" case for the default-locale branch, which does not go through this helper.

Testing

Three cases added to packages/astro/test/units/i18n/create-manifest.test.ts, all failing before the change and passing after:

Before (unmodified main):

✖ rewrites only the leading locale segment when falling back to a non-default locale
  + '/fr/frtudio'   - '/fr/estudio'
✖ rewrites only the leading locale segment under prefix-always
  + '/es/esterprise' - '/es/enterprise'
✖ leaves a locale code in a deeper segment untouched
  + '/es/blog/estry' - '/es/blog/entry'
ℹ tests 10 / pass 7 / fail 3

After:

ℹ tests 10 / pass 10 / fail 0

I also diffed the old and new helper across the inputs the existing tests and fixtures exercise (/es/about, /en, /about, /start, /blog/en/post, /en/[slug], /en/index, /es/other, /spanish/x) — the two agree on every one of them; only the corrupted cases above change.

Suites run locally (Windows, Node 22.15, pnpm 11.13.1):

  • pnpm --filter astro run test:unit — 3445 tests, 0 failures
  • pnpm --filter astro run test:integration — 1257 tests, 2 failures: Content Collections > Handles symlinked content and > Handles symlinked data. Both are pre-existing and unrelated — I stashed the whole change, rebuilt, and re-ran that file on a clean tree, where they fail identically (Windows symlink permissions).
  • pnpm typecheck — clean
  • biome check / biome lint / eslint on the changed files — clean

Docs

No docs change needed — this restores the documented i18n.fallback behaviour rather than altering it.

…outes

`replaceOrKeep` chained two unanchored `String.replace` calls, so the second
one could rewrite a locale code occurring anywhere in the already-rewritten
path. A page at `src/pages/en/enterprise.astro` with `fallback: { es: 'en' }`
produced `/es/esterprise`, and `/en/blog/entry` produced `/es/blog/estry`.

Match on whole path segments instead, the same way routes are grouped by
locale further up in the function.

Claude-Session: https://claude.ai/code/session_01LYqwrPj3Q6qGy4VXCKeuf6
@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Aug 30, 2026
@changeset-bot

changeset-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8576259

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 423 packages
Name Type
astro Patch
@e2e/astro-linked-lib Patch
@e2e/actions-blog Patch
@e2e/actions-react-19 Patch
@e2e/astro-component Patch
@e2e/astro-envs Patch
@e2e/astro-island-hydration-error Patch
@test/astro-cloudflare-node-prerender-mdx Patch
@test/astro-cloudflare Patch
@e2e/content-collections Patch
@e2e/csp-server-islands Patch
@e2e/css Patch
@test/custom-client-directives Patch
@e2e/dev-toolbar Patch
@e2e/error-cyclic Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/hydration-race Patch
@e2e/i18n Patch
@test/nested-style-bug-e22e Patch
@e2e/preact-compat-component Patch
@e2e/preact-component Patch
@e2e/preact-lazy-component Patch
@e2e/prefetch Patch
@e2e/react-component Patch
@e2e/server-islands-key Patch
@e2e/server-islands Patch
@e2e/solid-circular Patch
@e2e/solid-component Patch
@e2e/solid-recurse Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch
@e2e/view-transitions Patch
@e2e/vue-component Patch
@performance/md Patch
@performance/mdoc Patch
@performance/mdx Patch
@test/0-css Patch
fake-astro-library Patch
@test/actions Patch
@test/alias-css-url-data-uri Patch
@test/alias-css-url Patch
@test/alias-path-alias-style Patch
@test/ts-paths-no-baseurl Patch
@test/aliases-tsconfig Patch
@test/aliases Patch
@test/api-routes Patch
@test/asset-query-params-chunks Patch
@test/asset-url-base Patch
@test/astro-pages Patch
@test/astro-assets-prefix Patch
@test/astro-assets Patch
@test/astro-basic Patch
@test/astro-check-errors Patch
@test/astro-check-no-errors Patch
@test/astro-check-watch Patch
@test/astro-children Patch
@test/astro-client-only Patch
@test/astro-component-bundling Patch
@test/astro-component-code Patch
@test/astro-css-bundling Patch
@test/astro-dev-headers Patch
@test/astro-dev-http2 Patch
@test/astro-doctype Patch
@test/astro-dynamic Patch
@test/astro-env-content-collections Patch
@test/astro-env-required-public Patch
@test/astro-env-server-fail Patch
@test/astro-env-server-secret Patch
@test/astro-env Patch
@test/astro-envs Patch
@test/astro-expr Patch
@test/astro-get-static-paths Patch
@test/astro-head Patch
@test/astro-manifest-client-script Patch
@test/astro-manifest-invalid Patch
@test/astro-manifest Patch
@test/astro-markdown-frontmatter-injection Patch
@test/astro-markdown-plugins Patch
@test/astro-markdown-remarkRehype Patch
@test/astro-markdown-skiki-default-color Patch
@test/astro-markdown-skiki-langs Patch
@test/astro-markdown-skiki-themes-custom Patch
@test/astro-markdown-skiki-themes-integrated Patch
@test/astro-markdown-skiki-wrap-false Patch
@test/astro-markdown-skiki-wrap-null Patch
@test/astro-markdown-skiki-wrap-true Patch
@test/astro-markdown-url Patch
@test/astro-markdown Patch
@test/astro-mode Patch
@test/astro-page-directory-url Patch
@test/astro-partial-html Patch
@test/astro-preview-allowed-hosts Patch
@test/astro-preview-headers Patch
@test/astro-public Patch
@test/astro-script-template-dedup Patch
@test/astro-scripts Patch
@test/astro-slots-nested Patch
@test/concurrency Patch
@test/build-readonly-file Patch
@test/cache-memory-query-include Patch
@test/cache-memory-query Patch
@test/client-address-node Patch
@test/client-only-child-styles Patch
@test/client-only-css-chunk-leak Patch
@test/code-component Patch
@test/component-library Patch
@test/config-vite-css-target-no-minify Patch
@test/config-vite-css-target Patch
@test/config-vite Patch
@test/react-container Patch
@test/content-with-spaces-in-folder-name Patch
@test/content-collection-picture-render Patch
@example/content-collection-references Patch
@test/content-collection-tla-svg Patch
@test/content-collections-base Patch
@test/content-collections-empty-dir Patch
@test/content-collections-empty-md-file Patch
@test/content-collections-image-hmr Patch
@test/content-collections-mutation Patch
@test/content-collections-number-id Patch
@test/content-collections-type-inference Patch
@test/content-collections-with-config-mjs Patch
@test/content-collections Patch
@test/content-frontmatter Patch
@test/content-intellisense Patch
@test/content-layer-loader-schema-function Patch
@test/content-layer-remark-plugins Patch
@test/content-layer Patch
@test/content-ssr-integration Patch
@test/content-static-paths-integration Patch
@test/content Patch
@test/core-image-data-url Patch
@test/core-image-deletion-ssr Patch
@test/core-image-deletion Patch
@test/core-image-errors Patch
@test/core-image-fs-config Patch
@test/core-image-remark-infersize Patch
@test/core-image-layout Patch
@test/core-image-picture-emit-file Patch
@test/core-image-remark-imgattr Patch
@test/core-image-ssg Patch
@test/core-image-ssr Patch
@test/core-image-svg-in-client Patch
@test/core-image-svg Patch
@test/core-image-unconventional-settings Patch
@test/core-image Patch
@test/csp-adapter Patch
@test/csp-fonts Patch
@test/csp Patch
@test/css-assets Patch
@test/css-dangling-references Patch
@test/css-deduplication Patch
@test/css-double-bundle Patch
@test/css-dynamic-import-dev Patch
@test/css-import-as-inline Patch
@test/css-inline-stylesheets Patch
@test/css-no-code-split Patch
@test/css-path-case Patch
@test/css-pure-chunk-query-params Patch
@test/css-server-output-dedup Patch
@test/custom-404-injected-from-dep Patch
@test/custom-404-pkg Patch
custom-fetch-error-pages Patch
@test/custom-renderer Patch
@test/data-collections-schema Patch
@test/data-collections Patch
@test/debug-component Patch
@test/dev-container Patch
@test/dev-render Patch
@test/dev-request-url Patch
@test/dynamic-endpoint-collision Patch
@test/dynamic-route-build-file Patch
@test/endpoint-routing Patch
@test/error-bad-js Patch
@test/error-build-location Patch
@test/error-non-error Patch
@test/extension-matching Patch
@test/fetch Patch
@test/fonts Patch
@test/astro-fontsource-package Patch
@test/get-static-paths-pages Patch
@test/glob-pages-css Patch
@test/head-propagation-prerender-env Patch
@test/hmr-markdown Patch
@test/hmr-middleware Patch
@test/hmr-new-page Patch
@test/hmr-slots-render Patch
@test/hoisted-imports Patch
@test/html-component Patch
@test/html-escape Patch
@test/html-page Patch
@test/html-slots Patch
@test/hydration-race Patch
@test/i18n-client-import Patch
@test/i18n-css-leak-basic Patch
@test/import-ts-with-js Patch
@test/impostor-md-file Patch
@test/incremental-build-client-only Patch
@test/incremental-build-concurrency Patch
@test/incremental-build-content Patch
@test/incremental-build-drop-key Patch
@test/incremental-build-dynamic-import Patch
@test/incremental-build-fonts Patch
@test/incremental-build-headers Patch
@test/incremental-build-images Patch
@test/incremental-build-islands Patch
@test/incremental-build-no-output Patch
@test/incremental-build-script Patch
@test/incremental-build Patch
@test/integration-add-page-extension Patch
@test/integration-server-setup Patch
@test/jsx-queue-rendering Patch
@test/large-array-solid Patch
@test/legacy-collections-backwards-compat Patch
@test/lightningcss-css-modules-content Patch
@test/lightningcss-scoped-nesting Patch
@test/live-loaders Patch
@test/markdown Patch
@test/middleware-dev Patch
@test/middleware-full-ssr Patch
@test/middleware-no-user-middlewaqre Patch
@test/middleware-tailwind Patch
@test/minification-html-default Patch
@test/minification-html-jsx Patch
@test/minification-html Patch
@test/non-ascii-path Patch
@test/non-html-pages Patch
@test/page-format Patch
@test/page-level-styles Patch
@test/parallel-components Patch
@test/partials-css-boundary Patch
@test/partials Patch
@test/passthrough-image-service Patch
@test/postcss Patch
@test/preact-compat-component Patch
@test/preact-component Patch
@test/remote-css Patch
@test/request-signal Patch
@test/reuse-injected-entrypoint Patch
@test/root-srcdir-css Patch
@test/scoped-style-strategy Patch
@test/server-entry-fake-adapter Patch
@test/server-entry Patch
@test/server-islands-hybrid Patch
@test/server-islands-ssr Patch
@test/session-false Patch
@test/session-tree-shake Patch
@test/sessions Patch
@test/slots-preact Patch
@test/slots-react Patch
@test/slots-solid Patch
@test/slots-svelte Patch
@test/slots-vue Patch
@test/solid-component Patch
@test/sourcemap Patch
@test/space-in-folder-name Patch
@test/special-chars-in-component-imports Patch
@test/ssr-assets Patch
@test/ssr-dynamic Patch
@test/ssr-partytown Patch
@test/ssr-prerender-get-static-paths Patch
@test/ssr-prerender Patch
@test/ssr-preview Patch
@test/ssr-renderers-static-vue Patch
@test/ssr-request Patch
@test/ssr-hoisted-script Patch
@test/ssr-scripts Patch
@test/static-build-code-component Patch
@test/static-build-dir Patch
@test/static-build-frameworks Patch
@test/static-build-page-url-format Patch
@test/static-build-ssr Patch
@test/static-build Patch
@test/static-redirect Patch
@test/svelte-component Patch
@test/svg-deduplication Patch
@test/tailwindcss Patch
@e2e/third-party-astro Patch
@test/url-import-suffix Patch
@test/view-transitions Patch
@test/virtual-astro-file Patch
@test/vite-virtual-modules Patch
@test/vitest Patch
@test/vue-component Patch
@test/vue-with-multi-renderer Patch
@test/alpinejs-basics Patch
@test/alpinejs-directive Patch
@test/alpinejs-plugin-script-import Patch
@test/astro-cloudflare-allowed-hosts Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-binding-image-cache Patch
@test/astro-cloudflare-binding-image-service Patch
@test/astro-cloudflare-cache-provider-wait-until Patch
@test/astro-cloudflare-cache-provider Patch
@test/astro-cloudflare-client-address Patch
@test/astro-cloudflare-compile-custom-image-service Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-custom-entryfile-fetch-state Patch
@test/astro-cloudflare-custom-entryfile Patch
@test/astro-cloudflare-custom-image-service Patch
@test/astro-cloudflare-dev-image-endpoint Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-external-redirects Patch
@test/cloudflare-incremental-images Patch
@test/astro-cloudflare-internal-redirects Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-prerender-node-env Patch
@test/astro-cloudflare-prerender-queue-consumers Patch
@test/astro-cloudflare-prerender-styles Patch
@test/astro-cloudflare-prerenderer-errors Patch
@test/astro-cloudflare-prerenderer-render-error Patch
@test/routing-priority-cloudflare Patch
@test/cf-server-entry Patch
@test/astro-cloudflare-server-island-prerender-framework Patch
@test/astro-cloudflare-sql-import Patch
@test/cf-ssr-deps Patch
@test/astro-cloudflare-static Patch
@test/astro-cloudflare-svelte-rune-deps Patch
@test/astro-cloudflare-top-level-return Patch
@test/cf-user-optimize-deps Patch
@test/astro-cloudflare-vite-plugin Patch
@test/astro-cloudflare-with-base Patch
@test/astro-cloudflare-with-react Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-with-svelte Patch
@test/astro-cloudflare-with-vue Patch
@test/astro-cloudflare-wrangler-preview-platform Patch
@test/markdoc-content-collections Patch
@test/content-layer-markdoc Patch
@test/headings-custom Patch
@test/headings Patch
@test/image-assets-custom Patch
@test/image-assets Patch
@test/markdoc-propagated-assets Patch
@test/markdoc-render-with-space Patch
@test/markdoc-render-html Patch
@test/markdoc-render-null Patch
@test/markdoc-render-partials Patch
@test/markdoc-render-simple Patch
@test/markdoc-render-table-attrs Patch
@test/markdoc-render-this-context Patch
@test/markdoc-render-typographer Patch
@test/markdoc-render-with-components Patch
@test/markdoc-render-with-config Patch
@test/markdoc-render-with-extends-components Patch
@test/markdoc-render-with-indented-components Patch
@test/markdoc-render-with-transform Patch
@test/markdoc-variables Patch
@test/content-layer-rendering Patch
@test/mdx-css-head-mdx Patch
@test/image-remark-imgattr Patch
@test/mdx-astro-container-escape Patch
@test/mdx-frontmatter-injection Patch
@test/netlify-skew-protection Patch
@test/netlify-hosted-astro-project Patch
@test/nodejs-api-route Patch
@test/nodejs-badurls Patch
@test/nodejs-encoded Patch
@test/nodejs-errors Patch
@test/nodejs-headers Patch
@test/nodejs-image Patch
@test/locals Patch
@test/node-middleware Patch
@test/nodejs-prerender-404-500 Patch
@test/nodejs-prerender Patch
@test/nodejs-prerendered-error-page-fetch Patch
@test/nodejs-preview-headers Patch
@test/redirects Patch
@test/node-sessions Patch
@test/ssr-assets-middleware Patch
@test/node-static-headers Patch
@test/node-trailingslash Patch
@test/url Patch
@test/well-known-locations Patch
@test/react-component Patch
@test/sitemap-chunks Patch
@test/sitemap-dynamic Patch
@test/sitemap-i18n-fallback Patch
@test/sitemap-ssr Patch
@test/sitemap-static Patch
@test/sitemap-trailing-slash Patch
async-rendering Patch
conditional-rendering Patch
@test/empty-class Patch
svelte-prop-types Patch
@test/astro-vercel-basic Patch
@test/astro-vercel-image Patch
@test/astro-vercel-integration-assets Patch
@test/vercel-isr-edge-no-middleware Patch
@test/vercel-isr-with-edge-middleware Patch
@test/vercel-isr Patch
@test/vercel-max-duration Patch
@test/vercel-edge-middleware-with-edge-file Patch
@test/vercel-edge-middleware-without-edge-file Patch
@test/astro-vercel-no-output Patch
@test/astro-vercel-outdir-outside-root Patch
@test/astro-vercel-prerendered-error-pages Patch
@test/astro-vercel-redirects-serverless Patch
@test/astro-vercel-redirects Patch
@test/vercel-server-islands-static Patch
@test/vercel-server-islands Patch
@test/astro-vercel-serverless-prerender Patch
@test/astro-vercel-serverless-with-dynamic-routes Patch
@test/astro-vercel-static-assets Patch
@test/vercel-static-headers Patch
@test/astro-vercel-static Patch
@test/vercel-streaming Patch
@test/astro-vercel-with-web-analytics-enabled-output-as-static Patch
vercel-hosted-astro-project Patch
@test/vue-app-entrypoint-async Patch
@test/vue-app-entrypoint-css Patch
@test/vue-app-entrypoint-no-export-default Patch
@test/vue-app-entrypoint-relative Patch
@test/vue-app-entrypoint-src-absolute Patch
@test/vue-app-entrypoint Patch
@test/vue-basics Patch
vue-prop-types Patch
astro-benchmark Patch
@benchmark/adapter Patch
@benchmark/timer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codspeed

codspeed Bot commented Aug 30, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.42%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 20 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation Build: hybrid site (static + server) 1.4 s 1.7 s -15.42%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ethanstoner:fix/i18n-fallback-locale-segment (8576259) with main (f8e9458)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (19dae21) during the generation of this report, so f8e9458 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@ethanstoner

Copy link
Copy Markdown
Contributor Author

On the CodSpeed report flagging −15.42% on Build: hybrid site (static + server) — that regression cannot come from this diff, and the report says as much in its own footnotes.

The changed function is only reachable through i18n fallback route generation:

  • replaceOrKeep is called from exactly three places, all inside createI18nFallbackRoutes (create-manifest.ts:932, :954, :956); it has no other callers.
  • createI18nFallbackRoutes takes i18n: NonNullable<AstroConfig['i18n']>, so it does not run without an i18n config.
  • benchmark/static-projects/build-hybrid/astro.config.js has no i18n, locales or fallback key at all.

So the modified code executes zero times in that benchmark.

The report also carries two caveats of its own: "Different runtime environments detected", and the footnote "No successful run was found on main (19dae21) during the generation of this report, so f8e9458 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report." A wrong base plus a different runner is enough to explain a 1.4s → 1.7s swing on a whole-site build.

Happy to re-run it if a maintainer would rather see a clean comparison once main has a successful baseline.

@ematipico

Copy link
Copy Markdown
Member

Please create a new bug report with a minimal reproduction

@ethanstoner

Copy link
Copy Markdown
Contributor Author

Filed as #17880 with a minimal reproduction: https://github.com/ethanstoner/astro-i18n-fallback-repro

Two pages and an i18n config. npm install && npm run build on astro 7.2.9 emits dist/es/esterprise/index.html, and the build log prints that path itself. Patching only replaceOrKeep in node_modules with the version in this PR, then rebuilding the same project, gives dist/es/enterprise/index.html.

@ematipico ematipico added the pr: astro-review Triggers a bot to do an automated review label Sep 1, 2026
@astro-factory astro-factory Bot removed the pr: astro-review Triggers a bot to do an automated review label Sep 1, 2026

@astro-factory astro-factory Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

No findings.

Merge Requirement Assessment

Status: satisfied

  • Fix corrupted i18n fallback routes when a locale code also prefixes a later path segment — implemented by rewriting replaceOrKeep in packages/astro/src/core/routing/create-manifest.ts to swap whole path segments. /en/enterprise with { es: 'en' } now produces /es/enterprise; /es/estudio with { fr: 'es' } produces /fr/estudio; /en/blog/entry with { es: 'en' } produces /es/blog/entry.

Review Status

Verdict: ready to merge based on static review
Context: PR #17861 (withastro/astro) and its description / related issue notes
Scope: PR base 19dae21 → head 8576259
Changeset: present and covers astro
Limitations: none
Validation: Static review only; no project code, tests, builds, or checks were run.
GitHub context: collected via read-only PR tools
Git scope: PR base/head verified

This review was made by an LLM. The analysis may be wrong, and reports might be incorrect.

@ematipico
ematipico merged commit 3193988 into withastro:main Sep 1, 2026
29 of 31 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Sep 1, 2026
dadezzz pushed a commit to dadezzz/university_notes that referenced this pull request Sep 9, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`7.2.10` → `7.3.1`](https://renovatebot.com/diffs/npm/astro/7.2.10/7.3.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/astro/7.3.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/astro/7.2.10/7.3.1?slim=true) |

---

### Release Notes

<details>
<summary>withastro/astro (astro)</summary>

### [`v7.3.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#731)

[Compare Source](https://github.com/withastro/astro/compare/[email protected]@7.3.1)

##### Patch Changes

- [#&#8203;17899](withastro/astro#17899) [`0389640`](withastro/astro@0389640) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an error that prevented projects using `astro:assets` from starting or building

### [`v7.3.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#730)

[Compare Source](https://github.com/withastro/astro/compare/[email protected]@7.3.0)

##### Minor Changes

- [#&#8203;17767](withastro/astro#17767) [`ce7c91f`](withastro/astro@ce7c91f) Thanks [@&#8203;astro-factory](https://github.com/apps/astro-factory)! - Adds `--ignore-lock` flag to `astro preview`, allowing multiple preview servers to run simultaneously on different ports. This is useful for E2E testing workflows (e.g., Playwright) that need to run several preview servers at once.

- [#&#8203;17818](withastro/astro#17818) [`c0b6581`](withastro/astro@c0b6581) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a `logger` parameter to image services hooks

  Custom image services now receive Astro's runtime logger as an extra argument. Messages logged with it are routed through the destination configured in `logger` and respect your log level, instead of being written straight to the console:

  ```ts
  import type { LocalImageService } from 'astro';

  const service: LocalImageService = {
    // ...
    async transform(inputBuffer, transform, imageConfig, logger) {
      logger.warn(`Could not optimize "${transform.src}". Passing it through unchanged.`);
      return { data: inputBuffer, format: 'png' };
    },
  };
  ```

  Astro's built-in Sharp service now uses this logger for the warnings it emits when it encounters an unexpected or unsupported source format.

- [#&#8203;17818](withastro/astro#17818) [`c0b6581`](withastro/astro@c0b6581) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds `logger` to the context object passed to cache providers

  Custom cache providers now receive Astro's runtime logger on the context passed to `onRequest()`. Messages logged with it are routed through the destination configured in `logger` and respect your log level, instead of being written straight to the console:

  ```ts
  import type { CacheProvider } from 'astro';

  const provider: CacheProvider = {
    name: 'my-cache',
    async onRequest({ request, url, logger }, next) {
      logger.warn(`Skipping cache for ${url.pathname} because the response sets a cookie.`);
      return next();
    },
    // ...
  };
  ```

  Astro's built-in `memoryCache()` provider now uses this logger for the warnings it emits when it skips caching a response that sets cookies, and when a background revalidation fails.

##### Patch Changes

- [#&#8203;17818](withastro/astro#17818) [`c0b6581`](withastro/astro@c0b6581) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates Astro's remaining internal warnings and errors to be written through the configured logger instead of directly to the console, when possible

- [#&#8203;17886](withastro/astro#17886) [`e747cba`](withastro/astro@e747cba) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes the memory cache provider to skip responses with `Vary: Cookie` or `Vary: *`

- [#&#8203;17885](withastro/astro#17885) [`916b738`](withastro/astro@916b738) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Improves build performance for sites with a large number of pages coming from a large amount of different modules.

- [#&#8203;17795](withastro/astro#17795) [`15e2deb`](withastro/astro@15e2deb) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds concurrent rendering support for `experimental.incrementalBuild`, including when using `@astrojs/cloudflare`

  Incremental builds no longer disable caching when `build.concurrency` is greater than `1`. Projects that set `build.concurrency: 1` to keep the cache enabled can remove that workaround. Cloudflare builds also reduce serialization overhead for large prerendered pages.

- [#&#8203;17879](withastro/astro#17879) [`21c34a6`](withastro/astro@21c34a6) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes missing styles, links, and scripts from content collection entries rendered inside server islands

- [#&#8203;17861](withastro/astro#17861) [`3193988`](withastro/astro@3193988) Thanks [@&#8203;ethanstoner](https://github.com/ethanstoner)! - Fixes i18n fallback routes being generated with a corrupted path when the locale code also appears at the start of a later path segment. A page such as `src/pages/en/enterprise.astro` with `fallback: { es: 'en' }` produced the route `/es/esterprise` instead of `/es/enterprise`, so the fallback never matched the intended URL. Only the leading locale segment is rewritten now.

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC42NS41IiwidXBkYXRlZEluVmVyIjoiNDQuNjUuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants