-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Migrate to yarn3 #5863
Merged
Merged
Migrate to yarn3 #5863
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tomekzaw
requested changes
Apr 10, 2024
piaskowyk
approved these changes
Apr 10, 2024
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.
I have no more comments than Tomek 👍
tomekzaw
reviewed
Apr 10, 2024
tomekzaw
reviewed
Apr 10, 2024
tomekzaw
approved these changes
Apr 10, 2024
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.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Migrating from yarn1, which is no longer supported, to yarn4. It comes with many features, first and foremost - support, followed by yarn.lock poisoning protection, better organization of package lifecycle and so on.
Key changes in this PR:
Removal of
yarn prepare
Custom
pre
andpost
scripts are no longer supported. Therefore, steps fromyarn prepare
have to be moved toyarn build
which then has to be called explicitly. This is why in many CIs I had to add this explicit step. Also,postinstall
script should never be used if possible.You can read more about it here.
Hardened mode
You can notice that all the CIs now have
with an exception of a new CI
validate-yarn.yml
, which hasThis is because yarn3+ comes with yarn.lock poisoning protection out of the box, and it is enabled when yarn detects a pull request to the repo. This significantly slows down CIs, and as per yarn documentation recommendations, we turn it off for each CI except for one dedicated one.
.yarn/releases
New yarn comes with idea that not only the dependencies should be locked, but also the package manager itself. That's why it's a standard now to commit the whole
yarn
source file in the repo, so each user uses exactly the same version. I know it seems weird at first, but you'll get over it same as I did.Also minor changes due to fact that packages got bumped and some TS types weren't working etc.
Test plan
The only CIs that don't pass are the ones that don't work on main either.