mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
6866b9442c
With Cache Components enabled and Partial Prefetching disabled, blocking prerenders in `next start` could cache params that no `generateStaticParams` result supplies. For `/[top]/[bottom]`, where only `top` is supplied, this included `bottom` in the static HTML and created a separate cache entry for each bottom value. Adapter deployments already enforce this rule. The legacy Vercel builder has a known limitation that the existing prerender tests explicitly exclude. #95872 established that these params must remain dynamic. #96297 later put self-hosted eligibility-based shell keys and fallback-param selection behind the `partialPrefetching` flag, alongside automatic fallback upgrades. #98512 then made resumes honor the parameter set recorded by the selected prerender. That did not create the invalid prerenders, but allowed their over-resolved params to enter Cached Navigations. The RSC test added in #98512 did not account for that known legacy-builder limitation and consequently failed in this [canary deploy run](https://github.com/vercel/next.js/actions/runs/34659100427/job/103469344769). For `next start`, shell keys and unresolved params now follow GSP eligibility even when upgrades are disabled. Cache writes, revalidation, and navigation RDC reads use the same key, including shared shells that cannot be completed further. Routes whose params are all prerenderable retain their existing keys when Partial Prefetching is disabled. Automatic upgrade triggers remain gated. The aforementioned `cached-navigations` tests now separate cold RSC navigation from initial HTML and assert eligibility independently of the observed response. Added coverage checks shell sharing, explicit revalidation, and generated optional paths. Legacy-builder failures are documented with expected-failure gates; its implementation remains unchanged. Verified by running the [full deploy test matrix](https://github.com/vercel/next.js/actions/runs/34771777150) against this PR.