[Fiber] Maps as keyed collections of children#8911
Closed
acdlite wants to merge 6 commits intofacebook:masterfrom
Closed
[Fiber] Maps as keyed collections of children#8911acdlite wants to merge 6 commits intofacebook:masterfrom
acdlite wants to merge 6 commits intofacebook:masterfrom
Conversation
Instead of reading the key from the element/portal/coroutine, accept the key as a parameter so that the caller override the key if needed. E.g. for maps as children.
Typically these aren't keyed because there's no key on the child object. But they are keyed if you use a Map.
Stack uses comment nodes to key text nodes, but Fiber doesn't. The test now works regardless.
Maps have special semantics where the values are fragment children and the keys are React keys.
Maps are still experimental. Warn the first time a map is used.
569eacf to
dc5ff20
Compare
Contributor
|
I think we should either decide to activate this feature or explicitly disable it in both Stack and Fiber. Last time I was concerned that this pattern is confusing since it is overloaded with the keyed element pattern. It is also an inefficient pattern since it optimizes the set for quick key lookups which we normally don't need. |
Collaborator
Author
|
Closing since we decided not to support this feature anymore. Will open a PR to remove it from Stack. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I think I got the semantics right. The existing test coverage is scant, I guess because it's an experimental feature. (Should I add additional tests before landing?)