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

Move more stuff out of ReactComponent #2546

Merged
merged 4 commits into from
Nov 17, 2014

Conversation

sebmarkbage
Copy link
Collaborator

Here's a bunch of stuff that doesn't belong in ReactComponent anymore. See individual commits.

I also added a preventExtensions for internals in __DEV__. This ensures that we don't add state that we don't know about and ensures that the components keep a stable type signature.

This is part of moving more logic out of the base classes.

setProps, replaceProps etc. are not accessible from anything other than
ReactClass so we can safely move it to ReactCompositeComponent.

mountComponentIntoNode is tightly coupled to ReactMount. It's part of the
outer abstraction, the mount point, not the individual component.
Since setProps can no longer be called on anything but composites, we can
move this complexity into ReactCompositeComponent.
Use preventExtensions so that we can't add expando properties to internal
instances. This ensures that the hidden class is kept more consistent.
@sophiebits
Copy link
Collaborator

Nice.

(nit: fold the unused-variables commit into the first commit, which removed the references?)

@sebmarkbage
Copy link
Collaborator Author

I didn't know which and if it was several commits I removed them in. I wish I had better lint as I go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants