There are multiple repos managed by the learning team and we have a mix of npm and yarn as dependency manager in them. This poll is to decide on one to use on all existing and future repos. Please vote below.
- Yarn
- Npm
0 voters
There are multiple repos managed by the learning team and we have a mix of npm and yarn as dependency manager in them. This poll is to decide on one to use on all existing and future repos. Please vote below.
0 voters
Hi folks
I was hoping that this would be more of a discussion than a simple vote maybe itâs worth getting a feel for peopleâs initial preferences and then having a second vote at the end? I donât know if this is even possible, and I am already digressing
The first thing that I would like to bring up as part of this discussion is that I donât believe this is entirely a technical question, and I would like to implore us to not just try to approach this from that point of view. I voted for npm above, and advocate for the use of npm over yarn because of a similar principle of âthe rule of least powerâ and the onboarding experience of new developers.
Letâs approach this by way of an example: We have a new developer approaching the Guides App in a month or so, and their experience is mostly in HTML and CSS and has never worked with Node before. In our CONTRIBUTING document, we are likely to say: âDownload the latest LTS Node from https://nodejs.org/ before getting startedâ. This is the point at which our story diverges based on the decision we make here today.
In scenario one: our next instruction is: "run npm i
and then npm start
and you will see the guides app will be available at https://localhost:4200. Job done.
In scenario two: the instructions are "run npm i -g yarn
(add some text about troubleshooting permissions) yarn
and then run yarn start
The difference between these two scenarios is that in the second one you have introduced quite a few new concepts that will be adding to the cognitive load of the new developer. âWhat does -g do in the command? What do you mean âglobalâ install? What is yarn? So youâre using a package manager to install a package manager? Why canât I just use npm if itâs also a package manager?â etc.
I think especially in the learning team we need to be cognisant of the message that weâre sending out by âmaking yarn the defaultâ, and considering the fact that our team seems to be a great place for âfirst contributionsâ it is my personal opinion that that the extra cognitive load is entirely not worth it for the diminishing returns that you get using yarn.
I wanted to try to avoid the technical question as part of this discussion but it is at least salient to note that as of npm 5.6 a lot of the reasons that inspired the creation of yarn in the first place have now been fixed, this is why I refer to any technical superiority of yarn as âdiminishing returnsâ.
The vote is only about using yarn/npm in our repos for developing those apps. So itâs fair to assume that theyâll know what npm & yarn are. Its not really about recommending any to the community
I agree on your point on npm being least effort for entry, but considering contributors who jump around multiple repos in a day, thereâs definitely a significant pain that they face on npm that yarn eases.
This particular topic is close enough to vim vs emacs, which is why I left it to a vote.
Even if npm is decided, iâd still use yarn while working with that repo finally delete the yarn.lock
file & run npm install once to update the package-lock.json
before i push any code. I donât see why anyone who strongly feels about npm canât do so either if yarn ends up being the choice
I donât understand the comparison that npm/yarn is simlar to the vim/emacs conversation, and you are not the first person to say that to me either.
The main difference here is that we donât have CONTRIBUTOR documentation that would start any line with âopen up emacs and run this emacs commandâ (iâve never actually used emacs so I donât know if that makes any sense)
The fact that Iâve actually never used emacs before so this would be a hurdle for me to get over to get started. This is why Iâm so focused on the ânpm being least effort for entryâ side of this argument.
Just because people feel strongly about both of those IDEs that its hard to get them to stop talking about them. Didnât meant to sidetrack the conversation.
I believe @real_ate has a valid point, we cannot assume that developers that want to contribute to Ember are intimately familiar with yarn. So it introduces a potential roadblock to new contributions and contributors. Ember has made it a point of pride to be welcoming to new contributors (at least, thatâs the message I have received, and heard from others in podcasts, talks and so on) and so that should be a consideration.
As a side point, Iâve yet to see a good comparison of the two that doesnât boil down to some UI niceness and developer preferences, but Iâm open to changing my mind if presented with good arguments. I believe the speed argument is mostly moot at this point (at least for me, anecdotally) npm is actually faster than yarn for the two Ember apps I am working with.
Weighing in:
if people want to contribute, theyâll learn the tool. Itâs fine.
Hey all, thanks for your input. Weâre going to align with the rest of core projects (like GitHub - emberjs/ember.js: Ember.js - A JavaScript framework for creating ambitious web applications) and use yarn across the board, so this discussion is complete.
One main actionable item from this discussion is that we can (and should) do more to help make it easy for people to get started, so that means better instructions in docs like READMEs and CONTRIBUTING.md. If anyone feels inspired, please open an issue with some suggested text!