Skip to content
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

Merged
merged 2 commits into from
Dec 1, 2017

Conversation

aweary
Copy link
Collaborator

@aweary aweary commented Nov 29, 2017

react-reconciler now exposes ReactFiberTreeReflection via react-reconciler/reflection. That means we can import findCurrentFiberUsingSlowPath from the official reconciler package and remove our copy-pasted version 🎉

@aweary aweary force-pushed the use-react-reconciler-react-16 branch from 22c5221 to a666fc6 Compare November 29, 2017 07:40
@aweary aweary requested a review from ljharb November 29, 2017 17:42
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

@ljharb ljharb force-pushed the use-react-reconciler-react-16 branch from a666fc6 to 441a1af Compare December 1, 2017 07:04
@ljharb ljharb merged commit d60360c into enzymejs:master Dec 1, 2017
ljharb added a commit to ljharb/enzyme that referenced this pull request Dec 18, 2017
 - [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)
foaly-nr1 pushed a commit to foaly-nr1/enzyme that referenced this pull request Jan 6, 2018
 - [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)
@gaearon
Copy link
Contributor

gaearon commented Feb 5, 2018

Hmm. I'm not sure this is right. react-reconciler is not meant to be in sync with react-dom. They have a separate release cycle. There is no guarantee that any arbitrary version of react-reconciler will work with any arbitrary version of react-dom. The fact that they share the same method (and the one from react-reconciler "works" on inputs from react-dom) is an accident, not an intentional feature.

react-reconciler/reflection was only intended for us by consumers of react-reconciler itself (i.e. people creating custom renderers). Those don't need to be in sync with react-dom.

@aweary
Copy link
Collaborator Author

aweary commented Feb 5, 2018

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 react-dom testing utilities are insufficient, so it would be great if we could finally address that.

@gaearon
Copy link
Contributor

gaearon commented Feb 5, 2018

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.

jquense pushed a commit to jquense/enzyme that referenced this pull request Feb 23, 2018
 - [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)
@gaearon
Copy link
Contributor

gaearon commented Aug 20, 2018

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.

aweary pushed a commit to aweary/enzyme that referenced this pull request Aug 20, 2018
…iler-react-16"

This reverts commit d60360c, reversing
changes made to bbf39e0.
gaearon added a commit to gaearon/enzyme that referenced this pull request Aug 24, 2018
…iler-react-16"

This reverts commit d60360c, reversing
changes made to bbf39e0.
ljharb pushed a commit to aweary/enzyme that referenced this pull request Aug 24, 2018
…iler-react-16"

This reverts commit d60360c, reversing
changes made to bbf39e0.
ljharb pushed a commit to aweary/enzyme that referenced this pull request Aug 24, 2018
…iler-react-16"

This reverts commit d60360c, reversing
changes made to bbf39e0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants