facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
224.32k stars 45.71k forks source link

Add packageManager fields for Corepack compat #29114

Closed merrywhether closed 1 month ago

merrywhether commented 1 month ago

Summary

For users with Yarn defaulted to >1 / Berry, setting up the repo will result in the creation of the .yarn/ directory, yarn.lock updates, and package.json edits. This change enables corepack users to automatically detect and use Yarn Classic with no effect on anyone else.

I targeted the latest version of Yarn Classic as a guess, since there were no engines entries to key off of. Happy to change this as desired.

How did you test this change?

Before this, running yarn in a fresh clone in either the root or compiler workspaces resulted in Yarn Berry making the above changes to the repo: 2000+ .yarn/cache entries, lockfile regeneration, and package.json formatting changes.

After this, yarn is handled by Yarn Classic as expected and no changes occur (and repo functions as expected).

react-sizebot commented 1 month ago

Comparing: 597ad74e38b8a45c0278289f4293b9ab4433c28b...85c57fb7b288657bc5547a6869a4bf14e47bb90e

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](https://react-builds.vercel.app/commits/85c57fb7b288657bc5547a6869a4bf14e47bb90e/files/__test_utils__/ReactAllWarnings.js?compare=597ad74e38b8a45c0278289f4293b9ab4433c28b) | **Deleted** | 64.26 kB | 0.00 kB | Deleted | 16.02 kB | 0.00 kB

Generated by :no_entry_sign: dangerJS against 85c57fb7b288657bc5547a6869a4bf14e47bb90e

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 4:12am