Better HN
topnewbestaskshowjobs
Log inSign up

satanacchio

75 karma · joined May 16, 2023 (3y ago) · 11 submissions

Submissions

comment 1y ago · link · parent

The flag --experimental-strip-types has been enabled by default. Only syntax that dont require transformation is allowed. Syntax that require transformation are enum, namespaces (namespaces containing types only are allowed) and legacy modules.You need to pass the flag --experimental-transform-types to enable it. Decorators will soon be supported by V8 since they are a stage 3 proposal. We decided not to polyfill it but to wait the V8 relase.

comment 1y ago · link · parent

Hi I'm the author of this feature, I'll answer to questions.

comment 1y ago · link · parent

Node.js enables --experimental-strip-types by default

comment 2y ago · link · parent

The first reason is because if we supported ts features that require transformation (such as enume) we would also need to support sourcemaps, so in the first iteration I decided not to, to avoid being overwhelmed. Right now we replace inline types with whitespace, so locations are preserved. We plan to add those features, probably behind a flag at the beginning. We need to move in small steps and think very carefully, every decision could make a huge impact on the ecosystem so I decided to start with the smalled subset possible.

comment 2y ago · link · parent

yes but can also be upgraded separately as npm package

comment 2y ago · link · parent

We dont support running .ts files in node_modules, this is one of the main constraints to avoid breaking the ecosystem

comment 2y ago · link · parent

this is the roadmap https://github.com/nodejs/loaders/issues/217. We talked with the typescript team and we will give each other continous feedback on the progression. We made sure to take some precautions in order to avoid breaking the ecosystem. I still think in production, js is the way to go, so users should always transpile their ts files.

comment 2y ago · link · parent

I made it sure to decouple the transpiler from node itself, the transpiler is in a npm package called amaro, that is bundled in node. The goal is to allow user to upgrade amaro indipendently so we dont have to lock a ts version for the whole lifespan of a release

comment 2y ago · link · parent

Hi I'm the author of the PR, AMA