-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Add Fragment as a named export to React #10783
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
284efed
Add Fragment as a named export to React
c26914b
Remove extra tests for Fragment
adb7c61
Change React.Fragment export to be a string '#fragment'
3804288
Fix fragment special case to work with 1 child
f201879
Add single child test for fragment export
3a21716
Move fragment definition to ReactEntry.js and render components for k…
480e8d1
Inline createFiberFromElementType into createFiberFromElement
29e6472
Update reconciliation to special case fragments
e62c4b4
Use same semantics as implicit childsets for ReactFragment
e0c0a1c
Add more fragment state preservation tests
c74af40
Export symbol instead of string for fragments
1f9ef58
Fix rebase breakages
14d3a1b
Re-apply prettier at 1.2.2
6df523d
Merge branches in updateElement
b4f17f6
Remove unnecessary check
6b374f8
Re-use createFiberFromFragment for fragment case
7ceb631
Simplyify branches by adding type field to fragment fiber
53969d3
Move branching logic for fragments to broader methods when possible.
8ecb60c
Add more tests for fragments
ab1a58e
Address Dan's feedback
b7fff43
Move REACT_FRAGMENT_TYPE into __DEV__ block for DCE
a6aca28
Change hex representation of REACT_FRAGMENT_TYPE to follow convention
372a62a
Remove unnecessary branching and isArray checks
8405465
Update test for preserving children state when keys are same
cee245c
Fix updateSlot bug and add more tests
b3bac19
Make fragment tests more robust by using ops pattern
198ad8c
Update jsx element validator to allow numbers and symbols
1a47984
Remove type field from fragment fiber
5edee97
Fork reconcileChildFibers instead of recursing
1539f19
Merge branch 'master' into react-fragment-export
367c7e6
Merge branch 'master' into react-fragment-export
59f6828
Use ternary if condition
d29bd31
Revamp fragment test suite:
8c070e6
Check output of renderer in fragment tests to ensure no silly busines…
545d0b9
Finish implementation of fragment reconciliation with desired behavior
c8a0752
Add reverse render direction for fragment tests
fe2dd4d
Merge branch 'master' into react-fragment-export
48bcaa7
Remove unneeded fragment branch in updateElement
b3864af
Add more test cases for ReactFragment
17ac4a2
Handle childless fragment in reconciler
27312d0
Support fragment flattening in SSR
87ab859
Clean up ReactPartialRenderer
f9443d1
Warn when non-key and children props are passed to fragments
97d1bdd
Add non-null key check back to updateSlot's array's case
clemmy 71252b9
Add test for positional reconciliation in fragments
8cbc93d
Add warning for refs in fragments with stack trace
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
There are no files selected for viewing
This file contains 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 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 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
Oops, something went wrong.
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 is just an optimization right? Not semantic meaning. I wonder if this is just slowing down the normal case where this is
true
since the check will happen again then.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.
Is there a way to do less checks? I think that every way we re-write this, there still ends up being 3 checks. https://github.com/facebook/react/pull/10783/files/48bcaa7198ef5d97bfc78badd1636a836a076cda..27312d0ebbc3ebbdaa8dc48e6f70119847267389#r147533483