TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Yarn 3.0

154 pointsby Jowseyalmost 4 years ago

24 comments

FractalHQalmost 4 years ago
I used to use yarn all the time until I tried pnpm. The speed is amazing, and as a traveler I love that it works offline by default. I’d be curious to see some benchmarks between pnpm and yarn 3, because pnpm has been the fastest of the bunch for me. It also gets bonus points for pnpx, workspaces, and essentially being a drop-in replacement for npm.
评论 #28012510 未加载
评论 #28012759 未加载
评论 #28011700 未加载
评论 #28013389 未加载
评论 #28012013 未加载
评论 #28015268 未加载
评论 #28012444 未加载
nicoburnsalmost 4 years ago
I&#x27;d be interested to know what HN&#x27;s experience with Yarn 2 has been. Yarn 1 was compatible with NPM, so switching was easy, but Yarn 2 seems to need explicit support in a lot of cases.<p>Had anyone found significant benefits from switching to yarn 2? And conversely, has anyone had any issues with this?<p>EDIT: It seems that there is also a 3rd option: pnpm. Experiences with pnpm would also be welcomed.
评论 #28010929 未加载
评论 #28011713 未加载
评论 #28010997 未加载
评论 #28012483 未加载
评论 #28011155 未加载
评论 #28011640 未加载
评论 #28011490 未加载
评论 #28011059 未加载
评论 #28011457 未加载
评论 #28011197 未加载
评论 #28011090 未加载
评论 #28011205 未加载
评论 #28012163 未加载
Lammyalmost 4 years ago
Don&#x27;t forget to disable the tracking if you care about that sort of thing: <a href="https:&#x2F;&#x2F;yarnpkg.com&#x2F;advanced&#x2F;telemetry" rel="nofollow">https:&#x2F;&#x2F;yarnpkg.com&#x2F;advanced&#x2F;telemetry</a><p>`yarn config set enableTelemetry 0` per-project.<p>`yarn config set --home enableTelemetry 0` per-user.
评论 #28016695 未加载
xcambaralmost 4 years ago
The single decision from the Yarn team to not offer a reasonable transition path from v1 to v2 was a total blocker for my teams.<p>After trying it on seldected projects, we collectively decided that it was not worth it to follow a project that did not take its users&#x27; time seriously, since the migration was so hard.<p>So, yarn@v1 then npm@v7+ for us.
评论 #28011949 未加载
评论 #28015253 未加载
rudianalmost 4 years ago
Yarn was great and all, but it’s not npm so you have to convince the whole team to use it.<p>I can’t believe npm still sucks after 10 years. Week doesn’t go by I have to nuke node_modules and occasionally the lock as well. It’s junk as far as I’m concerned, but I just happen to know what the problem is every time.
评论 #28011738 未加载
评论 #28011693 未加载
评论 #28011732 未加载
paxysalmost 4 years ago
Still can&#x27;t believe they messed up Yarn so bad with v2. It was all set to replace npm, and now isn&#x27;t anywhere in the picture.
评论 #28011337 未加载
评论 #28014027 未加载
oefrhaalmost 4 years ago
Anyone has seen stats on yarn 2 uptake? I’m still on yarn 1 and I know I’m far from the only one.
评论 #28010868 未加载
评论 #28010916 未加载
评论 #28015876 未加载
评论 #28011401 未加载
评论 #28019149 未加载
andrew_almost 4 years ago
For my money, I&#x27;ll take PNPM any day of the week. YMMV it&#x27;s still faster than any version of Yarn or NPM hands down. <a href="https:&#x2F;&#x2F;pnpm.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pnpm.io&#x2F;</a>
dstaleyalmost 4 years ago
One of the biggest things holding me back from transitioning my open source projects over to Yarn and PnP is Dependabot support. I&#x27;d even settle for support with the `node-modules` plugin at this point, but GitHub is of the opinion that there isn&#x27;t much community usage of yarn v2 to warrant the additional development required to support yarn v2+.<p>I&#x27;m really glad for all the forward thinking projects like yarn and pnpm are bringing to the node package management space, and I&#x27;m also glad to see that npm is listening and taking those advancements into consideration. I&#x27;m currently exploring using npm v7&#x27;s workspaces feature, which was something I originally wanted to use yarn for.
nealsalmost 4 years ago
So did the dawn of Yarn make package management for nodeJS better for everyone or do we now just have another packagemanger to choose from and take into account when we publish packages?
评论 #28012254 未加载
评论 #28012461 未加载
dbjorgealmost 4 years ago
My team is still using yarn v1 because we want both dependabot support (rules out yarn v2+ and pnpm) and support for overriding transitive dependency versions to force security fixes (eg, yarn resolutions). We would love to explore other options but right now yarn v1 seems to be the only game in town that meets those requirements.<p>Once npm implements their recently-accepted overrides RFC, we&#x27;re eager to try switching to that.
dzongaalmost 4 years ago
for me yarn 2 was a clusterfuck. I thought dependency resolution, would be better but nah. then it also polluted my workspace with dozens of json files. and issue of packages not being found, when using esm via node.
ggregoirealmost 4 years ago
What are the main benefits of v3 compared to v1?<p>Is there any migration work needed to use v3 on a project bootstrapped with v1 or is it transparent?
jbverschooralmost 4 years ago
So npm7 still copies everything in the local node_modules directory?<p>Still sucks then.
评论 #28012676 未加载
mixedCasealmost 4 years ago
Does the combination of Yarn, VSCode and TypeScript work now?<p>I&#x27;ve wasted time twice now trying to move projects to Yarn 2 just to have the tsserver LSP break every time, being unable to find the packages despite following the documentation to the letter.
评论 #28012574 未加载
评论 #28011897 未加载
评论 #28012810 未加载
xtractoalmost 4 years ago
What are the advantages of using Yarn over NPM? It just feels to me that npm does anything that is needed and is available in stuff like ansible-node docker containers. Why should someone who is used to Yarn check Yarn?
评论 #28011211 未加载
评论 #28011045 未加载
dmitriidalmost 4 years ago
So... What exactly is this version, how is it different from yarn 2 that it warrants a major version update (not that I even know what yarn 2 was about), and how does it compare to npm?
tdhz77almost 4 years ago
Yarn had its place. It’s time to move on with npm. The newer version is so much faster and you won’t run into permissions issues like with yarn.
评论 #28011736 未加载
serverholicalmost 4 years ago
Any news on react-native support?
评论 #28012589 未加载
akmittalalmost 4 years ago
Is yarn 3 stable, I dont see it published to npmjs.com. I dont even see yarn 2 stable
smashahalmost 4 years ago
Wasn&#x27;t able to get over some of the decisions made on yarn 2. Hopefully yarn 3 is more compatible to a usual npm flow.
wdbalmost 4 years ago
I seem to have issues with using Yarn or NPM v7 with Gitlab NPM private registry.<p>Sadly, I can&#x27;t use NPM v7 or Yarn yet :(
评论 #28011545 未加载
ojkellyalmost 4 years ago
One of the reasons I really like Yarn 3, is the really good support for linking local dependencies. The whole “@internal&#x2F;mypackage”: “workspace:*”.<p>That, and the plugin system.<p>Because it meant I could build on top of yarn a build&#x2F;test system much like Bazel, Buck and Pants. But without the overhead of those tools.<p>Honestly, being able to build functionality into tooling like this is really awesome. Especially when it’s aware dependency graph.<p>I often have polyglot repos, with a heap of typescript, and some golang, and other stuff.<p>I spent a couple of weeks last year hacking away on a plugin, that can look at the whole dependency tree defined in yarn - and develop a build graph that can build everything in the required order, taking advantage of every cpu thread available. While keeping track of what’s previously been built.<p>From that, I extended the support to testing to do the same thing.<p>I wrapped it all up into a nice package and published it to:<p><a href="https:&#x2F;&#x2F;yarn.build" rel="nofollow">https:&#x2F;&#x2F;yarn.build</a><p>Can be installed with this command<p><pre><code> yarn plugin import https:&#x2F;&#x2F;yarn.build&#x2F;latest </code></pre> Then it’s just `yarn build` which runs `package.json#scripts.build`, and `yarn test` which runs `package.json#scripts.test`.<p>—<p>Since then, there’s been plenty of development. I added a bundle command. You tell it which local package to bundle up, and it copies your repo to a temporary folder, removes everything that package doesn’t need (useful in a giant monorepo), leaves the other packages it depends on. Finally it adds a file `entrypoint.js` which sets up pnp for you, and re-exports the `main` file from your target package.<p>Then it zips it up for you ready for AWS Lambda (my use case), but also Docker and any other node runtime.<p>And recently I hacked another interesting plugin that yarn and pnp enabled. A really neat plugin that lets you write package.yaml instead of package.json.<p>If you replace package.json with package.yaml (or .yml), it will appear to yarn as a normal package.json. Everything works fine (with yarn, unsure about some node tooling), and you even get comments.<p>It’s a completely separate plugin (because it’s pretty out there), and it only has an effect if you don’t have a package.json in your package folder.<p>I’m using it on the golang packages in monorepo’s, because those developers are often a bit upset by seeing build tooling in a json file.<p>The package.yaml plugin can be installed with the following command:<p><pre><code> yarn plugin import https:&#x2F;&#x2F;yarn.build&#x2F;yaml </code></pre> It’s still a bit experimental, but works pretty well.<p>—<p>It’s all open source on GitHub, if you have any issues using it feel free to post a bug report.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ojkelly&#x2F;yarn.build" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ojkelly&#x2F;yarn.build</a>
bassman9000almost 4 years ago
&gt; Breaking Changes &gt; Node 10 isn&#x27;t supported anymore.<p>10 is LTS
评论 #28010908 未加载
评论 #28010887 未加载
评论 #28010910 未加载
评论 #28010903 未加载