-
Notifications
You must be signed in to change notification settings - Fork 49.8k
[Fiber] Child Reconciliation, Refs and Life-Cycles #7707
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d9393ee
Add Fragment fiber type
sebmarkbage e8c1cb4
Add Text node types
sebmarkbage d7322d8
Silence Fiber warning when the feature flag is on
sebmarkbage e05ab67
Fix MultiChild tests so they work with Fiber
sebmarkbage 8c7409b
Add comment about bug in yields
sebmarkbage 4ed67f1
Enable text updates in ReactNoop
sebmarkbage dff0faf
Fiber child reconciliation
sebmarkbage 51f2bf9
Add index field to each fiber
sebmarkbage bcbceae
Don't track side-effects unless needed
sebmarkbage c49a91c
Fast path for create child
sebmarkbage be0acf8
Deletion tracking
sebmarkbage 76725fe
Tag the fiber with the kind of side-effect that was applied to it
sebmarkbage 86e854e
Append deletions to the effect list
sebmarkbage eabed69
Move child updates to use the reconciled effects
sebmarkbage 31ca1e7
Remove beginWork shortcut
sebmarkbage 0262e70
Reset effect list when we recompute children
sebmarkbage f3d7116
Always override priority level when visiting children
sebmarkbage 40989f8
Call componentWillUnmount during deletion phase
sebmarkbage 8360088
Fire componentDidMount/componentDidUpdate life-cycles
sebmarkbage 48cf81c
Resolve ref callbacks
sebmarkbage 8721ec1
Invoke all null ref calls before any new ref calls
sebmarkbage d9efde7
Fix resuming bug
sebmarkbage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fast path for create child
When we don't have any previous fibers we can short cut this path knowing that we will never have any previous child to compare to. This also ensures that we don't create an empty Map in this case.
- Loading branch information
commit c49a91c24679624a7ac093a9307a4f5daacd43a4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 might be a stupid question but I've looked at it for a while and still don't get it—why is it called
mapAndDeleteRemainingChildrenif it iterates over all the children?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 is not all children.
oldFiberis the last fiber that wasn't consumed above.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.
Ugh. Duh. Thanks.
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.
Could probably use some renames in here at some point.
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 may just be my brain struggling to read mutating code after avoiding it for a while.