-
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
Use incrementing numerical IDs to identify DOM components #5205
Conversation
629c736
to
d0e7fec
Compare
@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.
d0e7fec
to
a906911
Compare
@spicyj updated the pull request. |
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
a906911
to
c193d1a
Compare
@spicyj updated the pull request. |
Use incrementing numerical IDs to identify DOM components
Is there any way that this could cause problems when using an older version of React on the same page? |
Good question. I think this should probably be fine alongside 0.14 but didn't test. |
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. |
Builds on #5190. So... ignore the first 10 commits.