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

Question: Why did yarn was chosen instead of npm? #1603

Closed
midnight-wonderer opened this issue Jul 9, 2018 · 6 comments
Closed

Question: Why did yarn was chosen instead of npm? #1603

midnight-wonderer opened this issue Jul 9, 2018 · 6 comments

Comments

@midnight-wonderer
Copy link

midnight-wonderer commented Jul 9, 2018

I just wanted to know the rationale behind the decision.
npm is the default of the javascript community. I am curious why webpacker insist on using yarn.

@renchap
Copy link
Contributor

renchap commented Jul 9, 2018

This is not a Webpacker decision, but a Rails one. Yarn is the JS package manager integrated with Rails so Webpacker uses it.
I was not involved in this, but iirc when the decision was made, npm was really lacking behind yarn, both in term of perf and feature (lockfile for example)

@prusswan
Copy link

Yarn is directly supported since Rails 5.1, but more importantly, dhh likes it so..

More info: http://g3ortega.com/rails/2017/05/30/rails-5-1-and-forward-yarn-on-rails.html

@midnight-wonderer
Copy link
Author

midnight-wonderer commented Jul 30, 2018

Thanks for the info.
Rails is starting to move slowly IMO.
There is a lot of legacy stuff and difficult-to-update components.

I'm going to ditch both yarn and webpacker all together for future projects.

Just npm and webpack (the node module, not this gem) would generate fewer hassle these days. With a little Ruby code, we are able to glue everything together nicely. (See assets-webpack-plugin as a starting point for the integration.)

Thanks a lot, everyone who made the webpacker possible. It was a good ride.

@seanhealy
Copy link

It's pretty straight forwards to make webpacker play nice with npm.

There is a nice guide here:
https://itnext.io/how-to-use-webpacker-with-npm-instead-of-yarn-a8a764e3a8ab

However I do agree that out of the box support for npm or, just moving to npm now that it has caught itself up would be much preferable.

@aesyondu
Copy link

Hi all, based on this comment in this article as well as this comment in a separate issue, it is no longer trivially possible to move to npm.

@jakeNiemiec
Copy link
Member

Additionally, see: #2467 (comment)

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

No branches or pull requests

6 participants