Skip to content

[Fiber] Fix TestUtils.findAllInRenderedTree#8147

Merged
gaearon merged 2 commits intofacebook:masterfrom
gaearon:test-utils-fiber
Oct 29, 2016
Merged

[Fiber] Fix TestUtils.findAllInRenderedTree#8147
gaearon merged 2 commits intofacebook:masterfrom
gaearon:test-utils-fiber

Conversation

@gaearon
Copy link
Copy Markdown
Collaborator

@gaearon gaearon commented Oct 29, 2016

This fixes a couple of tests (but maybe more in product code).

@gaearon
Copy link
Copy Markdown
Collaborator Author

gaearon commented Oct 29, 2016

I'm not sure if we should use feature flag in such cases or not. It seems to me that we want "utilities" around React like TestUtils to work with both reconcilers so it's easier to use Fiber side by side.

var publicInst = fiber.stateNode;
var ret = publicInst && test(publicInst) ? [publicInst] : [];
var child = fiber.child;
while (child) {
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.

Can you add that comment about coroutines that input everywhere? Just so I can find it later. Coroutines have children on stateNode atm.

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.

I added it at first but then removed because wasn't sure :P. Do couroutines appear in a fully flushed tree? I still don't quite understand how they work.

@gaearon gaearon added this to the 15-next milestone Oct 29, 2016
@gaearon gaearon merged commit 928541d into facebook:master Oct 29, 2016
@gaearon gaearon deleted the test-utils-fiber branch October 29, 2016 21:02
@sebmarkbage
Copy link
Copy Markdown
Contributor

I figured that we'd probably get to feature parity pretty soonish and at that point we could drop the stack one. Presumably we'd cover enough cases there. Unit tests are easy to get a lot of coverage on so less likely to need two impl in parallel for as long.

acusti pushed a commit to brandcast/react that referenced this pull request Mar 15, 2017
* [Fiber] Fix TestUtils.findAllInRenderedTree

* Add a comment about coroutines
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