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

Update to Yarn 3 #13140

Merged
merged 12 commits into from Sep 16, 2021
Merged

Update to Yarn 3 #13140

merged 12 commits into from Sep 16, 2021

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Apr 12, 2021

Q                       A
Any Dependency Changes? Yes, Yarn (committed dev dependency)
License MIT

Yarn 3 isn't stable yet, but I want to verify that it doesn't introduce any unexpected regression in our workflow.

It currently breaks our release tool, but it's a known breaking change.

What works so far:

You can see the breaking changes list at https://github.com/yarnpkg/berry/blob/master/CHANGELOG.md#breaking-changes. We are affected by:

  • Node.js 10 has been dropped
  • Yarn runs with --immutable by default on CI
    There are workarounds/changes for both of them.

@nicolo-ribaudo nicolo-ribaudo added PR: Dependency ⬆️ PR: Internal 🏠 A type of pull request used for our changelog categories labels Apr 12, 2021
@babel-bot
Copy link
Collaborator

babel-bot commented Apr 12, 2021

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 12, 2021

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 62c08b9:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@merceyz
Copy link
Contributor

merceyz commented May 18, 2021

Would you be willing to change this PR to use the CLI from yarnpkg/berry#2161 and enable PnP for the build step again? I updated the PR over the weekend and added tests based on your comments from last time and fixed some issues that caused it to crash when running yarn gulp in this repo, it looks like it works but would be nice to have the CI agree.

@nicolo-ribaudo
Copy link
Member Author

Ok, sure!

@nicolo-ribaudo
Copy link
Member Author

When using PnP the generated @babel/standalone bundle is broken, but it might be caused by something else (maybe Rollup).

@merceyz
Copy link
Contributor

merceyz commented May 21, 2021

Yeah I saw that, looked into the bundle but nothing stood out, I see the methods are missing but not sure why

@merceyz
Copy link
Contributor

merceyz commented May 21, 2021

These two imports are merged into one https://github.com/facebook/regenerator/blob/dbbddd9bd8c099ed1cdfcecdd077b8b4e7f43042/packages/transform/src/leap.js#L10-L11 so it's trying to get inherits from ./util which doesn't exist

@merceyz
Copy link
Contributor

merceyz commented May 31, 2021

Got some time to look into it and it looks like a bug on our end, I'll fix it

@nicolo-ribaudo
Copy link
Member Author

nicolo-ribaudo commented May 31, 2021

Oh thanks! Let me know when I have to update this PR.

@nicolo-ribaudo
Copy link
Member Author

Yarn 3 has been released! I removed the commit to test yarnpkg/berry#2161 since that PR has been deferred to a later version. I'll update a new branch PR if we'll have to test ESM support before that it's merged.

@nicolo-ribaudo
Copy link
Member Author

@arcanis Was the --skip-builds option removed? It's not mentioned in the changelog 🤔

@arcanis
Copy link
Contributor

arcanis commented Jul 26, 2021

It got replaced by --mode=skip-build, I'll add it to the changelog 👍

@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review July 27, 2021 21:15
@nicolo-ribaudo
Copy link
Member Author

The CI failure looks related

@larixer
Copy link

larixer commented Jul 29, 2021

@nicolo-ribaudo I'm not sure that its related, but why did you do:
image
Have you seen that it fails?
image

@arcanis
Copy link
Contributor

arcanis commented Jul 29, 2021

Running the following locally seems to work for me - could it just be that your trunk has legit breaking changes that would break using a version of @babel/types at the same time as the trunk one? I don't see other e2e-breaking-pr tests running so I can't compare 🤔

rm -rf /tmp/jest
git clone --depth=1 https://github.com/facebook/jest /tmp/jest 
cd /tmp/jest
node -e "
  var pkg = require('./package.json');
  pkg.resolutions || (pkg.resolutions = {});
  pkg.resolutions['@types/babel__traverse/@babel/types'] = 'latest';
  fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
"
yarn install
yarn build

@nicolo-ribaudo
Copy link
Member Author

Yeah, I think that "related" is more something on our side uncovered by an innocuous change in Yarn.

@larixer I don't remember, I'll revert it back 😅

@nicolo-ribaudo
Copy link
Member Author

Ok, it looks like I used npm to install verdaccio because Yarn 3 throws:

+ yarn global add verdaccio-memory@~9.7.2
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

@merceyz
Copy link
Contributor

merceyz commented Sep 11, 2021

We have a compat layer that is supposed to handle that 🤔

package.json Outdated
@@ -16,6 +16,7 @@
"test:runtime:bundlers": "node test/runtime-integration/bundlers.cjs",
"test:runtime:node": "node test/runtime-integration/node.cjs"
},
"packageManager": "yarn@3.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

Q: Is this for corepack?

Copy link
Contributor

@merceyz merceyz Sep 11, 2021

Choose a reason for hiding this comment

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

Yes, when corepack is enabled running yarn will launch yarn@3.0.0 which will check yarnPath and use that binary if it doesn't match the one corepack launched

Copy link
Contributor

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

CI is passing but @yarnpkg/plugin-constraints should be updated as well

@nicolo-ribaudo
Copy link
Member Author

Greeeen 🥳

@nicolo-ribaudo
Copy link
Member Author

After merging this I'll do something like yarnpkg/berry#3431

Copy link
Member

@hzoo hzoo left a comment

Choose a reason for hiding this comment

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

nice work, verifying is much easier than testing ci..

@merceyz
Copy link
Contributor

merceyz commented Sep 17, 2021

The issue in #13140 (comment) has been fixed and the ESM PR has been updated

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 18, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Dependency ⬆️ PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants