-
Notifications
You must be signed in to change notification settings - Fork 46.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Effects list refactor: Move resetChildLanes into complete work #19440
Effects list refactor: Move resetChildLanes into complete work #19440
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c7c0203:
|
@@ -649,6 +671,124 @@ function cutOffTailIfNeeded( | |||
} | |||
} | |||
|
|||
function bubbleProperties(completedWork: Fiber): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the greatest name, but neither was resetChildLanes
. Open to suggestions.
002e2b4
to
d1c9eab
Compare
Details of bundled changes.Comparing: d38ec17...c7c0203 react-dom
ReactDOM: size: 0.0%, gzip: 0.0% Size changes (experimental) |
Details of bundled changes.Comparing: d38ec17...c7c0203 react-dom
ReactDOM: size: 0.0%, gzip: 0.0% Size changes (stable) |
d1c9eab
to
2eb2ccd
Compare
Based on @acdlite's comment on PR #19381...
...it seems there may have been an additional refactoring goal here to bubble properties to a completed Fiber's parent (rather than the parent reading them from its children) so we could remove the child loop that currently exists. I think this is doable, but I think it would also require us to reset We also still loop over children to bubble react/packages/react-reconciler/src/ReactFiberWorkLoop.new.js Lines 1795 to 1803 in 909b612
|
Regarding the |
That makes sense to me.
My guess is that the issue you ran into is when a fiber bails out and you reuse the current child (i.e. returning null from |
Actually, I forgot that in the case of a complete bailout (workInProgress.child === current.child) the bubbled values are the same as current. So you can read off the current fiber, no need to traverse children. Basically, same thing as copying over |
Right. This is what I was thinking too, and what I tried, but it didn't work. Probably missed something though. I'll try again after though, I've made the static change we're discussing on the other PR. |
9faa091
to
ac157d0
Compare
3490152
to
5864d15
Compare
8f0a977
to
7cbd6a1
Compare
This enabled us to remove a few hot path tag-type checks, but did not otherwise change any functionality.
7cbd6a1
to
a789939
Compare
Note this commit fails 5 tests. I am pushing it purely for sharing purposes.
Superseded by #19801 |
Builds on top of #19374
resetChildLanes
out of work loop and into complete work (namedbubbleProperties
)bubbleProperties
into their corresponding switch/case statements.bubbleProperties
method to bubble up to the parent as each Fiber completes, rather than iterating over its children. (This will enable us to remove a potentially expensive while loop.)