top | item 30618844

(no title)

Gaelan | 4 years ago

This is essentially doing that—it would allow browsers to parse and run TypeScript. What it isn't doing is actually having browsers do type checking, for good reason: the TypeScript type checker is a large and complex piece of software, so browsers would either have to incorporate it (and they're probably not excited to have a large chunk of JS code in the critical web-page-rendering path, nor would they be excited to have a critical chunk of the browser with a single implementation), or reimplement it themselves (which would be a huge amount of work, and make changes to the language much slower and more difficult).

discuss

order

adamddev1|4 years ago

Ya this seems like an awesome idea. Let devs run the type checking before they ship code, and then let the browsers run the code just as they would plain JavaScript, ignoring the types. If someone's going to use TypeScript they would be tye checking it first anyway, so no real need to check it again at the browser.