partial fallbacks: only upgrade shells with remaining prerenderable params#91158
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Tests Passed |
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **408 kB** → **408 kB** ✅ -9 B80 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
b0d48aa to
d781a43
Compare
d781a43 to
43c3ec0
Compare
43c3ec0 to
1094433
Compare
gnoff
left a comment
There was a problem hiding this comment.
can the tests demonstrate more complex examples. for instance if you have multiple params and they all are available via gSP at least one vs when only some are available via gSP
1094433 to
76e8322
Compare
2d4f86a to
9e3bc3a
Compare
73fc64e to
b4efbdb
Compare
9e3bc3a to
1d62a5f
Compare
1d62a5f to
3260155
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
3260155 to
a63d9ae
Compare
a63d9ae to
967f390
Compare
…91231) In #91158, I wired up the plumbing to indicate whether a partial fallback shell is upgradeable. The previous heuristic was too coarse. This wires up the handling in `next start`. This PR teaches the runtime to complete a fallback shell only as far as prerendering allows. Instead of promoting a generic shell like `/[one]/[two]` directly to `/c/foo`, it promotes it to the most specific prerendered shell for that branch, `/c/[two]`, where `[one]` has `generateStaticParams`. That means later requests can reuse the more complete shell, while fully dynamic params continue to stream as dynamic content. With this change: - the first request still serves the generic fallback shell immediately - the background revalidate writes a more specific shell, not a fully concrete route - later requests for the same prerendered branch reuse that shell - upgrading stops once only fully dynamic params remain This keeps the runtime behavior aligned with the build-time `remainingPrerenderableParams` contract from the downstack PR.

Partial fallback upgrading is currently too broad. Any PPR fallback shell can be treated as upgradeable, including routes with no
generateStaticParamsand shells that are already as specific as prerendering can make them.In practice, that means we preserve
allowQueryand enable background promotion for shells that should remain as partial fallbacks. That broadens the feature beyond the medium-cardinality case it was meant for and makes the build output imply per-param upgradeability when there are no prerenderable params left to fill.This PR teaches static-path generation to compute
remainingPrerenderableParamsfor each fallback shell: the unresolved pathname params that can still be filled bygenerateStaticParamsin that branch. We then use that signal to gate partial fallback behavior.With this change:
partialFallbackis only emitted for shells that still have prerenderable params remainingallowQuerywith params is only preserved for those shellsEffectively, this limits partial fallback upgrading to shells that can still be made more specific by prerendering.