dillon1000/react

Commit

[Flight] Allow cyclic references to be serialized when unwrapping lazy elements (#35471)

When `renderModelDestructive` unwraps a lazy element and subsequently
calls `renderModelDestructive` again with the resolved model, we should
preserve the parent connection so that cyclic references can be
serialized properly. This can occur in an advanced scenario where the
result from the Flight Client is serialized again with the Flight
Server, e.g. for slicing a precomputed payload into multiple parts.

Note: The added test only fails when run with `--prod`. In dev mode, the
component info outlining prevents the issue from occurring.
Browse files
Changed paths2 files
First-parent comparison
M packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMEdge-test.js ModifiedM packages/react-server/src/ReactFlightServer.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…