-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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 #19261
Effects list refactor #19261
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 fed95cf:
|
Details of bundled changes.Comparing: 61dd00d...fed95cf react-dom
ReactDOM: size: 0.0%, gzip: -0.0% Size changes (stable) |
Details of bundled changes.Comparing: 61dd00d...fed95cf react-dom
ReactDOM: size: 0.0%, gzip: -0.0% Size changes (experimental) |
2d01fb4
to
1033552
Compare
packages/react-native-renderer/src/__tests__/createReactNativeComponentClass-test.internal.js
Outdated
Show resolved
Hide resolved
0cad81a
to
162a805
Compare
41cb193
to
f0669de
Compare
5579f7b
to
5cfe800
Compare
Process deletions as we traverse the tree during commit, before we process other effects. This has the result of better mimicking the previous sequencing.
5cfe800
to
fed95cf
Compare
|
||
commitBeforeMutationEffectOnFiber(current, nextEffect); | ||
if (fiber.sibling !== null) { | ||
commitBeforeMutationEffects(fiber.sibling); |
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.
It's unusually to have very deep trees but it's not that unusual to have a few hundred of items in a list. This could cause a stack overflow in that case. We should probably keep the while loop for siblings but not for the recursive effects.
It doesn't even have to be a particularly long list. 10th child inside the 10th child inside the 10th child etc.
Already merged via #19322 |
This branch is phase one of a planned effects list refactor. It includes the following changes:
deletions
Fiber field.subtreeTag
mask field to optimize traversal during commit phase.All unit tests pass in this branch, although one or two required some slight tweaking.
This PR specifically does not include the following refactor pieces:
firstEffect
,lastEffect
, andnextEffect
).subtreeTag
field.Additional follow up work:
wasFiberCloned
heuristic.Co-authored-by: Luna Ruan luna@fb.com