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

warn if passive effects get queued outside of an act() call. #15763

Merged
merged 6 commits into from Jun 24, 2019

Commits on Jun 23, 2019

  1. warn if passive effects get queued outside of an act() call

    While the code itself isn't much (it adds the warning to mountEffect() and updateEffect() in ReactFiberHooks), it does change a lot of our tests. We follow a bad-ish pattern here, which is doing asserts inside act() scopes, but it makes sense for *us* because we're testing intermediate states, and we're manually flush/yield what we need in these tests.
    
    This commit has one last failing test. Working on it.
    threepointone committed Jun 23, 2019
    Copy the full SHA
    043aef4 View commit details
    Browse the repository at this point in the history
  2. pass lint

    threepointone committed Jun 23, 2019
    Copy the full SHA
    bad37b8 View commit details
    Browse the repository at this point in the history
  3. pass failing test, fixes another

    - a test was failing in ReactDOMServerIntegrationHooks while testing an effect; the behaviour of yields was different from browser and server when wrapped with act(). further, because of how we initialized modules, act() around renders wasn't working corrrectly. solved by passing in ReactTestUtils in initModules, and checking on the finally yielded values in the specific test.
    - in ReactUpdates, while testing an infinite recursion detection, the test needed to be wrapped in an act(), which would have caused the recusrsion error to throw. solived by rethrowing the error from inside the act().
    threepointone committed Jun 23, 2019
    Copy the full SHA
    46c0741 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    17a9cad View commit details
    Browse the repository at this point in the history
  5. stray todo

    threepointone committed Jun 23, 2019
    Copy the full SHA
    c777608 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2019

  1. Copy the full SHA
    8bcfcc3 View commit details
    Browse the repository at this point in the history