Remember ESM fiasco? Now we have a few years of that all over again, this time with different versions of TypeScript, settings, and tsgo. Good news!
Node.js is able to execute TypeScript files without additional configuration
81–90 of 275 posts
Re: Node.js is able to execute TypeScript files without additional configuration
#82Re: Node.js is able to execute TypeScript files without additional configuration
#83Re: Node.js is able to execute TypeScript files without additional configuration
#84I think this + node:test makes Node.js a pretty compelling sensible default for most things now. Running things with `tsx` was such a QoL improvement when it happened, but it didn't solve everything. Runtime type assertion at the edges is mostly solved through `zod` and tools like `ts-rest` and `trpc` makes it so much easier to do full-stack Typescript these days.
trpc and ts-rest are a different animal in my opinion. I'm happy to use either one but won't deal with them in production. For trpc that's mainly due to the lack of owning API URLs and being able to more clearly manage deprecating old URLs gracefully.
For ts-rest I just tend to prefer owning that setup myself, usually with zod and shared typings for API request/response pairs. It also does irk me every time I import what is clearly an RPC tool named "-rest"
Re: Node.js is able to execute TypeScript files without additional configuration
#85Re: Node.js is able to execute TypeScript files without additional configuration
#86Earlier quoted context omitted.
> TypeScript is more like a linter that's exactly the point--GP is pointing out that node can't do that part
Which is why the title is "Node can now execute Typescript files" and not lint, check, or even run TypeScript files.
Re: Node.js is able to execute TypeScript files without additional configuration
#87Re: Node.js is able to execute TypeScript files without additional configuration
#88Re: Node.js is able to execute TypeScript files without additional configuration
#89Earlier quoted context omitted.
Have them though? On the projects I am involved, they could even not exist, only node LTS releases matter, and the most recent projects are still node 20.
22 is LTS. The future is now.
Re: Node.js is able to execute TypeScript files without additional configuration
#90What backend framework is the go to these days? Still Express?
Fastify, NestJS (bleh), Koa, Hono are the modern replacements for express, none of them have caught on as a standard though. My personal favorite for small projects is Polka (https://github.com/lukeed/polka), when I'm not using Go instead.