TypeScript support in modern browsers TypeScript support in modern browsers typescript typescript

TypeScript support in modern browsers


Native support

Native support can be added quite easily e.g. https://github.com/basarat/typescript-script adds support for script tags (although this adds 6MB of supporting JS to a page). However there is a performance hit in compiling TypeScript to JavaScript and for the best performance it is best to precompile and execute the compiled JavaScript in the browsers.

Browser vendors have no plans to add native TypeScript support. The only native languages common across browsers are JavaScript and WebAssembly. TypeScript can be transpiled to either and run in the browsers so its not a blocker.

Not-native support

What is the status of TypeScript support by the modern browsers ?

Typescript compiles to JS so it's supported by all browsers (even IE6)

What are the positions of the major browser vendors for the future support of TypeScript ?

No work is needed on behalf of browser vendors.

What is the relation between TypeScript and ECMAScript6 and does TypeScript provide much more features than ECMAScript6 ?

Yes e.g. from future javascript versions e.g. class fields and static properties in classes.


Trying to design a web browser that could natively support more than one language at a time is exactly what Google tried to do with Dart. There was a Dart engine planned for Chrome but this ended up being too big a task with very little benefit aside from "just not using java script".

I suspect supporting Typescript natively would be an equally daunting task. Probably better to just improve upon ECMAScript and add in a few TS ideas where they make sense. I do love TS though.


Typescript cannot be run or understood in any browser. So, Typescript is compiled to Javascript (which browsers can understand). Typescript can use all ES6 features and during the compilation they will be converted to Target compile options like ES5.