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

Shares debugID information across modules #8097

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

goatslacker
Copy link
Contributor

Prior to this, React was using a nextDebugID variable that was locally
scoped to both instantiateReactComponent and ReactShallowRenderer.
This caused problems when the debugIDs would collide, the itemMap in
ReactComponentTreeHook would be overwritten and tests would fail
with the message "Expected onBeforeMountComponent() parent and
onSetChildren() to be consistent".

This change shares the debugID with both modules thus preventing any
collisions in the future.

Fixes #7927

Ideally this would be in the next (hotfix?) release of React 15.x as this is preventing us (Airbnb) from upgrading at the moment.

@facebook-github-bot
Copy link

Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours has expired.

Before we can review or merge your code, we need you to email cla@fb.com with your details so we can update your status.

@aweary
Copy link
Contributor

aweary commented Oct 25, 2016

Thanks for the PR @goatslacker, looks reasonable to me. 15.4.0 is close to release, I'm not sure if it's too late to get this in though.

@goatslacker
Copy link
Contributor Author

Emailed the CLA info.

aweary
aweary previously requested changes Oct 26, 2016
@@ -0,0 +1,9 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to add the header document comment here like the other files (example).

Without the @providesModule comment the haste module system doesn't know where to find this file and tests fail.

Copy link
Contributor Author

@goatslacker goatslacker Oct 26, 2016

Choose a reason for hiding this comment

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

Done.

Prior to this, React was using a nextDebugID variable that was locally
scoped to both `instantiateReactComponent` and `ReactShallowRenderer`.
This caused problems when the debugIDs would collide, the `itemMap` in
`ReactComponentTreeHook` would be overwritten and tests would fail
with the message "Expected onBeforeMountComponent() parent and
onSetChildren() to be consistent".

This change shares the debugID with both modules thus preventing any
collisions in the future.
@gaearon
Copy link
Collaborator

gaearon commented Oct 27, 2016

Thanks.

@goatslacker goatslacker deleted the fix-7927 branch October 27, 2016 21:26
zpao pushed a commit that referenced this pull request Nov 16, 2016
Prior to this, React was using a nextDebugID variable that was locally
scoped to both `instantiateReactComponent` and `ReactShallowRenderer`.
This caused problems when the debugIDs would collide, the `itemMap` in
`ReactComponentTreeHook` would be overwritten and tests would fail
with the message "Expected onBeforeMountComponent() parent and
onSetChildren() to be consistent".

This change shares the debugID with both modules thus preventing any
collisions in the future.
(cherry picked from commit 6eebed0)
@gaearon
Copy link
Collaborator

gaearon commented Nov 16, 2016

Out in 15.4.0.

jstejada added a commit to nylas/nylas-mail that referenced this pull request Feb 10, 2017
Now that we have 15.4.2, we don't have to worry about:
facebook/react#8097
acusti pushed a commit to brandcast/react that referenced this pull request Mar 15, 2017
Prior to this, React was using a nextDebugID variable that was locally
scoped to both `instantiateReactComponent` and `ReactShallowRenderer`.
This caused problems when the debugIDs would collide, the `itemMap` in
`ReactComponentTreeHook` would be overwritten and tests would fail
with the message "Expected onBeforeMountComponent() parent and
onSetChildren() to be consistent".

This change shares the debugID with both modules thus preventing any
collisions in the future.
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.

Changing state too quickly cause error with shallow render
4 participants