Hacker News new | ask | show | jobs
by buu700 3064 days ago
TypeScript itself doesn't really add new language features; it just tracks the ECMAScript spec and considers proposed features for implementation after they hit stage 3.

The enhancements coming out in new TypeScript releases are largely related to typing expressiveness / type inference precision (covering more edge cases where one might have previously resorted to `any`) and strictness (catching more errors at compile time).

1 comments

Indeed, the only Typescript feature I can think of that isn't purely for type checking or lifted from ECMAScript is Enums, and Enums have been around forever.
Well it has supports for JSX and decorators which AFAIK aren't in the spec yet. It also has a syntax for class mixins without actually doing any desugaring when the code is transpiled. So it's not quite just JS + types.
Ah, I forgot about those. Nonetheless JSX and Decorators were added to the language back in 2015, so they've been sticking strictly to ECMA features for nearly 3 years now.
It has public, private and protected members (checked at compile-time), which is a bit of a mess because ES is gaining an independent notion of private fields (checked at runtime).