[pull] canary from vercel:canary - #1399
Merged
Merged
Conversation
## Summary Fix hybrid App Router and Pages Router projects using Pages i18n so explicit or rewritten locale segments remain available to App Router route matching, while Pages routes continue using locale-normalized paths. The built-in filesystem matcher now carries each route owner through `RouteKind`, avoids duplicate App routes being treated as Pages routes in production, and preserves literal App path parameters through the router server, direct route-module invocation, and static export paths. The same ownership information is maintained by the development bundler. Adds regression coverage for domain locales, proxy rewrites, exact and dynamic App pages, catch-all parameters, route handlers, inferred default locales, and Pages routes. Adapter-generated routing metadata is intentionally handled in the follow-up layers #97366 and #97500. Closes #86048 ## Verification - `pnpm build-all` - `NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-webpack test/e2e/app-dir/i18n-app-pages-domain-routing/i18n-app-pages-domain-routing.test.ts` (9 passed) - Prettier and ESLint checks on all changed files <!-- NEXT_JS_LLM -->
Reverts #98095 A stale merge of #98095 caused failures on canary: https://github.com/vercel/next.js/actions/runs/35075051322 Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
#98527 enabled deployment coverage for a Turbopack-only fixture, but `skipStart` did not prevent deployment during `setup()`. The suite now uses `@force-gate turbopack` to skip setup for other bundlers while preserving Turbopack deployment coverage. This fixes the failure in https://github.com/vercel/next.js/actions/runs/35037213782/job/104625995824.
…98674) ### What? A `"use cache"` segment that reads a root param via `next/root-params` is reused after a client-side navigation that changes that param. With `cacheComponents`, a production build and `<Link prefetch={false}>`: open `/en`, click `de`. URL, `usePathname()` and layout say `de`; the page segment still says `en`. ### Why? Inside a `"use cache"` scope, `getRootParam` only records the name in `readRootParamNames`, which keys the server cache entry. Nothing forwards it to the response's root vary params, so the client re-keys the segment as `Fallback` and reuses it for every locale. `await params` masks the bug because serializing the cache key touches the tracked params object. ### How? `propagateCacheEntryMetadata` adds `readRootParamNames` to the outer store's root vary accumulator when one exists. The client already unions root vary params into every segment. Not covered: `"use cache: private"` root-param reads are only tracked in dev, so the same reuse can still happen there in production. Review order: `use-cache-wrapper.ts` is the whole change (one block after the propagation switch, plus the doc note above `maybePropagateCacheEntryMetadata`). The fixture adds a `[locale]` route under the existing `vary-params` app. Test: `vary-params.test.ts`, "does not reuse a "use cache" segment across root param values", fails with `Received: "Locale: en"` before the fix. Reporter's repro renders `de` after navigation on the patched package. Fixes #98493 cc @unstubbable @lubieowoce (use cache vary params) <!-- NEXT_JS_LLM -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )