Move getNextDebugID() to React package.#9005
Conversation
|
Thanks! I added this to list of changes we want to push out in 15.5. |
|
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.
What is this file? Looks like a build product that shouldn't be checked in.
There was a problem hiding this comment.
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.
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.
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.
Aah. Thanks for explaining.
There was a problem hiding this comment.
(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'sitemMapfor debug info during development. The keys for these entries are generated by the following code.The problem is both
ReactDOMandReactDOMServerhave 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.