Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CacheNodeSeedData match FlightRouterState more closely #59590

Merged
merged 1 commit into from
Dec 13, 2023

Commits on Dec 13, 2023

  1. Make CacheNodeSeedData match FlightRouterState more closely

    When PPR is enabled, the CacheNodeSeedData and FlightRouterState
    contained in an RSC payload (whether it's static or dynamic) should
    always have the same tree structure.
    
    The only reason the two trees would ever be different is if the
    server partially renders with `loading.tsx`, but that behavior doesn't
    exist when PPR is enabled. (In that case, the CacheNodeSeedData would
    describe only a subset of FlightRouterState.)
    
    The behavior is already correct but to make the types a bit closer,
    this changes the `parallelRoutes` slot of CacheNodeSeedData to be
    non-nullable; if there are no children, it should be an empty object.
    
    It's not semantically important, I'm only changing it to make the types
    more consistent, since we typically traverse both trees in parallel.
    
    Eventually we will probably merge these into a single transport type.
    acdlite committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    1dc40f1 View commit details
    Browse the repository at this point in the history