next.js
f0d81f14 - [ppr] Route Cardinality Updates (#78476)

Commit
1 year ago
[ppr] Route Cardinality Updates (#78476) This enables a new set of cardinality changes for pages with PPR and Dynamic IO enabled on it. When a set of more specific routes are generated, we no longer error when the static shell is empty and instead infer that as a sign that the user doesn't want to provide a route fallback. If the user does in fact place suspense boundaries above params access, the fallback shell will not be empty and will be used. Given the following application structure: ``` /[lang]/layout.tsx /[lang]/[teamSlug]/page.tsx ``` Where we have the following returned for `generateStaticProps`: `[{ lang: "en", teamSlug: "nextjs"}]`, we'd have the following rendered: ``` /[lang]/[teamSlug] <- empty shell won't cause error /en/[teamSlug] <- empty shell won't cause error /en/nextjs <- empty shell will cause error ``` If `/[lang]/[teamSlug]` generated an empty shell, then a request to `/fr/nextjs` wouldn't use the `/[lang]/[teamSlug]` fallback shell and would instead generate a new blocking route shell. Otherwise if it didn't generate an empty shell, it would use the fallback shell that's outputted. If `/en/[teamSlug]` generated an empty shell, then a request to `/en/react` wouldn't use the `/en/[teamSlug]` fallback shell and would instead generate a new blocking route shell. Otherwise if it didn't generate an empty shell, it would use the fallback shell that's outputted.
Author
Parents
Loading