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

Prevent client prefetch stream from closing #72420

Merged

Commits on Nov 6, 2024

  1. Prevent client prefetch stream from closing

    When PPR is enabled, prefetch streams may contain references that never
    resolve, because that's how we encode dynamic data access. In the
    decoded object returned by the Flight client, these are reified into
    hanging promises that suspend during render, which is effectively what
    we want. The UI resolves when it switches to the dynamic data stream
    (via useDeferredValue(dynamic, static)).
    
    However, the Flight implementation currently errors if the server closes
    the response before all the references are resolved. As a cheat to work
    around this, we wrap the original stream in a new stream that never
    closes, and therefore doesn't error.
    acdlite committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    e7fd28e View commit details
    Browse the repository at this point in the history