-
Notifications
You must be signed in to change notification settings - Fork 48.8k
expose devtools hook with react-reconciler package #11445
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
Conversation
[react] yarn build react-reconciler yarn run v1.2.1 $ npm run version-check && node scripts/rollup/build.js react-reconciler > @16.1.0-beta version-check /Users/iamdustan/projects/react/react > node ./scripts/tasks/version-check.js BUILDING react-reconciler.development.js (node_dev) COMPLETE react-reconciler.development.js (node_dev) BUILDING react-reconciler.production.min.js (node_prod) COMPLETE react-reconciler.production.min.js (node_prod) BUILDING react-reconciler-devtools.development.js (node_dev) COMPLETE react-reconciler-devtools.development.js (node_dev) BUILDING react-reconciler-devtools.production.min.js (node_prod) COMPLETE react-reconciler-devtools.production.min.js (node_prod) ┌─────────────────────────────────────────────────────────┬───────────┬──────────────┬─────────────┬───────────┬──────────────┬─────────────┐ │ Bundle │ Prev Size │ Current Size │ Diff │ Prev Gzip │ Current Gzip │ Diff │ ├─────────────────────────────────────────────────────────┼───────────┼──────────────┼─────────────┼───────────┼──────────────┼─────────────┤ │ react-reconciler.development.js (NODE_DEV) │ 258.73 KB │ 258.73 KB │ 0 % │ 53.2 KB │ 53.2 KB │ 0 % │ ├─────────────────────────────────────────────────────────┼───────────┼──────────────┼─────────────┼───────────┼──────────────┼─────────────┤ │ react-reconciler.production.min.js (NODE_PROD) │ 39.63 KB │ 39.63 KB │ 0 % │ 12.32 KB │ 12.32 KB │ 0 % │ ├─────────────────────────────────────────────────────────┼───────────┼──────────────┼─────────────┼───────────┼──────────────┼─────────────┤ │ react-reconciler-devtools.development.js (NODE_DEV) │ 0 B │ 2.83 KB │ +Infinity % │ 0 B │ 1.05 KB │ +Infinity % │ ├─────────────────────────────────────────────────────────┼───────────┼──────────────┼─────────────┼───────────┼──────────────┼─────────────┤ │ react-reconciler-devtools.production.min.js (NODE_PROD) │ 0 B │ 831 B │ +Infinity % │ 0 B │ 485 B │ +Infinity % │ └─────────────────────────────────────────────────────────┴───────────┴──────────────┴─────────────┴───────────┴──────────────┴─────────────┘
Can you also fix all files importing it directly to use this form please? |
Would that be a diff that basically looks like this? import * as ReactPortal from 'react-reconciler/src/ReactPortal';
-import {injectInternals} from 'react-reconciler/src/ReactFiberDevToolsHook';
+import injectInternals from 'react-reconciler/devtools';
import ReactGenericBatching from 'events/ReactGenericBatching'; (not super familiar with the lerna/yarn workspaces expectations) Should I keep it as importing the named |
I think we need them all to be exported. Because scheduler needs to be able to call |
It makes sense to keep |
Hmm. Seems like we have the same problem as with the renderers here. We can't use a singleton, can we? Since then two renderers would conflict. |
I'm also not convinced this does the right thing for third party renderers. Have you tested it? This would set functions like |
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.
This approach wouldn't work as is (see above)
was working on updating a renderer to the official API and realized I had lost access to this. I think should be relatively noncontroversial and safe. The
ReactDevtoolsHook
file has only one real import fromfbjs/lib/warning
and hten the type imports fromReactFiber
andReactFiberRoot
.cc @gaearon @bvaughn