dillon1000/react
Commit
Browse files [Flight/Fizz] Reset ThenableState Only in Branches Where It's Added (#28068)
Before, we used to reset the thenable state and extract the previous state very early so that it's only the retried task that can possibly consume it. This is nice because we can't accidentally consume that state for any other node. However, it does add a lot of branches of code that has to pass this around. It also adds extra bytes on the stack per node. Even though it's mostly just null. This changes it so that where ever we can create a thenable state (e.g. entering a component with hooks) we first extract this from the task. The principle is that whatever could've created the thenable state in the first place, must always be rerendered so it'll take the same code paths to get there and so we'll always consume it.
Changed paths2 files
First-parent comparisonpackages/react-server/src/ReactFizzServer.js ModifiedM packages/react-server/src/ReactFlightServer.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…