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

Upgrade to yarn 4 #4124

Open
Rajdeepc opened this issue Mar 5, 2024 · 4 comments
Open

Upgrade to yarn 4 #4124

Rajdeepc opened this issue Mar 5, 2024 · 4 comments
Assignees
Labels

Comments

@Rajdeepc
Copy link
Contributor

Rajdeepc commented Mar 5, 2024

Migration Guide:

Why upgrade from yarn 1.x (aka classic)?

Stability:

Yarn Modern came after years of experience with maintaining Classic; its design was informed by the shortcomings we saw, and as a result the software is much more stable than it ever was.

New features:

Yarn Modern provides many new features that didn't exist in Yarn 1.x - or any other package managers for that matter. As an example, Constraints are exclusive to Yarn Modern.

Flexibility:

Yarn Modern supports all three installation strategies: Yarn PnP, node_modules, and via a pnpm-like content-addressed cache. No matter which one you prefer, you have it at your disposal.

Extensibility:

Yarn Modern's architecture allows you to build your own features as you need it. No need to wait for us to implement this feature you hope for - you can now implement it yourself, according to your own specs, and use it straight away! Focused workspaces, custom installs, project validation, ...

Future proof:

Yarn Modern was built after we started to see how difficult it was to build new features on Yarn Classic, with most changes having unpredictable consequences. This plateau has been solved, as evidenced by the slate of features that we released in the past few major releases.

My reasons for support an upgrade to Yarn Modern is it's tooling around monorepo management (see constraints, versioning, interactive upgrades, and a strong set of command-line tools).

Why upgrade to yarn 3 and not pnpm or npm latest?

Choosing to update to Yarn 3 based on several factors specific to our project's needs and constraints.

Firstly, our current setup and workflow are well-aligned with Yarn, and upgrading to Yarn 3 allowed us to leverage new features and improvements without significant disruptions. Yarn 3's focus on performance enhancements and workspace improvements particularly appealed to us, as it helps us manage our project dependencies more efficiently.

While Yarn 4 and the latest npm versions offer compelling features, such as improved tree shaking and faster installation speeds, we found that Yarn 3 provided a more seamless upgrade path and better compatibility with our existing tooling and infrastructure.

Moreover, the decision to stick with Yarn was also influenced by our team's familiarity with its commands and configuration, minimising the learning curve associated with switching to a different package manager like pnpm.

In summary, the decision to upgrade to Yarn 3 was based on its compatibility with our current setup, the specific features and improvements it offers, and its seamless integration with our workflow. I hope this provides a clearer understanding of why we chose Yarn 3 over other options.

@Rajdeepc Rajdeepc self-assigned this Mar 5, 2024
@Rajdeepc Rajdeepc linked a pull request Mar 5, 2024 that will close this issue
18 tasks
@Westbrook
Copy link
Collaborator

I'd like some more info on the delta between moving to yarn 3 and yarn 4. I'm by no means digging very deep, but it seem like that would absolve the need for corepack enable, which could easily trip up contributors. Further, are there any continuing questions about moving to corepack as it seems to still be "Experimental"? https://nodejs.org/api/corepack.html

Related, does patch-package continue to work with these newer versions of yarn with the advent of https://yarnpkg.com/cli/patch?

@Westbrook
Copy link
Collaborator

Along the lines of patch-package, will the dependency code still live in a project relative directory for us to manually alter, even when we don't patch it for the long term, while assessing issues and bugs in down stream dependencies?

@Rajdeepc
Copy link
Contributor Author

I'd like some more info on the delta between moving to yarn 3 and yarn 4. I'm by no means digging very deep, but it seem like that would absolve the need for corepack enable, which could easily trip up contributors. Further, are there any continuing questions about moving to corepack as it seems to still be "Experimental"? https://nodejs.org/api/corepack.html

Related, does patch-package continue to work with these newer versions of yarn with the advent of https://yarnpkg.com/cli/patch?

I agree and thank you for all these findings. Since corepack is still experimental, i don't see a rush to merge this PR in but there is a significant increase in the build time with the upgrade which we can consider once a stable released is in from the node team.

@Rajdeepc Rajdeepc changed the title Upgrade to yarn 3 Upgrade to yarn 4 Apr 23, 2024
@Rajdeepc
Copy link
Contributor Author

CSS implementation: adobe/spectrum-css#2546

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

Successfully merging a pull request may close this issue.

2 participants