Live data from Hacker News

Node.js adds experimental support for TypeScript

github.com

21–30 of 570 posts

Re: Node.js adds experimental support for TypeScript

#21

It's about time for TC39 and Microsoft to standardize TypeScript as part of JavaScript. Not "types as comments" either, but actually TypeScript, minus the non-standard runtime semantics and modulo whatever changes are necessary to integrate the grammar. So many runtimes and tools are integrating TypeScript now, and with multiple implementations, that a real standard is necessary. It'll be much harder to evolve TypeSc…

TypeScript used to have a standard.

Years and years ago. Now it's whatever the compiler does.

Which to be fair, is evolving quite rapidly.

Re: Node.js adds experimental support for TypeScript

#22
post #5

So how does this work in practice? Does it strip types and yolo trying to run or will it spit out type errors?

If I understood correctly they use a wrapper around swc to strip types, without any type-check being performed.

Which makes perfect sense to start out with; as typechecking with tsc is rather slow and can easily be delegated to the consumer.

Re: Node.js adds experimental support for TypeScript

#23

It's about time for TC39 and Microsoft to standardize TypeScript as part of JavaScript. Not "types as comments" either, but actually TypeScript, minus the non-standard runtime semantics and modulo whatever changes are necessary to integrate the grammar. So many runtimes and tools are integrating TypeScript now, and with multiple implementations, that a real standard is necessary. It'll be much harder to evolve TypeSc…

its about time google chrome started making a typescript engine maybe? and get rid of JS in phases?

There are a few optimizations that types can use but 99% of applications wouldn't benefit from them anyways.

Re: Node.js adds experimental support for TypeScript

#25
post #20

It's about time for TC39 and Microsoft to standardize TypeScript as part of JavaScript. Not "types as comments" either, but actually TypeScript, minus the non-standard runtime semantics and modulo whatever changes are necessary to integrate the grammar. So many runtimes and tools are integrating TypeScript now, and with multiple implementations, that a real standard is necessary. It'll be much harder to evolve TypeSc…

This has been proposed for several years now, but there's been very little progress on it: https://github.com/tc39/proposal-type-annotations

That is "types as comments", not standardizing TypeScript.

Re: Node.js adds experimental support for TypeScript

#27

It's about time for TC39 and Microsoft to standardize TypeScript as part of JavaScript. Not "types as comments" either, but actually TypeScript, minus the non-standard runtime semantics and modulo whatever changes are necessary to integrate the grammar. So many runtimes and tools are integrating TypeScript now, and with multiple implementations, that a real standard is necessary. It'll be much harder to evolve TypeSc…

TypeScript used to have a standard. Years and years ago. Now it's whatever the compiler does. Which to be fair, is evolving quite rapidly.

Yeah, that was from 2016 or so. But a TypeScript spec is different than folding TypeScript into the ECMAScript standard. Some parts of TypeScript would have to be dropped or changed for that to work.

Re: Node.js adds experimental support for TypeScript

#28
I'm honestly giddy. This could be the (slow) beginning of a new era, where "JS with types" is finally a native thing.

I'm even willing to forgive all the mess that CJS vs. ESM is if they manage to pull this off.

I hope this sees widespread adoption/usage, which might finally cause some movement to integrate TS into ecmascript after all. Some dynamically-typed language fanatics (which are, in my opinion, completely detached from the reality that static types are what the vast majority of devs want) still have an iron grip on TC39, this might be the start of their end. And good riddance.

Re: Node.js adds experimental support for TypeScript

#29

It's about time for TC39 and Microsoft to standardize TypeScript as part of JavaScript. Not "types as comments" either, but actually TypeScript, minus the non-standard runtime semantics and modulo whatever changes are necessary to integrate the grammar. So many runtimes and tools are integrating TypeScript now, and with multiple implementations, that a real standard is necessary. It'll be much harder to evolve TypeSc…

i’m not sure i buy the “company floods the industry with broken tooling and deserves to be standardized” narrative.

yeah, the ecosystem sucks, but rewarding the system incentivized to co-opt the system will actually make things worse in the long run, not better.

for example, internet explorer failed why?

Re: Node.js adds experimental support for TypeScript

#30

Bun’s DX is pretty unprecedented in this space, and most of my use cases are now covered / not causing Bun to crash (when actually using run-scripts with `bun run`). Meanwhile, I can’t configure node to not require extensions on import, nor have tsc configured to automatically add .js extensions to its compiled output, without adding on a bundler… although native TypeScript support would remedy this nit quite a bit,…

Extensions should be required. It's not possible to do path searches over the network like you can on local disk, and network-attached VMs, like browsers, are a very, very important runtime for JavaScript.
Post reply on HN