DEV Community

Cover image for Is JavaScript Dead?
Bas Steins
Bas Steins

Posted on • Originally published at open.substack.com

Is JavaScript Dead?

🕸️ JavaScript is Dead, Long Live TypeScript

Big news for Node.js developers: as of July 2024, Node.js has introduced native support for TypeScript, signalling a shift that might eventually make JavaScript a thing of the past for many. If you've ever been frustrated by the hoops you had to jump through to configure TypeScript in Node.js, you're not alone. While still experimental, this new feature allows TypeScript to be used directly in Node.js without the usual setup hassles.

The initial implementation is simple — Node.js will strip away TypeScript's type annotations at runtime without transforming the code, similar to what Deno and Bun are already doing. This means that while you can now run TypeScript code in Node.js, some features like enums or namespaces won’t work just yet. It's an early-stage development, but it’s a step in the right direction.

This type-stripping feature is powered by the @swc/wasm-typescript module, which uses WebAssembly to handle TypeScript parsing quickly and efficiently. While there are still some limitations — such as needing to name files with a .ts extension and the lack of support for TypeScript in node modules — these are expected to be addressed in future updates.

Looking ahead, the Node.js team plans to decouple type-stripping from specific Node.js versions, allowing for more flexibility and updates independent of Node.js releases. This could eventually lead to full support for TypeScript features and better integration with tools like tsconfig.json.

While there’s reason to be cautiously optimistic, it's still early days. The Node.js team has set an ambitious roadmap, but only time will tell how quickly these features will be fully realized. For now, it’s exciting to see Node.js catching up to the likes of Deno and Bun, bringing much-needed innovation back to the platform.

Published on Bas' Take on Tech

Top comments (7)

Collapse
 
mathiewz profile image
mathiewz

As far as I know web browsers can't execute typescript anyway. While it's true, javascript will never die.

Collapse
 
tombohub profile image
tombohub

point is to clickbait with bombastic title and lead people to the blog so you can subscribe there and receive newsletters with promo material inside, maybe courses

Collapse
 
tombohub profile image
tombohub

Are we dead?

Collapse
 
kooiinc profile image
KooiInc

I hope to any god available JS/ES20xx is not dead. Who needs typescript anyway?

Collapse
 
eshimischi profile image
eshimischi • Edited

Typescript is JS anyway. Transpilation is available in Deno, Bun as well, so what’s the point of this article?

Collapse
 
alefeufei profile image
Alexandre Lima

Também gostaria de saber qual o objetivo do artigo, foi pra pregar o apocalipse?

Collapse
 
efpage profile image
Eckehard

Oh, type-stripping is a clever way to get the worst of both worlds: You get the disadvantages of Typescript along with the disadvantages of Javascript. Great solution!