Skip to content

Commit

Permalink
[Flight/Fizz] Reset ThenableState Only in Branches Where It's Added (#…
Browse files Browse the repository at this point in the history
…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.

DiffTrain build for [382190c](382190c)
  • Loading branch information
sebmarkbage committed Jan 26, 2024
1 parent 68cd468 commit b9b97d9
Show file tree
Hide file tree
Showing 13 changed files with 739 additions and 1,315 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b123b9c4f054a7def7ed84e350ccd46cc86672a6
382190c595126837ee7e43b4fa953f4edd30e01c
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-www-modern-60875b50";
var ReactVersion = "18.3.0-www-modern-c131adbc";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Loading

0 comments on commit b9b97d9

Please sign in to comment.