-
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
Append deletions to the effect list
First clear any progressed deletions for any case where we start over with the "current" set of children. Once we've performed a new reconciliation we need to add the deletions to the side-effect list (which we know is empty because we just emptied it). For other effects, instead of just adding a fiber to an effect list we need to mark it with an update. Then after completion we add it to the the effect list if it had any effects at all. This means that we lose the opportunity to control if a fiber gets added before or after its children but that was already flawed since we want certain side-effects to happen before others on a global level. Instead, we'll do multiple passes through the effect list.
- Loading branch information
commit 86e854e5c5b996bcb8de4f05df9948fcebd38c6b
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
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
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
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.
Why
forEachhere? Would it not make a perf difference to avoid the closure by using a loop?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 a Map and the only other alternative is using the iterator which allocates an object tuple for each item in the iteration.
I think this can be done more efficient than relying on the Map for this but I couldn't come up with something simple enough.