-
Notifications
You must be signed in to change notification settings - Fork 47k
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 getNextDebugID()
to React package.
#9005
Conversation
Thanks! I added this to list of changes we want to push out in 15.5. |
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.
Don't like. Another stateful module in isomorphic wish we tried hard to get away from (e.g. current owner). :(
It should die with the tree hook, I think? |
5cb42d9
to
e6f79f1
Compare
The module, and its internal state, was duplicated in several packages, leading to duplicate ids when multiple renderers were used.
e6f79f1
to
21826e2
Compare
The code is now up to date. |
@@ -0,0 +1,9 @@ | |||
/** |
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 is this file? Looks like a build product that shouldn't be checked in.
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.
See #9078.
It does look that way. But shared modules are now accessed under their package name, so require('react/lib/getNextDebugID')
instead of require('getNextDebugID')
. Why this was done with an extra module, what @sebmarkbage referred to as forwarding modules I believe, and not an alias...I have no idea.
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.
Yea. This is correct. When we switch to lerna or yarn workspaces, this will be generated by tooling but since we don't have the tooling in place yet, I just checked in forwarding modules.
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.
Forwarding modules is so much better than config aliases because it covers all tooling at once. E.g. webpack aliases are the worst because you have to replicate it in node, jest, flow, and anything else that need the module graph.
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.
Aah. Thanks for explaining.
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.
(That's the same reason we don't allow absolute imports via Webpack config in CRA 😄 )
I cherry-picked this onto our release branch. It will go out in 15.5. Thanks! |
See #8487
When multiple renderers are used in development, react issues a warning from
ReactComponentTreeHook
.Why?
Items are stored in
ReactComponentTreeHook
'sitemMap
for debug info during development. The keys for these entries are generated by the following code.The problem is both
ReactDOM
andReactDOMServer
have a copy of this, and so will generate the same series of numbers, overwriting the debug entries generated by the other.Now it lives only in
React
.