next.js
711b1bad - [dynamicIO] Split up static generation into two phases (#79629)

Commit
192 days ago
[dynamicIO] Split up static generation into two phases (#79629) When `experimental.dynamicIO` is enabled, we're now prerendering fallback shells for routes that have some entries defined in `generateStaticParams` in a second phase, after the more specific route are prerendered. This will allow us to offer better error messages when those fallback prerenders timeout due to accessing params inside of `"use cache"`. In the future, we might even be able to avoid waiting for a timeout in this case, if we share the resume data cache between the two prerender phases. This would also reduce most of the build performance cost we're adding with this PR temporarily (when the feature flag is enabled). [^1] We're also fixing a bug with this PR, where PPR shells for routes with dynamic params were listed twice in the build output. [^1]: Note that `fetch` responses are already cached and shared between the two phases.
Author
Parents
Loading