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

Throw when act is used in production #21686

Merged
merged 1 commit into from Jun 16, 2021
Merged

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Jun 15, 2021

Cleaning Up Our Act, part 1...

Upgrades the deprecation warning to a runtime error.

I did it this way instead of removing the export so the type is the same in both builds. It will get dead code eliminated regardless.

This does not affect the special, internal-only version of act that we use to test production behavior in our own test suite. Most of our suite was already migrated; I updated the remaining callers. (The name, unstable_concurrentAct, no longer makes much sense but I'll clean that up later.)

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jun 15, 2021
@sizebot
Copy link

sizebot commented Jun 15, 2021

Comparing: 7ec4c55...7b07d45

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 127.40 kB 127.40 kB = 40.83 kB 40.83 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 130.21 kB 130.21 kB = 41.74 kB 41.74 kB
facebook-www/ReactDOM-prod.classic.js = 405.89 kB 405.89 kB = 75.03 kB 75.03 kB
facebook-www/ReactDOM-prod.modern.js = 394.32 kB 394.32 kB = 73.24 kB 73.24 kB
facebook-www/ReactDOMForked-prod.classic.js = 405.89 kB 405.89 kB = 75.03 kB 75.03 kB
oss-experimental/react-dom/umd/react-dom-test-utils.production.min.js = 13.99 kB 13.16 kB = 5.42 kB 5.14 kB
oss-stable-semver/react-dom/umd/react-dom-test-utils.production.min.js = 13.99 kB 13.16 kB = 5.42 kB 5.14 kB
oss-stable/react-dom/umd/react-dom-test-utils.production.min.js = 13.99 kB 13.16 kB = 5.42 kB 5.14 kB
oss-experimental/react-dom/cjs/react-dom-test-utils.production.min.js = 13.99 kB 13.09 kB = 5.38 kB 5.09 kB
oss-stable-semver/react-dom/cjs/react-dom-test-utils.production.min.js = 13.99 kB 13.09 kB = 5.38 kB 5.09 kB
oss-stable/react-dom/cjs/react-dom-test-utils.production.min.js = 13.99 kB 13.09 kB = 5.38 kB 5.09 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-www/ReactDOMTesting-prod.classic.js = 399.82 kB 396.97 kB = 75.63 kB 74.87 kB
facebook-www/ReactDOMTesting-prod.modern.js = 386.56 kB 383.71 kB = 73.48 kB 72.70 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-profiling.js = 252.48 kB 250.38 kB = 46.04 kB 45.61 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-prod.js = 237.78 kB 235.68 kB = 43.81 kB 43.37 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js = 81.83 kB 81.08 kB = 25.83 kB 25.53 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js = 81.68 kB 80.93 kB = 25.44 kB 25.17 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js = 79.45 kB 78.71 kB = 24.99 kB 24.73 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js = 79.45 kB 78.71 kB = 24.99 kB 24.73 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js = 79.30 kB 78.55 kB = 24.67 kB 24.40 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js = 79.30 kB 78.55 kB = 24.67 kB 24.40 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js = 100.48 kB 99.42 kB = 31.03 kB 30.51 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.min.js = 96.22 kB 95.16 kB = 29.63 kB 29.13 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js = 96.22 kB 95.16 kB = 29.63 kB 29.13 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js = 93.06 kB 92.00 kB = 28.79 kB 28.29 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js = 90.61 kB 89.55 kB = 27.99 kB 27.49 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js = 90.61 kB 89.55 kB = 27.99 kB 27.49 kB
oss-experimental/react-dom/umd/react-dom-test-utils.production.min.js = 13.99 kB 13.16 kB = 5.42 kB 5.14 kB
oss-stable-semver/react-dom/umd/react-dom-test-utils.production.min.js = 13.99 kB 13.16 kB = 5.42 kB 5.14 kB
oss-stable/react-dom/umd/react-dom-test-utils.production.min.js = 13.99 kB 13.16 kB = 5.42 kB 5.14 kB
oss-experimental/react-dom/cjs/react-dom-test-utils.production.min.js = 13.99 kB 13.09 kB = 5.38 kB 5.09 kB
oss-stable-semver/react-dom/cjs/react-dom-test-utils.production.min.js = 13.99 kB 13.09 kB = 5.38 kB 5.09 kB
oss-stable/react-dom/cjs/react-dom-test-utils.production.min.js = 13.99 kB 13.09 kB = 5.38 kB 5.09 kB

Generated by 🚫 dangerJS against 7b07d45

Upgrades the deprecation warning to a runtime error.

I did it this way instead of removing the export so the type is the same
in both builds. It will get dead code eliminated regardless.
Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

LGTM

@acdlite acdlite merged commit bd0a963 into facebook:master Jun 16, 2021
@gaearon gaearon mentioned this pull request Jun 17, 2021
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Jun 22, 2021
Summary:
This sync includes the following changes:
- **[43f4cc160](facebook/react@43f4cc160 )**: Fix failing test ([#21697](facebook/react#21697)) //<Dan Abramov>//
- **[d0f348dc1](facebook/react@d0f348dc1 )**: Fix for failed Suspense layout semantics ([#21694](facebook/react#21694)) //<Brian Vaughn>//
- **[bd0a96344](facebook/react@bd0a96344 )**: Throw when `act` is used in production ([#21686](facebook/react#21686)) //<Andrew Clark>//
- **[9343f8720](facebook/react@9343f8720 )**: Use the server src files as entry points for the builds/tests ([#21683](facebook/react#21683)) //<Sebastian Markbåge>//
- **[502f8a2a0](facebook/react@502f8a2a0 )**: [Fizz/Flight] Don't use default args ([#21681](facebook/react#21681)) //<Sebastian Markbåge>//
- **[a8f5e77b9](facebook/react@a8f5e77b9 )**: Remove invokeGuardedCallback from commit phase ([#21666](facebook/react#21666)) //<Dan Abramov>//
- **[dbe3363cc](facebook/react@dbe3363cc )**: [Fizz] Implement Legacy renderToString and renderToNodeStream on top of Fizz ([#21276](facebook/react#21276)) //<Sebastian Markbåge>//
- **[101ea9f55](facebook/react@101ea9f55 )**: Set deletedTreeCleanUpLevel to 3 ([#21679](facebook/react#21679)) //<Dan Abramov>//
- **[1a106bdc2](facebook/react@1a106bdc2 )**: Wrap eventhandle-specific logic in a flag ([#21657](facebook/react#21657)) //<Dan Abramov>//
- **[cb30388d1](facebook/react@cb30388d1 )**: Export React Native `AttributeType` Types ([#21661](facebook/react#21661)) //<Timothy Yung>//
- **[c1536795c](facebook/react@c1536795c )**: Revert "Make enableSuspenseLayoutEffectSemantics static for www ([#21617](facebook/react#21617))" ([#21656](facebook/react#21656)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions c96b78e...568dc35

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D29303157

fbshipit-source-id: 90952885eb2264f4effa04070357b80700bb9be3
@gaearon gaearon mentioned this pull request Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants