Skip to content

[Fiber] ReactCompositeComponent-test.js - #8950

Merged
acdlite merged 6 commits into
react:masterfrom
acdlite:fibercompositecomponenttests
Feb 24, 2017
Merged

acdlite merged 6 commits into
react:masterfrom
acdlite:fibercompositecomponenttests

Conversation

@acdlite

@acdlite acdlite commented Feb 7, 2017

Copy link
Copy Markdown
Collaborator

Fixes tests in ReactCompositeComponent-test.js

Overlaps with #8949 so I based it on that. Review that one first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This was always a bad pattern before because it assumed something about the "owner" pattern being a complete way to track this. It is also unnecessarily a deep dependency into an isomorphic library that can't be deduped. I believe that it is also not completely safe because ReactCurrentOwner.current doesn't get immediately reset to null like it does in Stack.

It would be better to track a DEV only specific flag that is designed for exactly this use case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

onBeginProcessingChildContext/onEndProcessingChildContext is over/early abstracted. Just set the flag to true and false like we do with ReactCurrentOwner. Seems like you can unify this with the render warning flag though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This extra tag check here is an indication that you're over using the ReactCurrentOwner concept. Should be fixed if you just do a render specific dev only flag for this specific use case.

@acdlite
acdlite force-pushed the fibercompositecomponenttests branch 2 times, most recently from 76233b8 to 9558517 Compare February 22, 2017 22:13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How is this different than ReactDebugCurrentFiber?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Looks like it's a superset. I'll consolidate.

@sebmarkbage sebmarkbage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Waiting for consolidation.

@acdlite
acdlite dismissed sebmarkbage’s stale review February 23, 2017 21:34

Consolidated ReactDebugCurrentFiber and ReactDebugLifeCycle

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess this could be relevant to top level ReactDOM.render too?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess you have a separate one for that. Makes sense.

@sebmarkbage sebmarkbage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Alright. lgtm.

Stack uses a module called ReactInvalidSetStateWarningHook, but all it
does is warn about setState inside getChildContext. Doesn't seem worth
keeping around, so I didn't use it for Fiber, but if I'm mistaken I'll
change it.
@acdlite
acdlite force-pushed the fibercompositecomponenttests branch from 6cf3863 to b21c2a5 Compare February 24, 2017 19:15
@acdlite
acdlite force-pushed the fibercompositecomponenttests branch from b21c2a5 to 393cdbc Compare February 24, 2017 19:17
@acdlite
acdlite merged commit bc86ac4 into react:master Feb 24, 2017
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
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