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

Concurrent mode #217

Closed
danielkcz opened this issue Nov 8, 2019 · 5 comments
Closed

Concurrent mode #217

danielkcz opened this issue Nov 8, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@danielkcz
Copy link
Contributor

I already open the issue for @testing-library/react (testing-library/react-testing-library#509) and it might good idea to have a separate issue for tracking changes in this library as well.

Given this library utilizes react-test-renderer instead of react-dom it might require slightly different implementation. However, it seems there are no commits to that package regarding concurrent mode.

@gaearon if you notice this issue by any chance, can you clarify if this something that wasn't simply covered yet and if there is a plan for it?

@danielkcz danielkcz added the enhancement New feature or request label Nov 8, 2019
@mpeyper
Copy link
Member

mpeyper commented Nov 8, 2019

Thanks @FredyC!

Concurrent mode is still something I have to wrap my head around and what it means for this package.

I'm really curious to know if react-test-renderer is going to continue being supported going forward. It seems to have been forgotten or given minimal love in recent times. An issue I raised with it has gone unanswered for months (in their defence, it's not a deal breaker for us so I haven't pushed it harder myself either).

@denniscual
Copy link

I tried to use the unstable API from React called unstable_useMutableSource to my state management library and my tests now are failing due to the fact the library doesn't have support for CM.

Snapshot error:
image

I can say supporting CM for now is kinda early but its good that this library in the future could provide support on CM mode so that library author can also rely to this library. Can I say at least experimental version? I guess.

@mpeyper
Copy link
Member

mpeyper commented Sep 6, 2020

Hi @denniscual,

This library uses react-test-renderer under the hood for rendering the test component that calls your hook. If unstable_useMutableSource is not working, it's because the renderer does not support it (we don't do anything special to make any specific hooks work).

As far as I'm aware, unstable_useMutableSource should work with or without concurrent mode too, so I'm not sure what we can do to help with this one.

@denniscual
Copy link

@mpeyper hey thanks for the information. Im not aware of the implementation details of this library. That's being said, I assume upgrading to a version of react-test-renderer which support the unstable_useMutableSource could suffice for this problem. Of course, I reached out to you guys because the library which I'm working on doesn't work because I used the said api and if you can see the above image, there is a TypeError which leads to this library.

Thanks btw.

@joshuaellis
Copy link
Member

I'm not sure we should be aiming to support unstable APIs & should wait until concurrent mode is more solidified with React. However, looking at this comment in RTL, you might be able to use concurrent mode with react-dom, which we'll be supporting as a renderer soon, you can see it's progress here – #510

If anyone feels like there's more to discuss then we can re-open this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants