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

Use Yarn 2 #11962

Merged
merged 17 commits into from Aug 25, 2020
Merged

Use Yarn 2 #11962

merged 17 commits into from Aug 25, 2020

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Aug 14, 2020

Q                       A
License MIT

This PR backports yarn 2 related PRs (#11167, #11779, #11782 and #11822) to main.

  • Added yarn-plugin-deduplicate (yarn deduplicate)
  • Moved some devDependencies to leaf packages.

@babel-bot
Copy link
Collaborator

@babel-bot babel-bot commented Aug 14, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/27838/

@codesandbox
Copy link

@codesandbox codesandbox bot commented Aug 14, 2020

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:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration
@JLHwung JLHwung force-pushed the JLHwung:yarn-2 branch from d048ebd to b4d3053 Aug 14, 2020
package.json Outdated Show resolved Hide resolved
@JLHwung JLHwung force-pushed the JLHwung:yarn-2 branch from b4d3053 to 06f0abb Aug 14, 2020
@JLHwung JLHwung force-pushed the JLHwung:yarn-2 branch from 1ba145e to 3d1e4c3 Aug 15, 2020
@JLHwung JLHwung marked this pull request as ready for review Aug 15, 2020
.yarnrc.yml Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
@merceyz
Copy link
Contributor

@merceyz merceyz commented Aug 17, 2020

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

yarn set version from sources
@JLHwung
Copy link
Contributor Author

@JLHwung JLHwung commented Aug 18, 2020

@merceyz Thanks to let us know! I prefer the tagged version as current performance is already greatly improved over lerna bootstrap. We will update when 2.2.0 is published.

@@ -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",

This comment has been minimized.

@JLHwung

JLHwung Aug 19, 2020
Author Contributor

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"

This comment has been minimized.

@JLHwung

JLHwung Aug 19, 2020
Author Contributor

Do not have any assumption on node_modules structures and invoke via yarn instead.

@JLHwung JLHwung force-pushed the JLHwung:yarn-2 branch from 766548b to 23e7b86 Aug 19, 2020
@@ -21,5 +21,11 @@
"dependencies": {
"core-js": "^2.6.5",
"regenerator-runtime": "^0.13.4"
},
"devDependencies": {

This comment has been minimized.

@JLHwung

JLHwung Aug 19, 2020
Author Contributor

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.

This comment has been minimized.

@JLHwung

JLHwung Aug 25, 2020
Author Contributor

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

@JLHwung JLHwung force-pushed the JLHwung:yarn-2 branch 2 times, most recently from 28a5dce to 3de755e Aug 19, 2020
Copy link
Contributor

@merceyz merceyz left a comment

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

@JLHwung
Copy link
Contributor Author

@JLHwung JLHwung commented Aug 19, 2020

@merceyz Good catch! It seems that this plugin is not used at all. I removed it.

@arcanis
Copy link
Contributor

@arcanis arcanis commented Aug 19, 2020

@JLHwung
Copy link
Contributor Author

@JLHwung JLHwung commented Aug 19, 2020

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({

This comment has been minimized.

@JLHwung

JLHwung Aug 19, 2020
Author Contributor

This test did not test packages/babel-register but instead it is tested against some random @babel/register in node_modules.

JLHwung and others added 15 commits Aug 20, 2020
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.
@JLHwung JLHwung force-pushed the JLHwung:yarn-2 branch from 26befca to ba2edad Aug 20, 2020
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Approving again since there have been many changes

@JLHwung JLHwung force-pushed the JLHwung:yarn-2 branch from b16f235 to a424b00 Aug 25, 2020
@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Aug 25, 2020

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 next-8-dev branch. Also, you can skip reading the contents of the file in .yarn/plugins since those are just dependencies (but yarn plugins need to be committed because you might need to run them before yarn install).

- 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"

This comment has been minimized.

@JLHwung

JLHwung Aug 25, 2020
Author Contributor

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"

This comment has been minimized.

@JLHwung

JLHwung Aug 25, 2020
Author Contributor

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.

Copy link
Member

@existentialism existentialism left a comment

Can't wait for no more patching :)

@JLHwung
Copy link
Contributor Author

@JLHwung JLHwung commented Aug 25, 2020

:shipit:

@JLHwung JLHwung merged commit 3fad7ea into babel:main Aug 25, 2020
10 of 11 checks passed
10 of 11 checks passed
test
Details
legacy-node-version-test (6.x)
Details
legacy-node-version-test (8.x)
Details
test262-pr Workflow: test262-pr
Details
Gitpod Open an online workspace in Gitpod
Details
Travis CI - Pull Request Build Passed
Details
babel/repl REPL preview is available
Details
build-standalone Workflow: build-standalone
Details
ci/codesandbox Building packages succeeded.
Details
codecov/project 91.69% (target 90.00%)
Details
e2e Workflow: e2e
Details
@JLHwung JLHwung deleted the JLHwung:yarn-2 branch Aug 25, 2020
@arcanis
Copy link
Contributor

@arcanis arcanis commented Aug 25, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.