logoalt Hacker News

curtisblainetoday at 12:20 PM4 repliesview on HN

Don't we have `tsx` and `nodemon` (or the native Node reloader) for that? What are the DX gaps you see on the server side out of on-the-fly transpilation and reload on watch?


Replies

ivanjermakovtoday at 12:50 PM

Yes, I use tsx for Node programs. It's not great when sharing the same codebase for both client and server code, they have completely different dev workflows.

afavourtoday at 12:26 PM

One advantage of precompilation is risk reduction. Say tsx gets hacked somehow (hardly unprecedented with Node modules!) you’ve got it running on your production server exposed to the internet. Precompilation on a CI pipeline is still a risk but a significantly lower one.

show 1 reply
Cthulhu_today at 12:40 PM

In theory, typescript doesn't need to be transpiled, you can run ts files using `node --experimental-strip-types file.ts` as long as you don't use any code that needs transpilation (like typescript enums).

Still need tsx to do type checking

show 1 reply
curtisblainetoday at 12:28 PM

@afavour if you need precompilation in CI can't you simply use... tsc?