-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Import findCurrentFiberUsingSlowPath from react-reconciler/reflection #1399
Conversation
22c5221
to
a666fc6
Compare
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.
awesome!
a666fc6
to
441a1af
Compare
- [Deps] update `prop-types`, `enzyme-adapter-utils` - [Dev Deps] update `eslint`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react` - [Refactor] Import findCurrentFiberUsingSlowPath from react-reconciler/reflection (enzymejs#1399)
- [Deps] update `prop-types`, `enzyme-adapter-utils` - [Dev Deps] update `eslint`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react` - [Refactor] Import findCurrentFiberUsingSlowPath from react-reconciler/reflection (enzymejs#1399)
Hmm. I'm not sure this is right.
|
Thanks for clarifying @gaearon, I can revert. The fact that so much code needs to be duplicated in the adapter is a strong indicator that the |
I agree, open to suggestions how to fix those :-) There was a proposal from Enzyme side for us to expose toTree in the test renderer. But even that didn’t end up being used. We’re totally open to Enzyme taking more ownership over this (and potentially exposing toTree on ReactDOM in some special testing mode), but we should probably start “blessed” integration from the test renderer. |
- [Deps] update `prop-types`, `enzyme-adapter-utils` - [Dev Deps] update `eslint`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react` - [Refactor] Import findCurrentFiberUsingSlowPath from react-reconciler/reflection (enzymejs#1399)
We're beginning to bump into problems caused by this at Facebook. Specifically, we've changed some internal constants, but we have to remember to fork both the Enzyme adapter and this deep dependency that we don't normally check in. It would be great to undo this abstraction as soon as possible. |
react-reconciler
now exposesReactFiberTreeReflection
viareact-reconciler/reflection
. That means we can importfindCurrentFiberUsingSlowPath
from the official reconciler package and remove our copy-pasted version 🎉