dillon1000/react
Commit
Browse files [Flight] Ensure blocked debug info is handled properly (#34524)
This PR ensures that server components are reliably included in the DevTools component tree, even if debug info is received delayed, e.g. when using a debug channel. The fix consists of three parts: - We must not unset the debug chunk before all debug info entries are resolved. - We must ensure that the "RSC Stream" IO debug info entry is pushed last, after all other entries were resolved. - We need to transfer the debug info from blocked element chunks onto the lazy node and the element. Ideally, we wouldn't even create a lazy node for blocked elements that are at the root of the JSON payload, because that would basically wrap a lazy in a lazy. This optimization that ensures that everything around the blocked element can proceed is only needed for nested elements. However, we also need it for resolving deduped references in blocked root elements, unless we adapt that logic, which would be a bigger lift. When reloading the Flight fixture, the component tree is now displayed deterministically. Previously, it would sometimes omit synchronous server components. <img width="306" height="565" alt="complete" src="https://github.com/user-attachments/assets/db61aa10-1816-43e6-9903-0e585190cdf1" /> --------- Co-authored-by: Sebastian Markbage <[email protected]>
Changed paths5 files
First-parent comparisonpackages/react-client/src/ReactFlightClient.js ModifiedM packages/react-client/src/__tests__/ReactFlight-test.js ModifiedM packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js ModifiedM packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMEdge-test.js ModifiedM packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMNode-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…