It is some distance likely to cease TypeScript files by environment the experimental flag --experimental-strip-sorts
.
Node.js will transpile TypeScript source code into JavaScript source code.
In each place in the transpilation direction of, no form checking is performed, and sorts are discarded.
Roadmap
Refs: nodejs/loaders#217
Motivation
I order enabling users to cease TypeScript files is obligatory to switch the ecosystem forward, it has been requested on the total surveys, and it simply can no longer be neglected. We must acknowledge users deserve to high-tail node foo.ts
without installing external dependencies or loaders.
There may well be a TC39 proposal for form annotations
Why form stripping
Kind stripping as the title imply, approach striking off the total sorts
, transform the input in a JavaScript module.
const foo: string = "foo";
Turns into:
Quite a lot of runtimes also manufacture transformation of some TypeScript handiest points into JavaScript, to illustrate enums, which attain no longer exists in JavaScript.
No longer decrease than at the origin in this PR no trasformation is performed, which approach that using Enum
, namespaces
etc… may well possibly well no longer be imaginable.
Why I chose @swc/wasm-typescript
Thanks to simplicity.
I possess idea of various tools but they require either rust or dash to be added to the toolchain.
@swc/wasm-typescript
its a puny kit with a wasm and a js file to bind it.
Swc is currently frail by Deno for the identical reason, it’s fight tested.
Within the slay I look this being applied in native layer.
Huge shoutout to @kdy1 for releasing a swc version for us.
module.md
for implementation info and barriers.