mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Partial fallback upgrading is currently too broad. Any PPR fallback shell can be treated as upgradeable, including routes with no `generateStaticParams` and shells that are already as specific as prerendering can make them. In practice, that means we preserve `allowQuery` and 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 `remainingPrerenderableParams` for each fallback shell: the unresolved pathname params that can still be filled by `generateStaticParams` in that branch. We then use that signal to gate partial fallback behavior. With this change: - `partialFallback` is only emitted for shells that still have prerenderable params remaining - `allowQuery` with params is only preserved for those shells Effectively, this limits partial fallback upgrading to shells that can still be made more specific by prerendering.
10 lines
240 B
JavaScript
10 lines
240 B
JavaScript
import fs from 'fs/promises'
|
|
|
|
/** @type {import('next').NextAdapter } */
|
|
export default {
|
|
name: 'adapter-partial-fallback',
|
|
async onBuildComplete(ctx) {
|
|
await fs.writeFile('build-complete.json', JSON.stringify(ctx, null, 2))
|
|
},
|
|
}
|