10 comments

[ 3.8 ms ] story [ 24.9 ms ] thread
This is great to finally see get added. I wonder why they decided to build their own type stripper instead of just bundling tsc/swc. It feels like Node.js is going to be plagued with bugs whenever TypeScript adds new type constructs, which may take months to get patched.
Whilst I use an esbuild based build pipeline to produce production artifacts, I've found that the combination of native type transformation and node:test improvements is now sufficient to do away with most test frameworks.

My nodejs projects have tests that run faster and have fewer breaking dependencies.

The two things I have to do are to always annotate type imports with type (I have a script for that), and to use file extensions on imports.

There's an ESLint rule with autofixes for that (annotating type imports) One for extension should exist somewhere too
I don't mean this rhetorically, but what are the benefits of using node over something like deno now? It has been so long since I lived in the node ecosystem. I imagine it has gotten quite a bit better. Is the main benefit just ecosystem/compatibility stuff? Deno sometimes has some odd compatibility issues, but not often. The low-overhead, sane defaults, just-build kind of nature of it has become very appealing to me. Being able to build CLIs in portable binaries using a language my coworkers understand is really nice (despite that they're like 60mb, haha). I prefer Go personally, but ultimately prefer being able to collaborate.
I honestly wish Microsoft and TypeScript enthusiasts would transform it into an official standalone language and stop polluting the JavaScript ecosystem.

Like C++, it could be a true superset of JS, importing JS code freely into TypeScript projects. It would also allow TypeScript to do whatever it wanted and not have to worry about transpilation. If it needs to work in the browser, it can be bundled into web assembly.

Wake me up when it gets as good as running tsx aka support for path aliases in dev and test environments and support for watch mode
Does this mean we can finally drop `typescript` dependency from build chain?
So if you use this, what do you use to enforce the types? Are you still running tsc --noEmit?

I'm embarking on a project where the various tsconfig files are getting quite unwieldy. I'd have already jumped to Deno but it just won't work right when the actual deployment is to Cloudflare Workers.