dillon1000/react

Commit

[Flight] Insert an extra await node for awaiting on the promise returned by then callback (#33713)

When a `.then()` callback returns another Promise, there's effectively
another "await" on that Promise that happens in the internals but that
was not modeled. In effect the Promise returned by `.then()` is blocked
on both the original Promise AND the promise returned by the callback.

This models that by cloning the original node and treat that as the
await on the original Promise. Then we use the existing Node to await
the new Promise but its "previous" points to the clone. That way we have
a forked node that awaits both.

---------

Co-authored-by: Sebastian Sebbie Silbermann <[email protected]>
Browse files
Changed paths3 files
First-parent comparison
M packages/react-server/src/ReactFlightServer.js ModifiedM packages/react-server/src/ReactFlightServerConfigDebugNode.js ModifiedM packages/react-server/src/__tests__/ReactFlightAsyncDebugInfo-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…