[PPF] Implement `unstable_ensureStatic = "shell" | "prefetch"` (#98191)
Builds on #98129, where we made it possible for shells to be static while the prefetches depending on where runtime data is accessed: - `ensureStatic = "shell"` simply defers all runtime tracking until the prefetch (semantically, it's as if it was gated by `await prefetch()`). this means that the shell will always be considered static (although the prefetch can still be runtime) - `ensureStatic = "prefetch"` is analogous, but means that the prefetch should be static (semantically, it's as if it was gated by `await navigation()`). this effectively skips the tracking altogether, and *both* the shell and the prefetch will be static. - notably, in this mode, accessing fallback params in an ISR fallback no longer sets `needsRuntimeRequest` either, because the config disallows runtime prefetches, even if it'd let us skip waiting for the ISR prerender to finish. note that "static" here means "statically prerendered", as opposed to "rendered on demand via runtime prerender". both options still allow the prerender to have dynamic holes. disallowing dynamic holes altogether will be handled by `ensureStatic = "navigation"` in a follow up. ### Implementation notes i've also renamed `walkNeedsRuntimeCompleteness` to `walkCanUseRuntimeRequests` -- in practice, the function checks "is this a PPF route", but being PPF no longer means that runtime completeness is required, because `ensureStatic` deliberately gets rid of it. `walkCanUseRuntimeRequests` is a bit more accurate, because it tells us whether runtime requests are possible at all. This change (and the associated changes in comments) are in a separate commit for ease of review.
Showing
This diff is collapsed.
Please
register
or
sign in
to comment