5 ms·
> But I have zero clue what those other tools are. The incorporated tools are actually really amazing: - vitest, an ultra fast test runner. After using a lot
by bhouston 4mo ago
> But I have zero clue what those other tools are.
The incorporated tools are actually really amazing:
- vitest, an ultra fast test runner. After using a lot of others, including jest and node's built in one, I love vitest.
- oxlint, replaces eslint but is compatible with its file format and ultra fast, since it isn't written JavaScript. I tried biome, but I found oxlint to have more rules and the eslint compatibility was nice.
- oxfmt, replaces prettier and is faster since it isn't written in JavaScript.
- rolldown, replaces rollup and is compatible with it but it is much faster since it isn't written in JavaScript.
The above are my go-tos in new projects anyhow since they are killer good and fast.
- herpdyderp 4mo agoI wish Oxfmt supported plugins. Prettier's plugin API is one of the worst APIs I've ever worked with. I'm eager to switch to a different formatter with a better plugin API (and I need plugins).
- pier25 4mo agoI was excited about Oxfmt until I tried it and found that it's mostly intended to be a Prettier replacement. Ugh.
- notdefio 4mo agoI'm curious to know what you were hoping for. Are there features you're looking for in a formatter that prettier/oxfmt don't offer?
- pier25 4mo agoI was hoping for something more flexible. I suppose the whole point of Prettier is that it's not flexible but I find 90% of the times the code is actually uglier when using it.
- satvikpendem 4mo agoTry Biome then. But Oxfmt is still faster.
- bhouston 4mo agoHave you tried contributing a system for that?
- hokkos 4mo agobeing worked on : https://github.com/oxc-project/oxc/discussions/21936 https://github.com/oxc-project/oxc/discussions/21936
- pier25 4mo agoRolldown is used in Vite (non plus) though.
- mort96 4mo agoI don't get how a test runner can be "ultra fast". Surely all the time is taken by the tests, not calling the test functions?
- andrewingram 4mo agoAt work we've tried switching to vitest, and it's 1.5-2x slower than Jest (I think it's related to our very large and circular module graph), so performance is very much a your-mileage-may-vary thing.
- streptomycin 4mo agoThe initial selling point was performance, but then they gradually realized that a lot of the slow cruft in Jest was necessary for correctness, and now it's about the same performance as Jest (obviously may vary in some specific situation). However vitest is still great! Selling points now are stuff like: - shares config with vite - works with ESM out of the box (I think Jest still doesn't) - integrated browser testing mode that is very nice - overall just has a ton of nicely integrated features
- bhouston 4mo agoI do recommend turning off "isolate" for as much of your code base as possible when it makes sense. And I recommend ensuring "maxWorkers" is being used properly, I prefer something like 60% of my totals cores as the number of workers to use. And use a top level vitest start so it properly runs all the packages in a pipeline rather than as separate vitest runs (which would mess up the maxWorkers optimization anyhow.) I have my 3000 test project suite completing in 15 seconds on my MacBook Air M3. It is pretty sweet with that setup.
- re-thc 4mo ago> Surely all the time is taken by the tests, not calling the test functions? Calling tests has overhead. Also knowing how to schedule and parallelize tests with dependencies is not as "simple".
- sunaookami 4mo ago