[pull] canary from vercel:canary#1122
Merged
Merged
Conversation
…led (#94655) With `partialPrefetching` enabled, navigating back to a page that was first loaded as a full HTML document served stale dynamic content. Its `connection()`-gated output kept showing the value from the original document load instead of being re-run per request, and the `<Link prefetch={true}>` navigation issued no server request at all. A page first reached through a prefetch behaved correctly, so the problem only surfaced after an initial HTML load. The cause was a missing prefetch hint on the route tree that the client caches from that initial HTML render. The app-page build template assembles the route module's `renderOpts` directly from `nextConfig`, and that field list carried `cacheComponents` and the `experimental` block but left out `partialPrefetching`. So `renderOpts.partialPrefetching` was `undefined` for every runtime render even with the flag on; only the build-time prerender and per-segment prefetch artifacts, produced through the export worker, had the correct value. As a result the route tree computed at runtime and inlined into the initial HTML lacked the `SubtreeHasPartialPrefetching` hint and picked up `SubtreeHasEagerPrefetch` instead. When that tree was later reused for a `prefetch={true}` navigation, the client never downgraded the full prefetch to a partial one, so it promoted the fully resolved hydration entry out of the bfcache into a non-partial segment and served it stale. The fix passes `nextConfig.partialPrefetching` through the template's `renderOpts` (kept raw so `'unstable_eager'` survives), so runtime renders emit the same hint as the build artifacts and the existing client-side downgrade handles the rest. A regression test navigates back to a page after its initial HTML load and asserts, via the router `act` helper, that the navigation re-fetches the dynamic content instead of serving it stale.
Continuation of - #92382 ### What? Adds a `generateStaticParams` section to [Migrating to Cache Components](https://nextjs.org/docs/app/guides/migrating-to-cache-components). ### Why? Developers migrating dynamic routes (for example blogs with `[slug]`) had no guidance in that guide for how `generateStaticParams` behaves with Cache Components, why `next build` can show ◐ instead of ○, or that `return []` becomes a build error. ### How? - Link to `generateStaticParams` with Cache Components, dynamic routes with Cache Components, and the `empty-generate-static-params` message doc instead of duplicating full behavior. - Before/after example: empty array vs at least one sample param. - Short note on ◐ (Partial Prerender) with links to the public pages PPR section and glossary. Related: #92507
…etching" warning (#94683)
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 : )