Live data from Hacker News

Vite+ Beta

voidzero.dev

101–110 of 163 posts

Re: Vite+ Beta

#102

I am a big fan of Vite. But I have zero clue what those other tools are. I swear to God, I just put my head down to do some work and all the sudden, frontend tooling has evolved. I wonder if there is a push towards a "boring but works" stack.

[deleted]

Re: Vite+ Beta

#103

I am a big fan of Vite. But I have zero clue what those other tools are. I swear to God, I just put my head down to do some work and all the sudden, frontend tooling has evolved. I wonder if there is a push towards a "boring but works" stack.

I’ve bounced off Vite because I don’t see a big advantage over esbuild. (I also use Deno.) What do you find useful?

Re: Vite+ Beta

#104
post #90

Earlier quoted context omitted.

I 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).

I was excited about Oxfmt until I tried it and found that it's mostly intended to be a Prettier replacement. Ugh.

I'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?

Re: Vite+ Beta

#105
post #97

Earlier quoted context omitted.

> 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 compatibilit…

I 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?

> 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".

Re: Vite+ Beta

#106
post #99

Earlier quoted context omitted.

No, because of ESM import resolution rules. Typescript suggests extensionless imports, making it incompartible with ESM and therefore Node. Luckly, `node --import=tsx file.ts` handles imports well. This is especially hairy when making a typescript library that is distributed non-compiled (without dist/) and is supposed to run in both browser and Node. https://github.com/nodejs/node/issues/46006 https://github.com/mic…

I transpile for prod, but use --strip-types when running in dev, and all I had to do was to make a 10-line ESM register hook that rewrites .js to .ts if the .js import fails, and then a one-liner import register trampoline script. Not sure I'd do that in prod, but works fine in dev at least. This way I could just use node --watch instead of tsx or nodemon.

Mind sharing the implementation? I think it's basically what tsx is doing when used in `node --import tsx`.

Re: Vite+ Beta

#107
post #35

Earlier quoted context omitted.

Deze vuist op deze vuist. Deze vuist op deze vuist. Deze vuist op deze vuist. En zo klim ik naar boven. You probably need to see a video or gif to get it.

Some barbarian without a grasp of the Dutch language knee-jerked the down-vote button so I'll add a Swedish version which adds an important attribute. Imse vimse spindel klättra upp för trå'n. Ner faller regnet, spolar spindeln bort. Upp stiger solen, torkar bort allt regn. Imse vimse spindel klättrar upp igen. Here's how to interpret this saga of the ever-climbing little spider in the context of web development. It…

the swedish song has an english version: https://en.wikipedia.org/wiki/Itsy_Bitsy_Spider

Re: Vite+ Beta

#108
post #97

Earlier quoted context omitted.

I 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?

At 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.

The 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

Re: Vite+ Beta

#109
post #97

Earlier quoted context omitted.

I 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?

At 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.

I 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: Vite+ Beta

#110

Layer on layer on layer on layer on layer.... Web development is just a meme by now

Don't be so negative nancy here! I have been doing "modern web" things since essentially day zero (you kids with your fancy JIT compiled javascript interpreters!) SvelteKit, and by extension, Vite, has been the single most productive webstack I have ever used. If this offers anything on top of that, I welcome it with open arms. Far from being a meme!

I use vp with sveltekit for my personal projects now, and I must say it's a very nice experience.
Post reply on HN