Hacker News new | ask | show | jobs
by capableweb 1684 days ago
No, it never did, Deno always have converted TypeScript into JavaScript that then gets read and executed by the browser, at least according to their own docs but maybe that has changed lately?

> At a high level, Deno converts TypeScript (as well as TSX and JSX) into JavaScript. It does this via a combination of the TypeScript compiler, which we build into Deno, and a Rust library called swc. When the code has been type checked and transformed, it is stored in a cache, ready for the next run without the need to convert it from its source to JavaScript again.

https://deno.land/manual/typescript/overview

1 comments

My answer wasn’t explicit enough. To clarify, I meant as a user of deno you do not need to perform any separate transpilation or build step. The runtime can read and execute typescript natively (again, from user perspective).

>Deno can run JavaScript or TypeScript out of the box with no additional tools or config required.

- https://deno.land/manual@v1.15.3/examples/hello_world

>Deno is a runtime for JavaScript/TypeScript which tries to be web compatible and use modern features wherever possible.

- https://deno.land/manual@v1.15.3/getting_started/first_steps

You can run any of their examples to see that `deno run` commands can execute typescript without requiring a separate transpilation step

Yeah, I guess if someone asks "does Deno translate TS to JS before executing it?" and someone answers "Yes, it could always do this", it's not hard for the answer to be understood as "Deno doesn't translate TS before running it".

No hard feelings though, context is important and many of us miss it at times :)