next.js
d3de9bce - Embed static sibling info in route tree (#88692)

Commit
65 days ago
Embed static sibling info in route tree (#88692) This change adds infrastructure for a planned client-side optimization where the router can infer route structure from previously prefetched routes, avoiding redundant route tree requests. When the client prefetches /blog/post-1 and learns the route structure is /blog/[slug], it could potentially reuse that knowledge for /blog/post-2 without another server roundtrip. However, if a static route like /blog/featured exists at the same level, the client needs to know NOT to apply the dynamic template for that URL. staticSiblings provides this information. When a dynamic segment like [slug] has static siblings (e.g., "featured", "archive"), the server includes them in the prefetch response. The client can then check whether an incoming URL matches a known static sibling, and if so, recognize that the previously learned route structure does not apply.
Author
Parents
Loading