Yarn workspaces allow for easy monorepo management
Yarn has upgrade-interactive. NPM has a separate package for that.
Writing a wrapper around fetch to support the basic use cases takes ~50 LOCs and saves you a couple of KBs from Axios
You're right. But writing those 50 LOC for every project may seem like a waste of time (of course there are still cases when it is better choice). I could make a module from it, but why would I create another Axios? I never needed to use interceptors, I'm using Axios because the API is nice and it offers pretty features out of the box.
I'd imagine that you still abstract away data fetching from your React Components using Mobx async actions
Yarn is much faster
Yarn workspaces allow for easy monorepo management
Yarn has upgrade-interactive. NPM has a separate package for that.
Can you link me to the benchmarks? Much of the posts that I find says that they're par on speed. Just now I tried both a cold install and a warm install inside a Docker container and got these results:
Note that for CI environments, npm has npm ci which install the dependencies 3 times faster. I didn't find a yarn equivalent.
About monorepos and upgrade-interactive: I don't use monorepos and I update dependencies like once in a month, so I don't actually mind those features. Like you said there's a separate package for both features so you can do:
Easy to be fast with cache when Yarn cache litterally everything (every month I needed to remove 80GB of data from Yarn cache when i was using it)
By the way npm ci is what you use normally when you're not locally developing on the package so every installation aside your local install is 3x faster.
For mono repo, there's lerna which you can use via npx
Log in to continue
We're a place where coders share, stay up-to-date and grow their careers.
Hi, thanks for your input
I disagree:
upgrade-interactive
. NPM has a separate package for that.You're right. But writing those 50 LOC for every project may seem like a waste of time (of course there are still cases when it is better choice). I could make a module from it, but why would I create another Axios? I never needed to use interceptors, I'm using Axios because the API is nice and it offers pretty features out of the box.
Yes, of course :-)
Can you link me to the benchmarks? Much of the posts that I find says that they're par on speed. Just now I tried both a cold install and a warm install inside a Docker container and got these results:
Note that for CI environments, npm has
npm ci
which install the dependencies 3 times faster. I didn't find a yarn equivalent.About monorepos and
upgrade-interactive
: I don't use monorepos and I update dependencies like once in a month, so I don't actually mind those features. Like you said there's a separate package for both features so you can do:There's no
npx
equivalent on Yarn.Some recent benchmarks are here. They're on par most of the time, but Yarn is pretty fast with cache and lockfile.
Easy to be fast with cache when Yarn cache litterally everything (every month I needed to remove 80GB of data from Yarn cache when i was using it)
By the way npm ci is what you use normally when you're not locally developing on the package so every installation aside your local install is 3x faster.
For mono repo, there's lerna which you can use via
npx