Skip to content
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

Merged
merged 8 commits into from
Oct 13, 2017

Conversation

sebmarkbage
Copy link
Collaborator

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.

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') {
Copy link
Collaborator

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();
Copy link
Collaborator

@acdlite acdlite Oct 13, 2017

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?

Copy link
Collaborator

@acdlite acdlite left a 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.

@sebmarkbage sebmarkbage merged commit 36a2afc into facebook:master Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants