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

Use incrementing numerical IDs to identify DOM components #5205

Merged
merged 18 commits into from Nov 4, 2015

Conversation

sophiebits
Copy link
Collaborator

Builds on #5190. So... ignore the first 10 commits.

@facebook-github-bot
Copy link

@spicyj updated the pull request.

Initial render can still be a markup string.
New module! With this, we have a new module that uses the component tree to store DOM nodes. Most of the logic in this file relates to markup adoption -- if we were to drop that (along with server rendering) this file could just be a `return inst._nativeNode;`.

This works with useCreateElement only because we need to reference each node as it's created.

Events is now the only thing using ReactMount.getNode -- I'll introduce pointers back from the DOM nodes (and a `ReactDOMComponentTree.getInstanceFromNode`) and make that work.
@facebook-github-bot
Copy link

@spicyj updated the pull request.

@sebmarkbage
Copy link
Collaborator

Good luck!

Next step: take advantage of having the native instances in EventPropagators instead of converting right back to IDs.
This removes SimpleEventPlugin's dependency on ReactMount.getID.
This test relied on the fact that ReactDOMComponent still produced hierarchical IDs -- although this module could be used standalone, we're replacing it completely so it makes more sense to just move the tests over to test ReactDOMTreeTraversal.
- Remove last references to ReactInstanceHandles (still used in responder unit test)
- Remove ClientReactRootIndex/ServerReactRootIndex
@facebook-github-bot
Copy link

@spicyj updated the pull request.

sophiebits added a commit that referenced this pull request Nov 4, 2015
Use incrementing numerical IDs to identify DOM components
@sophiebits sophiebits merged commit 35962a0 into facebook:master Nov 4, 2015
@afraser
Copy link

afraser commented Apr 8, 2016

Is there any way that this could cause problems when using an older version of React on the same page?

@sophiebits
Copy link
Collaborator Author

Good question. I think this should probably be fine alongside 0.14 but didn't test.

@afraser
Copy link

afraser commented Apr 8, 2016

I'm wondering about 0.13.3 in particular. If I don't get an answer here I'll let you all know what I find when I dive in.

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.

None yet

4 participants