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

Migrate to yarn3 #5863

Merged
merged 37 commits into from
Apr 10, 2024
Merged

Migrate to yarn3 #5863

merged 37 commits into from
Apr 10, 2024

Conversation

tjzel
Copy link
Contributor

@tjzel tjzel commented Apr 3, 2024

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 and post scripts are no longer supported. Therefore, steps from yarn prepare have to be moved to yarn 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

env:
  YARN_ENABLE_HARDENED_MODE: 0

with an exception of a new CI validate-yarn.yml, which has

env:
  YARN_ENABLE_HARDENED_MODE: 1

This 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

:shipit:

The only CIs that don't pass are the ones that don't work on main either.

@tjzel tjzel changed the title Migrate to yarn4 Migrate to yarn3 Apr 4, 2024
@tjzel tjzel marked this pull request as ready for review April 10, 2024 09:43
.github/workflows/check-TS-react-native.yml Outdated Show resolved Hide resolved
.github/workflows/check-TS-react-native.yml Outdated Show resolved Hide resolved
.github/workflows/tvos-build.yml Show resolved Hide resolved
.github/workflows/check-expo-dev-client-nightly.yml Outdated Show resolved Hide resolved
.github/workflows/static-example-apps-checks.yml Outdated Show resolved Hide resolved
plugin/package.json Outdated Show resolved Hide resolved
plugin/src/workletFactory.ts Show resolved Hide resolved
plugin/src/workletFactoryCall.ts Show resolved Hide resolved
plugin/src/workletFactory.ts Show resolved Hide resolved
.github/workflows/validate-yarn.yml Show resolved Hide resolved
Copy link
Member

@piaskowyk piaskowyk left a 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 👍

Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

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

Thanks!

@tjzel tjzel added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit 2bf070a Apr 10, 2024
31 of 41 checks passed
@tjzel tjzel deleted the @tjzel/bump-yarn branch April 10, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants