Replies: 14 comments 16 replies
-
"Neither Yarn nor npm should have been included by default" I'd tend to personally agree with this assessment, but it unfortunately ceased to be relevant years ago. Npm is part of too many workflows, and we can't reasonably remove it from the classic distributions. The question isn't so much how to remove npm, but rather how to live with it in a way that's satisfying for all parties. |
Beta Was this translation helpful? Give feedback.
-
"This will be solved by #35682, there's no need to discuss this further" While true, even once #35682 is implemented, it'll only affect people changing their workflows to use this new distribution strategy. In other words, it'll take a lot of time for the whole ecosystem to converge and, in the meantime, Node.js developers using Yarn will still be second-class citizen. Additionally, if Yarn is considered for being a builtin inclusion in the context of #35682 (and it's been mentioned a few times that it was), then it would make sense to bring it to the binary distributions as well, if only for feature parity. |
Beta Was this translation helpful? Give feedback.
-
"Yarn can be installed manually, there's no point distributing it with Node." This might be true for you, but not for novices. Just like many people weren't aware that npm Inc. was a for-profit company, many people still aren't aware that npm is a third-party project that the Node.js org doesn't actually control. Because of this misconception, they don't look elsewhere, and are often deprived of the choice without even knowing it. Similar situations happened multiple times in the past, the most obvious parallel being BrowserChoice.eu. Let me share this snippet from the press release the European Commission released at the time:
|
Beta Was this translation helpful? Give feedback.
-
"It would break tools that check Yarn's existence to know what package manager to use." This argument doesn't really hold for many reasons:
|
Beta Was this translation helpful? Give feedback.
-
"That could pollute the global binaries." Npm seems to have been generally fine with adding binaries - first |
Beta Was this translation helpful? Give feedback.
-
"That would increase the Node distribution." Npm is 31MB. The smallest Yarn distribution is 1.8MB. If size truly is a concern, we just have to ask npm to remove the markdown files to literally free 5MB and offset more than enough the inclusion of Yarn. |
Beta Was this translation helpful? Give feedback.
-
"I don't use Yarn" And that's fine, but you're a fairly small data point. Many people do. While we don't have a lot of data, Yarn has shown to be a consistent 30-40% of all polls on Twitter (and trust me, there are a lot of them ...). Yarn 2 itself recently polled around 14%. Thousands of developers use Yarn every day. |
Beta Was this translation helpful? Give feedback.
-
"Npm is all we need now that they have workspaces" Both projects are different in many aspects, only some technicals, and the different tradeoffs have value regardless of the exact featureset (and I personally disagree with the feature parity in general, but it's not relevant to this discussion). |
Beta Was this translation helpful? Give feedback.
-
"What about pnpm?" I would tend to support pnpm's inclusion as well, especially since they now support being distributed as a single file, just like Yarn itself. |
Beta Was this translation helpful? Give feedback.
-
"Which Node.js version should start including Yarn?" I would tend to think that Node 15 would be the best, given it's an odd release, but other contributors would have more experience with this kind of work. |
Beta Was this translation helpful? Give feedback.
-
At this point, I'd suggest opening a PR that adds it and let's see how far we get. |
Beta Was this translation helpful? Give feedback.
-
Yarn 1 vs Yarn 2 The distinction between Yarn 1 and 2 is really confusing in the documentation: https://yarnpkg.com/getting-started/install.
Note that they live in two different repos: https://github.com/yarnpkg/berry vs https://github.com/yarnpkg/yarn. From some early checks, it seems that yarn is downloaded 1.9 millions per week, while berry is at 70 thousands. What should we ship? |
Beta Was this translation helpful? Give feedback.
-
What impact would it have on registry hosting? The issue of what binary to ship is inseparable (to me, at least) from the issue of who runs the registries. The bundling of
I think one reason the client bundling issue never gets anywhere is because it attracts a lot of attention/opinions around issues that are relatively easy to talk about, like whether it's worth it to add another 1.8 Mb to the download size of a Node.js installation. But the most important question (to me, at least) is what the long-term impact on registry hosting is likely to be. This question is more existential (due to the centrality of the npm registry to the success of Node.js), probably at least somewhat unknowable, and very... I don't know... loaded? It's a sensitive issue for various reasons. A related question, then, is: Given that much of this critical issue is probably unknowable (and hard to talk about), is Node.js willing to make a change anyway? Or does the uncertainty mean we stick with the status quo because of the risk of damage to something that's working? |
Beta Was this translation helpful? Give feedback.
-
The TSC has voted against including Yarn in Node.js, in favor of a corepack-like solution. |
Beta Was this translation helpful? Give feedback.
-
This is related to #15244 and #35682, but this particular thread is focused on one specific question: should Yarn be distributed with Node.js?
There are various points typically raised against this. Because it's an hot subject with many Opinions™, I'd like to do something a bit different. I'll open multiple sub-threads in this discussion, and offer a starting opinion on them. Feel free to discuss them, but please keep discussions scoped to each sub-thread (ie don't collate them in a single post). You can create new ones if you think I forgot a particular point.
Beta Was this translation helpful? Give feedback.
All reactions