Hacker News new | ask | show | jobs
by jsmith45 1293 days ago
For the most part typescript does not significantly change what you input (except, of course, by stripping type annotations, type declaration, and type imports) unless you request transpilation to earlier ECMAScript versions or a different module format. (It will also by default transform TSX to ECMAScript, but it can be configured to output as JSX instead, which could later the handled by a different JSX transpiler if needed.)

The main exceptions are enums, and decorators, both of which perform straightforward transformations. My understanding is that adding new such features are forbidden as the TypeScript team considers them to be historical mistakes. If new syntax is added in the future is should be such that it can be mechanically stripped, leaving the obvious underlying JS behind.

There also exist some historical features like namespaces or const enums that have long been considered essentially deprecated by the team (not marked as such in the documentation, as there are no plans to actually delete support for them, but they won't work correctly in isolatedModules mode for example). In practice those features are not used in new codebases since project templates will be configured with isolatedModules enabled.