Fix i18n redirectToDefaultLocale not working with prefixDefaultLocale#16887
Conversation
🦋 Changeset detectedLatest commit: 4fa53c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 414 packages
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 |
Merging this PR will degrade performance by 20.32%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | Rendering: streaming [true], .md file |
1.3 ms | 1.6 ms | -20.32% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing flue/fix-16800 (4fa53c7) with main (b9f6bb9)
|
I updated the fix. The header need to be deleted because we don't want to pass it downstream. |
* chore(deps): resolve peer dependency issues (#16894) * chore(deps): update eslint to v10 (#16896) * test(vercel): add per-test timeout and raise suite timeout (#16898) * chore: eliminate duplicate pnpm configurations (#16906) * Fix i18n redirectToDefaultLocale not working with prefixDefaultLocale (#16887) * fix(i18n): preserve ROUTE_TYPE_HEADER for i18n post-processing (#16800) * chore: move fix somewhere else * chore: update changeset --------- Co-authored-by: ematipico <[email protected]> * feat(fonts): better bold fallbacks (#16908) * [ci] format * fix(docs): replace last occurrences of `withastro/adapters` (#16693) * fix: astro() marks all pipeline features as used (#16899) * fix: astro() marks all pipeline features as used AstroHandler is the batteries-included handler that wires up every pipeline feature internally. Mark all PipelineFeatures bits at the top of handle() so the one-shot warnMissingFeatures check in BaseApp never fires a false positive when the first request short-circuits (e.g. a redirect route skips middleware). * add changeset * move allFeatures mask to base-pipeline.ts per review * docs: fix typos in astro:i18n middleware JSDoc (#16574) * docs: fix outdated Partytown link (#16865) * chore(deps): update devalue (#16900) * Pre-bundle astro/fetch and astro/hono in Cloudflare optimizeDeps (#16914) ## Goal Eliminate the 'new dependencies optimized: astro/fetch' warning during dev in the Cloudflare adapter. The advanced routing feature (d69f858, #16366) introduced astro/fetch and astro/hono exports, and the Cloudflare handler entry points (01aa164, #16729) import from them — but neither commit added these to the optimizeDeps.include list. Vite discovers them at runtime and triggers a late re-optimization. ## Decisions - Added both astro/fetch and astro/hono: the Cloudflare adapter imports from both (hono.ts imports FetchState from astro/fetch, and astro/hono is used similarly). Pre-bundling both prevents the same issue for either entry point. ## Changes - packages/integrations/cloudflare/src/index.ts: added astro/fetch and astro/hono to the server environment optimizeDeps.include array, alongside the existing astro/app and astro/app/fetch/default-handler entries. * fix(node): serve prerendered pages with build.format 'file' and 'preserve' by passing extensions option to send (#16922) * [ci] format * chore(deps): update `pnpm/action-setup` to v6 (#16904) * chore(deps): update pnpm to v11.5.0 (#16903) * Fix 404 route resolution for experimental.advancedRouting with astro/hono handlers (#16911) Co-authored-by: Emanuele Stoppa <[email protected]> Co-authored-by: Matthew Phillips <[email protected]> * dedupe --------- Co-authored-by: ocavue <[email protected]> Co-authored-by: btea <[email protected]> Co-authored-by: Houston (Bot) <[email protected]> Co-authored-by: Florian Lefebvre <[email protected]> Co-authored-by: Florian Lefebvre <[email protected]> Co-authored-by: Armand Philippot <[email protected]> Co-authored-by: Matthew Phillips <[email protected]> Co-authored-by: dfedoryshchev <[email protected]> Co-authored-by: Andreas Deininger <[email protected]> Co-authored-by: Houston (Bot) <[email protected]> Co-authored-by: Matthew Phillips <[email protected]>
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)) | [`6.4.2` → `6.4.3`](https://renovatebot.com/diffs/npm/astro/6.4.2/6.4.3) |  |  | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v6.4.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#643) [Compare Source](https://github.com/withastro/astro/compare/[email protected]@6.4.3) ##### Patch Changes - [#​16900](withastro/astro#16900) [`17a0fbd`](withastro/astro@17a0fbd) Thanks [@​ocavue](https://github.com/ocavue)! - Bumps `devalue` dependency to v5.8.1 - [#​16016](withastro/astro#16016) [`0d85e1b`](withastro/astro@0d85e1b) Thanks [@​felmonon](https://github.com/felmonon)! - Fix a false positive in the dev toolbar accessibility audit for anchors with text inside closed `<details>` elements. - [#​16911](withastro/astro#16911) [`79c6c46`](withastro/astro@79c6c46) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes a bug where `experimental.advancedRouting` with `astro/hono` handlers threw `TypeError: Cannot read properties of undefined (reading 'route')` for unmatched routes instead of rendering the custom 404 page. - [#​16899](withastro/astro#16899) [`239c469`](withastro/astro@239c469) Thanks [@​matthewp](https://github.com/matthewp)! - Fixes a false "does not call the middleware() handler" warning when using `astro()` in a custom `src/app.ts` and the first request is a redirect route. - [#​16887](withastro/astro#16887) [`493acdb`](withastro/astro@493acdb) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes `redirectToDefaultLocale` not working after the Advanced Routing refactoring. - [#​16908](withastro/astro#16908) [`ef53ab9`](withastro/astro@ef53ab9) Thanks [@​florian-lefebvre](https://github.com/florian-lefebvre)! - Improves optimized fallbacks generation when using the Fonts API by using better metrics for bold variants </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](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMDUuMyIsInVwZGF0ZWRJblZlciI6IjQzLjIwNS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Changes
redirectToDefaultLocalenot working whenprefixDefaultLocale: trueby removing redundantROUTE_TYPE_HEADERdeletion fromAstroMiddleware.#finalize()I18n.finalize()from reading the route type needed to apply redirectsprepareResponse(), making the middleware deletion both redundant and harmfulTesting
packages/astro/test/units/i18n/i18n-app.test.tsthat verify i18n redirects work through theAstroHandlercode pathDocs
Closes #16800