Deno: Supports TypeScript while also browser compatible?

Created on 18 Jan 2019  路  3Comments  路  Source: denoland/deno

"Supports TypeScript out of the box."
and
"Aims to be browser compatible."

seem mutually exclusive, or am I missing something? How can deno support TypeScript out of the box, but also be browser compatible? Or is the compatibility in one direction (i.e. it supports everything the browser does but not the other way 'round)?

It might be worth clarifying this in the docs maybe?

Most helpful comment

Browser compatible means that where we overlap in functionality with the browser, EG fetch() that we use the browser APIs. There are many things you can do in deno that will not run in the web browser - typescript is one of them - starting a TCP server is another. But if you use javascript and don't import the built-in "deno" module, the script should be browser compatible.

All 3 comments

Browser compatible means that where we overlap in functionality with the browser, EG fetch() that we use the browser APIs. There are many things you can do in deno that will not run in the web browser - typescript is one of them - starting a TCP server is another. But if you use javascript and don't import the built-in "deno" module, the script should be browser compatible.

Thanks for the clarification!

@davidbarratt There are projects like:

that allow you to use TS directly in <script> tags in the browser.
(Not that it's efficient but it's possible.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ry picture ry  路  3Comments

ry picture ry  路  3Comments

JosephAkayesi picture JosephAkayesi  路  3Comments

benjamingr picture benjamingr  路  3Comments

kitsonk picture kitsonk  路  3Comments