-
Notifications
You must be signed in to change notification settings - Fork 26
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
Yarn over npm? #39
Comments
@Shouston3 great question! (thanks for opening this discussion thread!) 😍 Yes, Yarn is on our radar (and there are good use cases for it, see below): nelsonic/nelsonic.github.io#234 🤔
Unless you are working on many projects that have similar dependencies Facebook are Creating an Artificial "Need" for a New Package Manager by using Bloated Dependencies instead of being Efficient ...
@dwyl We don't routinely use mega-dependencies like "Babel" which we agree takes ages to install!!
Facebook are "solving" a "problem" they created by building huge modules in the first place and fragmenting the node.js community instead of (patiently) contributing back to NPM. Thankfully, None of the projects/products @dwyl suffer from the "takes ages to install" problem. What "FB Engineering" could (should) have done is take their Vast Capital and approach the lovely (talented and super dedicated!) people at NPM Inc (@isaacs and @seldo are super approachable and community-minded!) with a proposal ... for example:
Preliminary ConclusionWe don't need Yarn, yet. Thanks!! ❤️ ✅
tl;dr (warning: contains lesson)Yarn is technically "better" than NPM for the reasons described on the slick website... Facebook (and handful of other "Big" companies) always want to own the system rather than use (and help improve) the already pretty decent system that exists. this is their way of trying to "brand" something that they did not invent and were not a part of creating but have decided to "appropriate" now because:
Let's evaluate Yarn on it's own merits. and determine if we have a need to use it. 👍 |
Thanks for raising this @Shouston3 👍 🎉 A very legitimate question and I'm glad you've allowed us to have a place to address it! |
@nelsonic thank you so much for the insight on how yarn probably came about, and from my subsequent reading around the topic, you are right that initially yarn came about from high volumes of dependencies and slow build times, but also nondeterministic installs (which myself and others have felt the unnecessary pain of) and security issues. Although it has been interesting reading up on the history of the npm and facebook teams and how this tool came to be, I would prefer to focus on the pros and cons of using this tool. Need?I don't know why there is such a focus on the "need" for it, it is simply an alternative tool to use over the npm cli to improve your workflow. I think a better question to ask would be, do the benefits of using yarn outweigh the costs? With yarn, there is also practically no learning curve, you can be fully up and running in a few seconds (with a couple of seconds install time ( Also, any project that implements yarn won't force anyone to have yarn installed globally or to use yarn at all, they can still (But you still might as well run To answer your specific questions: Have you felt the need for it on one of your projects?Not the "need", I can manage without it, but over the last few months I have been using it when I can because it speeds up my workflow with (as of yet) no downsides. Do you have a project where installing the dependencies takes longer than 20 seconds?For Dwyl projects, large install times are rare, but my last project took more than a minute to install and some other dwyl projects have similar install times (Also perhaps this is caused by the specs on my macbook air, but running Is it slowing down your productivity?Yes HoweverYarn is really new and your caution is definitely warranted (and your not alone here and here). Although it is actively maintained, there is quite a lot of open issues. And perhaps it is overkill for small projects ConclusionCould we try it out in one or two future projects and then evaluate if the benefits outweigh the costs? |
@Shouston3, good question. Why should we focus on a "need"...? 🤔
when making a change to an existing project we always focus on the User need, because otherwise we would end up with a project that gets re-written several times (at high expense to the client) without any direct benefit to the end-user... i.e: "FOCH" ... so, we identify a need first and work from there.
I understand the desire (or curiosity) to try a new tool
Read: https://www.facebook.com/help/152637448140583 do you honestly believe this though?
Yes, the science museum is using Babel... https://travis-ci.org/TheScienceMuseum/collectionsonline#L503 and it makes me sad. 😢
Cost-Benefit AnalysisYes, you will get a increase in speed installing dependencies using Yarn.
I install things maybe once every couple of weeks when there is an update to a dependency in a project I'm working.
By contrast I can see a glaring "downside" of installing a Global Tool Made by an organisation I don't trust:
Nothing against other people using Yarn. Thankfully, this isn't a "problem" I'm going to have for much longer... ⏳ Personally, I will But everyone It boggles my mind how people take NPM for granted. 😢 And Love you Sam! thanks again for opening this discussion! ❤️ |
That is not really a perspective I had thought about too much and as it seems to be a popular one and a definite downside, it makes sense to not implement yarn. My issues lie with previous projects and can't really see these arising with the new stack. I am going to continue to use yarn for personal projects as I literally have nothing I care about on my computer (should I still watch out?) and will happily ignore fb recruiters should they come knocking. |
I don't see how yarn is a better choice over npm in most instances. I don't like the idea of trying something new just because. npm is widely used and thus the barrier to entry on an informational stand point, is lower. |
Good points @Charlotteis, I think I'll put this issue out of it's misery |
@Charlotteis
Is that a typo? It seems like this sentence is incongruent with the rest of what you're saying in your post. In any event, thanks for the generous props and/or candid criticism, as appropriate ;) |
@isaacs typo indeed! I don't see how yarn is a better choice over npm in most instances. |
@nelsonic I got here from the discussion on the things-of-interest channel. We might also be switching to Yarn at work, and I've been reluctant as I've never had any issues with modules taking too long to install. So I appreciate the points raised here. You mentioned:
Could you please point me to any links that may explain this in more detail? Thank you. |
@Neats29 if you don't have a rule for who trust Have a look at the installation instructions for Yarn: https://yarnpkg.com/en/docs/install#mac-tab notice the Look at how they install it on Ubuntu/Debian: Why Yarn is probably perfectly "safe" for now... A library that forces me to install with Again, each person should make up their own mind if they want to use Yarn. tl;drSure, package caching is a useful feature, but the 3 "USPs" of Yarn could/should have been PR'd into NPM but instead Yarn (Facebook) have merely re-packaged (excuse the pun) the NPM's hard work and re-branded it so they can "own" after doing none of the difficult work of actually running a package repository! They should have contributed the improvements up-stream instead of fragmenting the ecosystem. Personally I'm way more interested in using "PETE" for all our future projects: I was really excited about node.js in 2011 Anyway... we all know it's possible to write simpler code. Instead of debating wether to use NPM or Yarn, stick with NPM for Node projects Don't Settle. Build Better! 🚀 |
@nelsonic thank you for the detailed response. |
We are currently using just npm to manage our dependencies, but I think there are better alternatives such as yarn.
I have seen that we're not using it in any of our projects. Why is this?
I can't see any reason to not be using it
The text was updated successfully, but these errors were encountered: