next.js
f11cfde4 - Skip generating fallback shells for routes with undefined root params

Commit
154 days ago
Skip generating fallback shells for routes with undefined root params Routes with undefined root params always use `BLOCKING_STATIC_RENDER` (or `NOT_FOUND` when `dynamicParams` is `false`), which means the server does a full on-demand prerender instead of serving a prebuilt shell. The fallback shell HTML was therefore dead output that was never served at runtime. The previous code already skipped this generation when `cacheComponents` was disabled, but the `cacheComponents` exception (added in badf4b6c17 for `clientParamParsing`) was unnecessary because `calculateFallbackMode` was never updated to return `PRERENDER` for these routes. The generated shells also contained incorrect content due to the Resume Data Cache (RDC) leaking values from a previous specific shell prerender. When we want to serve these fallback shells in the future, we will also need to overhaul how the RDC is shared between specific shell prerendering and fallback shell prerendering, similar to the cache key upgrades already done for cache handlers. Cache functions that access root fallback params would then likely become dynamic holes in the fallback shell, the same as for normal route fallback params today.
Author
Committer
Parents
Loading