A document surfaced today pointing that Deno will stop using TypeScript in its internal code, citing several problems with the current environment. Issues mentioned involve TypeScript compiling times, structuring and code organization, among others. Moving forward, Deno will use pure JavaScript for its internal code.
The unfavorable situations that the Deno team is currently experiencing while using TypeScript for its internal code are:
The Deno team aims to remove all build-time TS type checking and bundling for internal Deno code. They’re looking forward to move all the runtime code into a single JavaScript file. However, they’ll still use a companion d.ts file to keep the type definitions and documentation.
It’s worth mentioning that Deno will stop using TypeScript only for the internal Deno code: the Deno user code will still be in TypeScript and thus type checked.
While TypeScript is sometimes seen as an improved version of JavaScript, this case is showing that in fact, it’s not. It has flaws like any other language. One of the most important ones is its slow compilation time. While small projects might not see a huge spike in compilation time when switching from pure JavaScript to TypeScript, it will be noticeable in large projects like a complex React app. Given the large size of its runtime, it’s not surprising that Deno will stop using TypeScript.
The safety of type checking during development does have its cost at compilation time. It’s not without reason that the TypeScript project has an extensive document on how to address and improve compilation time. One of the most interesting approaches is to use Project References, that allows developers to break apart a big TypeScript piece of code into smaller pieces.
#javascript #deno #typescript