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

fix(react-compiler-healthcheck): detect strict mode when using <React.StrictMode/> #29077

Conversation

psychedelicious
Copy link

Summary

Update the regex to match both <StrictMode> and <React.StrictMode>.

Closes #29075

How did you test this change?

Building and running the check locally against the repo in the issue:

❯ node /home/bat/Documents/Code/react/compiler/packages/react-compiler-healthcheck/dist/index.js 
Successfully compiled 1 out of 1 components.
StrictMode usage found. # <-- successful strictmode detection
Found no usage of incompatible libraries.

…t.StrictMode/>`

Update the regex to match both `<StrictMode>` and `<React.StrictMode>`.

Closes facebook#29075
@react-sizebot
Copy link

Comparing: 71565a9...25a2b8d

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.js = 6.66 kB 6.66 kB = 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 495.01 kB 495.01 kB = 88.68 kB 88.68 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 499.81 kB 499.81 kB = 89.36 kB 89.36 kB
facebook-www/ReactDOM-prod.classic.js = 592.16 kB 592.16 kB = 104.15 kB 104.15 kB
facebook-www/ReactDOM-prod.modern.js = 568.39 kB 568.39 kB = 100.55 kB 100.55 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Generated by 🚫 dangerJS against 25a2b8d

@gsathya
Copy link
Member

gsathya commented May 15, 2024

Thanks! Fixed in #29076

@gsathya gsathya closed this May 15, 2024
@psychedelicious
Copy link
Author

Ah, you beat me to it! Thanks for fixing that @gsathya

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.

Bug: react-compiler-healthcheck doesn't recognize when strict mode is enabled with <React.StrictMode />
4 participants