-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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 you try to use act()
in prod
#16282
Conversation
No significant bundle size changes to report. Generated by 🚫 dangerJS |
4d4066a
to
c214754
Compare
Tests? |
doh! 😅 fixing asap |
We have behaviour divergence for act() between prod and dev (specifically, act() + concurrent mode does not flush fallbacks in prod. This doesn't affect anyone in OSS yet) We also don't have a good story for writing tests in prod (and what from what I gather, nobody really writes tests in prod mode). We could have wiped out act() in prod builds, except that _we_ ourselves use act() for our tests when we run them in prod mode. This PR is a compromise to all of this. We will log a warning if you try to use act() in prod mode, and we silence it in our test suites.
Added a test. |
c214754
to
439797f
Compare
Merging so I can sync it to www |
Hey @threepointone! We currently run our tests in prod mode in the CI and I noticed this warning while upgrading to 16.9.0. Will this be removed in a future version without deprecations? Any suggestions other than running tests against the DEV build? It would be a major infra change for us at this point. Thanks! |
We have behaviour divergence for act() between prod and dev (specifically, act() + concurrent mode does not flush fallbacks in prod. This doesn't affect anyone in OSS yet) We also don't have a good story for writing tests in prod (and what from what I gather, nobody really writes tests in prod mode). We could have wiped out act() in prod builds, except that _we_ ourselves use act() for our tests when we run them in prod mode. This PR is a compromise to all of this. We will log a warning if you try to use act() in prod mode, and we silence it in our test suites.
We have behaviour divergence for act() between prod and dev (specifically, act() + concurrent mode does not flush fallbacks in prod. This doesn't affect anyone in OSS yet.)
We also don't have a good story for writing tests in prod (and what from what I gather, nobody really writes tests in prod mode).
We could have wiped out act() in prod builds, except that we ourselves use act() for our tests when we run them in prod mode.
This PR is a compromise to all of this. We will log a warning if you try to use act() in prod mode, and we silence it in our test suites. (Any discrepancies in behaviour will still be caught by assertions).
We will revisit this in a future version.