next.js
4ce4c519 - Unify RouteTree and CacheNodeSeedData on the client (#96406)

Commit
10 days ago
Unify RouteTree and CacheNodeSeedData on the client (#96406) The client used to represent a server response as two parallel trees: a RouteTree describing the route structure, and a CacheNodeSeedData tree carrying the rendered output for each segment. The two are meant to be isomorphic, but nothing enforced that — every consumer walked them in lockstep and had to defend against mismatches between them. This PR adds a `data` field to the RouteTree type and makes it generic over a per-segment payload. For a server response, the type is RouteTree<RSCSegmentData | null>. This removes the need to pass a separate CacheNodeSeedData through the client navigation algorithm in ppr-navigations.ts. This is a step toward replacing the RSC response transport format: with the client consuming a single unified tree, the wire format can move to one as well.
Author
Parents
Loading