dillon1000/react
Commit
Browse files [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]>
Changed paths3 files
First-parent comparisonpackages/react-server/src/ReactFlightServer.js ModifiedM packages/react-server/src/ReactFlightServerConfigDebugNode.js ModifiedM packages/react-server/src/__tests__/ReactFlightAsyncDebugInfo-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…