Problem/Motivation

Back when yarn was cool we added it in core. NPM has revamped itself so let's revert back to npm.

Proposed resolution

As per #3079738-23: Add Claro administration theme to core

npm has come to a point where it provides much of what yarn has. Lock files, scripts, etc, npm is much improved since.

Remaining tasks

Discuss.
Do it.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD

Comments

jibran created an issue. See original summary.

andypost’s picture

Issue tags: +frontend
webchick’s picture

Version: 8.8.x-dev » 9.x-dev

IMO this would definitely be a Drupal 9 thing. We would not want to swap tooling this late in Drupal 8's cycle.

cilefen’s picture

+1 It is simpler in the first place to require only NPM.

droplet’s picture

You should not feel that's annoying because every developer has both on their computer. This need not tell non-Core contributors to use Yarn in the first place.

To me, Yarn still saving me 2 ~ 5sec on the hot cache (on different computers). If you making `yarn install` into your daily workflow on each git commit or git checkout, you will find the differences.

Yarn PnP - this is a thing and will be default with Yarn 2

spleshka’s picture

From the experience of my team, we went from "Oh, npm is the standard package manager in the frontend community, let's use it" to "Wow, npm doesn't have .lock file, we need to switch to yarn to keep the dependencies consistency. Also, yarn seems to be faster." and eventually landed with to "Actually, now npm has introduced .lock file and seems to be as fast as yarn (more or less). So let's revert back to the standard package instead of using third-party".

However, it's still not easy decision after all due to several reasons:

1. This
2. Yarn needs tiny bit less typing to run commands (i.e. yarn build instead of npm run build) - Go lazy devs (me)!
3. Yarn still seems to be faster in benchmarks. However, this difference isn't that significant as it used to be.
4. Yarn 2 has quite promising roadmap.
5. Yarn always aimed to include all features of npm + add some nice extras on top, so theoretically it should be more or at least as future proof as npm. However, npm was included into node package and de-facto became a standard, as well as got huge ecosystem around it, so I can barely imagine how yarn can beat npm in the long run.

To make the long story short, there's no crystal clear answer as to what package manager to use. For my team I've decided to stop switching between npm and yarn, get a large can of popcorn, take a backseat and wait until one of them wins the competition.

xjm’s picture

This would be indeed a 9.x thing, but it would be something that would need to be added with BC and deprecation as per our normal policy in some minor version of Drupal 9, so moving it to 8.8.x for now. That way it eventually will end up in the queue of the 9.1.x feature branch. :)

xjm’s picture

Version: 9.x-dev » 8.8.x-dev
xjm’s picture

Also, the proposal would need review from the frontend framework manager to be considered. Thanks!

jibran’s picture

Wait, let's take a step back here. If we just drop the yarn.lock from core and remove the yarn as an engine from package.json then developers are free to use whatever they want.

Also, we can add .nvmrc and .yvmrc to help people use the correct versions.

droplet’s picture

#10

You can do it now freely. To use Yarn is designed for CORE contributors.

Also, we can add .nvmrc and .yvmrc to help people use the correct versions.

If Yarn is a problem, above 2 is 10x of Yarn for Linux & MacOS, 1000x for Windows users. PostCSS will be 100x for those who failed to install Yarn.

For the theme, the Claro, it can add a statement:

For those who don't want to use extra tools. Edit the CSS/JS directly.

This is unlike CORE JS which is targeted to patcher, you can edit the CSS/JS files directly :p

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nod_’s picture

Status: Active » Closed (works as designed)
Issue tags: -JavaScript +JavaScript

we're keeping yarn for now. On the JS packages side of things we're starting to use yarn2 pnp so we're getting more invested in that toolchain. I don't see a strong argument either against yarn or for npm, so closing.