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
Use Yarn 2 #11962
Use Yarn 2 #11962
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/27838/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ac13666:
|
The latest Yarn from sources has some nice performance improvements compared to 2.1.1, might be worth updating to that yarnpkg/berry@2020-07-09a...master
|
@merceyz Thanks to let us know! I prefer the tagged version as current performance is already greatly improved over |
@@ -30,11 +30,8 @@ | |||
"@rollup/plugin-json": "4.0.1", | |||
"babel-jest": "^24.9.0", | |||
"babel-plugin-transform-charcodes": "^0.2.0", | |||
"browserify": "^16.2.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are moved to @babel/polyfill
because it is only used when building dist
of @babel/polyfill
.
@@ -1,17 +1,14 @@ | |||
#!/bin/sh | |||
set -ex | |||
|
|||
BROWSERIFY_CMD="../../node_modules/browserify/bin/cmd.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not have any assumption on node_modules structures and invoke via yarn
instead.
@@ -21,5 +21,11 @@ | |||
"dependencies": { | |||
"core-js": "^2.6.5", | |||
"regenerator-runtime": "^0.13.4" | |||
}, | |||
"devDependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are pinned as the version that previously locked in yarn.lock
. We can update them in subsequent PRs but given that @babel/polyfill
is deprecated, this is of very low priority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
browserify
has been updated to 16.5.2
which bumps browser-resolve
to 2.0.0 that supports Yarn PnP: https://github.com/browserify/browser-resolve/blob/master/CHANGELOG.md#browser-resolve-change-log
28a5dce
to
3de755e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version of @yarnpkg/plugin-constraints
isn't the latest tagged release (2.1.0), unsure which version it is but it should be updated
@merceyz Good catch! It seems that this plugin is not used at all. I removed it. |
For context, it used to be used here: https://github.com/babel/babel/pull/11214/files#diff-8ca351b0cde465d2c1b11fe6dd12b1a5R25-R35 |
Thanks for the comment. Yes it was used to bump the babel dependencies of a given repository. Later we come up with a custom script for this purpose. So currently the plugin is not used. |
@@ -1,4 +1,4 @@ | |||
process.env.BABEL_DISABLE_CACHE = "true"; | |||
require("@babel/register").default({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test did not test packages/babel-register
but instead it is tested against some random @babel/register
in node_modules
.
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
Co-Authored-By: merceyz <merceyz@users.noreply.github.com>
Testcases in packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie depends on specific caniuse-lite versions. We pinned the version here so we don't have to deal with fixture different in e2e-tests where all deps will be updated and tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving again since there have been many changes
To make it easier to review this PR, I suggest using this link: https://github.com/babel/babel/pull/11962/files/dc3b917a52614e5107c1b7a8ca16b23b3eaa8fc9..ac1366665d34621bcf669be29c789647149cf265?file-filters%5B%5D=.cjs&file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.lock&file-filters%5B%5D=.sh&file-filters%5B%5D=.yml&hide-deleted-files=true It hides the commits that have already been reviewed in the |
- path: .yarn/plugins/@yarnpkg/plugin-constraints.js | ||
spec: "@yarnpkg/plugin-constraints" | ||
- path: .yarn/plugins/@yarnpkg/plugin-deduplicate.cjs | ||
spec: "https://raw.githubusercontent.com/eps1lon/yarn-plugin-deduplicate/latest/bin/%40yarnpkg/plugin-deduplicate.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future we will remove this plugin and use built-in yarn dedupe
(PR) which is expected to ship in Yarn 2.2.0.
@@ -19,6 +19,6 @@ | |||
}, | |||
"peerDependencies": { | |||
"@babel/eslint-parser": "^7.10.4", | |||
"eslint-plugin-flowtype": "^3.0.0" | |||
"eslint-plugin-flowtype": "^4.6.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint-plugin-flowtypw@4.6.0
is installed in root package.json so we provided 4.6.0
for ^3.0.0
, since @babel/eslint-config-internal
is private, we bump the peerDependencies to what we used in root package.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't wait for no more patching :)
This PR backports yarn 2 related PRs (#11167, #11779, #11782 and #11822) to
main
.yarn-plugin-deduplicate
(yarn deduplicate
)