4 ms·
I can give a bit of perspective here. I'm currently porting our the Vanilla Forums frontend (~500k lines of typescript) from using Node, Yarn (we used it back b
by charrondev 3y ago
I can give a bit of perspective here.
I'm currently porting our the Vanilla Forums frontend (~500k lines of typescript) from using Node, Yarn (we used it back before npm supported lockfiles) and Webpack, to build with bun and Vite.
There are a few notable differences:
- The out of the box typescript interoperability is actually very nice, and much faster than using `ts-node` as we were before.
- Installations (although rare) are a fair bit faster.
- With bun I don't have to do the frankly crazy song and dance that node now requires for ES modules.
- Using bun is allowing us to drop `jest` and related packages as a dependency entirely and it executes our test suite a lot faster than jest did.
For my personal projects I now reach for bun rather than node because
- It has Typescript support out of the box.
- It has a nice test runner out of the box.
- It has much runtime compatibility with browsers (`fetch` is a good example).
- The built-in web server is sufficient for small projects and avoids the need to pull in various dependencies.
- fastball 3y agoFYI if you want to make a list on HN you're gonna need to add an extra line break everywhere.
- afavour 3y agoESM interop is inarguable. But these days Node has a test runner and compatibility with browsers (it implements fetch)… I guess I feel like Node is likely to catch up with most of this stuff over the lifetime of any long running project.
- fastball 3y agoSure, but node also has a huge amount of baggage and as others have pointed out is much slower.
- charrondev 3y agoOne of things that makes me more bullish on bun rather than Deno is that bun is intentionally aiming for compatibility with node and the npm ecosystem while Deno doesn't seem to be.
- 1123581321 3y agoHow is the Bun test runner’s compatibility with Jest’s methods? Can a mature test suite be easily ported? We are currently looking at vite and vitest to run 1600 jest tests.
- afturner 3y agoYou can track the progress here: https://github.com/oven-sh/bun/issues/1825 https://github.com/oven-sh/bun/issues/1825 There's still a ways to go but folks are actively contributing.
- triyambakam 3y agoBun test is so enjoyably faster than Jest. I have a file of thousands of string manipulation tests that Jest just crashes on after 3 minutes while Bun runs in in milliseconds.
- briantakita 3y ago> - The built-in web server is sufficient for small projects and avoids the need to pull in various dependencies. ElysiaJS is a good library when you do need a bit more with the routing + middleware. It has great benchmarks as well.
- pjmlp 3y agoMy old dog experience has proven multiple times that staying with the main reference tool for the platform always pays out long term, as most forks or guest languages eventually fade out after the hype cycle is over. The existing tools eventually get the features that actually matter, and I avoided rewriting stuff twice, on the meantime I gladly help some of those projects to backport into the reference tooling for the platform. The only place I really haven't followed this approach was in regards to C++ in UNIX, which at first sight might feel I am contradicting myself, however many tend to forget C++ was born at Bell Labs, on the same building as UNIX folks were on, and CFront tooling was symbiotic with UNIX.
- yurishimo 3y agoYepp! There is absolutely no reason to upgrade early. If it becomes the reference tool one day, then it should be easy to switch. But you also have to remember this is JS we’re talking about… stuff changes every 10 minutes.
- nsonha 3y agoDoesnt node have a built-in test runner too these days?