Update from Yarn 1 to Yarn 4

Created on 28 January 2020, almost 5 years ago
Updated 17 April 2024, 7 months ago

Problem/Motivation

Drupal 10.0.x is currently still using Yarn 1 ("Yarn Classic"). Per https://github.com/yarnpkg/yarn#contributing-to-yarn:

The 1.x codebase is fairly old and will only accept security fixes. For new features or bugfixes, please see our new repository and its contribution guide.

That's been the case since Feb. 2020. I can't find any information about when security fixes for Yarn 1 will cease or how much notice the project will give prior to then.

Proposed resolution

Update to Yarn 4 by following the migration steps from https://yarnpkg.com/getting-started/migration.

We have 2 options of using yarn 4 in core now:

1. Keep executable file in code as suggested in 3109556-yarn-4-to-11x MR https://yarnpkg.com/features/caching#zero-installs
2. Continue with experimental https://nodejs.org/api/corepack.html#corepack as suggested in 3109556-4-1-1-corepack

Remaining tasks

Testing instructions

  • In node js. 16+
  • cd core + corepack enable + yarn install
  • run different yarn build/watch etc. tasks from /core/package.json scripts{} section
  • sure that all scripts work as before

User interface changes

API changes

Data model changes

Release notes snippet

Yarn 4 and Corepack are now required for Drupal core development. Review the change record on Yarn 4 for more information and troubleshooting recommendations for corepack.

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Javascript 

Last updated about 4 hours ago

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024