Live data from Hacker News

Hello Yarn 2, Goodbye node_modules

freddixx.medium.com

141–150 of 160 posts

Re: Hello Yarn 2, Goodbye node_modules

#141
post #44
post #42

Earlier quoted context omitted.

There are I'm sure valid reasons for doing it, but it fragments an already fragmented ecosystem. And IMHO it is ideal for there to be a first-party solution like Ruby/Bundler, Rust/Cargo, Swift/SPM, etc.

Isn't the first party solution NPM?

It still ships with node, right? So yeah.

Re: Hello Yarn 2, Goodbye node_modules

#142
post #12

Yarn 3.0 was released in July 2021 ( https://dev.to/arcanis/yarn-3-0-performances-esbuild-better-... ) Meanwhile, as much as I respect the work of Mael (yarn maintainer) I’ve switched back to npm. Mostly because: - isaacs (original creator of npm) did some commits lately - now backed by GitHub - they introduced workspaces (monorepo support) in npm 7 - it’s still easier to use the standard tooling in dev/ci/prod - lik…

I'm currently using yarn 1.17. Is the npm workspaces support on par with yarn 1? If so I might switch back to that.

Re: Hello Yarn 2, Goodbye node_modules

#143

Earlier quoted context omitted.

I think this is a bit much. Pip takes almost no time to set up and use. It ships with MacOS in fact.

As long as you only have pure python dependencies, pip is fine. Unfortunately, that's very uncommon for DS/ML python at least.

pip install numpy

pip install pandas

??

Re: Hello Yarn 2, Goodbye node_modules

#144
I moved our massive lerna monorepo to yarn v2 with PnP workspaces and cut 20 minutes off our CI time, deploy/build time (typescript) cut dramatically and reduced even our frontend bundle sizes thanks to the new and improved dedupe. It took all of maybe 10hrs but I've already made that back easily.

Also checking out branches and syncing takes all of 3s versus the massive link process we used to have to do.

Love yarnv2

Re: Hello Yarn 2, Goodbye node_modules

#145
post #80
post #61

Earlier quoted context omitted.

IMO, npm is a breeze compared to pip. With npm you know that `npm i && npm start` will start 95% of the projects cross-platform. It allows having different subdependencies versions in a way that just works. It encourages semver but at the same time you have lock file. Is highly customizable with rc files. Perhaps I just don't have that much experience with pip, but it feels more like a tool to install packages, then…

npm is one of the only dependency managers I’ve seen that does more than install packages. Every other package manager: pip, bundler, composer, all do one thing and do it well. npm does everything but nothing well.

Cargo from rust does more than npm and IMHO it does very well.

Re: Hello Yarn 2, Goodbye node_modules

#146

Earlier quoted context omitted.

As long as you only have pure python dependencies, pip is fine. Unfortunately, that's very uncommon for DS/ML python at least.

pip install numpy pip install pandas ??

I'm really really tired of explaining this, tbh.

The trouble is firstly that pip will happily install conflicting versions of numpy which breaks your code.

This occurs because pip didn't check dependencies until last year, which is one of the reasons it's a terrible package manager.

Now it just gets stuck spinning it's wheels for ages and then errors out, which is better but still not good.

Conda, while really slow actually handles c level dependencies which makes it usable.

Re: Hello Yarn 2, Goodbye node_modules

#147
post #83
post #80

Earlier quoted context omitted.

npm is one of the only dependency managers I’ve seen that does more than install packages. Every other package manager: pip, bundler, composer, all do one thing and do it well. npm does everything but nothing well.

Wow, bold statement. Can you give examples of things it does wrong?

`npm uninstall foo` simultaneously upgrades all the _other_ packages.

Experienced developers they are not.

Re: Hello Yarn 2, Goodbye node_modules

#148
post #117

Earlier quoted context omitted.

I can. In most ecosystems, I can share package sources between a VM and a host. npm shares mutable content (eg compiled artifacts) with package sources in `node_modules`. That breaks a ton of workflows that are common in other ecosystems. For instance, in ruby apps using bundler, I can commit my dependencies in vendor/cache; there are no network dependencies other than fetching the source code. That makes turning cod…

There's nothing stopping you from running `npm` or `yarn` offline and committing the cache. In fact, both of these package managers have had direct support for this workflow since 2016 ( https://docs.npmjs.com/cli/v7/using-npm/config#offline ) and 2017 ( https://classic.yarnpkg.com/blog/2016/11/24/offline-mirror/ ) respectively.

Except that the format of the npm cache is version-specific. You would probably be better off using https://github.com/heikkipora/registry-sync instead.

Re: Hello Yarn 2, Goodbye node_modules

#149
post #12

Yarn 3.0 was released in July 2021 ( https://dev.to/arcanis/yarn-3-0-performances-esbuild-better-... ) Meanwhile, as much as I respect the work of Mael (yarn maintainer) I’ve switched back to npm. Mostly because: - isaacs (original creator of npm) did some commits lately - now backed by GitHub - they introduced workspaces (monorepo support) in npm 7 - it’s still easier to use the standard tooling in dev/ci/prod - lik…

`resolutions` is what I wanna see in NPM

Re: Hello Yarn 2, Goodbye node_modules

#150

Earlier quoted context omitted.

pip install numpy pip install pandas ??

I'm really really tired of explaining this, tbh. The trouble is firstly that pip will happily install conflicting versions of numpy which breaks your code. This occurs because pip didn't check dependencies until last year, which is one of the reasons it's a terrible package manager. Now it just gets stuck spinning it's wheels for ages and then errors out, which is better but still not good. Conda, while really slow a…

> I'm really really tired of explaining this, tbh.

So don't!

Post reply on HN