-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
[CS] Split Host Config Out into a Mutable or Immutable Mode #11213
Conversation
Because we didn't have enough RN experiments. I want to add one more.
This makes it easier to do feature detection on the configuration.
This is the same as committing deletions but instead of finding host components to delete, it only invokes componentWillUnmount and detaching of refs.
This mode will use a clone based API instead of mutating host instances. Needs implementation still. It's awkward that there can be more than one child inserted into the root. So we need a new API to create a "root" instance so that we can update it atomically. Alternatively we could keep the mutable API for containers and assume that most use cases would only have a single root.
continue; | ||
} | ||
var value = props[key]; | ||
if (typeof value === 'function') { |
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.
I don't get this block?
}, | ||
}); | ||
|
||
const roots = new Map(); |
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.
What's this for? Copypasta?
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.
LGTM, once CI passes. Can we try to get this merged soon? I'll need to rebase my deterministic updates PR (#10715) on it, and the prerendering PR.
The immutable mode assumes that the output of React is a persistent tree, not mutations on a mutable DOM tree. Useful for targeting frameworks that accept immutable data structures as input.
Also adding another experimental RN renderer (CS) to try this out.