Skip to content

Conversation

@marco-ippolito
Copy link
Member

@marco-ippolito marco-ippolito commented Nov 6, 2025

Refs: nodejs/typescript#24
It's been a while and there are no outstading issues.
The only issue so far is #59364 but it's really not about Node, but the ecosystem around ts-node to adapt to it.
Node v22 and v24 have enough download that I can confidently say that it's safe to mark this feature stable.

Screenshot 2025-11-05 at 17 43 13

transform-types will stay experimental for now

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/loaders
  • @nodejs/startup
  • @nodejs/test_runner
  • @nodejs/tsc
  • @nodejs/typescript

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Nov 6, 2025
@marco-ippolito marco-ippolito force-pushed the mark-type-stripping-stable branch from 4b39f3b to 8170b1b Compare November 6, 2025 09:33
@marco-ippolito marco-ippolito marked this pull request as ready for review November 6, 2025 09:38
@marco-ippolito marco-ippolito added the strip-types Issues or PRs related to strip-types support label Nov 6, 2025
@marco-ippolito marco-ippolito force-pushed the mark-type-stripping-stable branch from 8170b1b to f34b2a8 Compare November 6, 2025 09:47
@marco-ippolito marco-ippolito added the dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. label Nov 6, 2025
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.56%. Comparing base (b4b1413) to head (f34b2a8).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/process/execution.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60600      +/-   ##
==========================================
- Coverage   88.56%   88.56%   -0.01%     
==========================================
  Files         704      704              
  Lines      208077   208088      +11     
  Branches    40084    40083       -1     
==========================================
- Hits       184289   184283       -6     
- Misses      15826    15831       +5     
- Partials     7962     7974      +12     
Files with missing lines Coverage Δ
lib/internal/bootstrap/node.js 99.58% <100.00%> (ø)
lib/internal/main/eval_stdin.js 82.45% <100.00%> (ø)
lib/internal/main/eval_string.js 79.48% <100.00%> (ø)
lib/internal/main/worker_thread.js 94.35% <100.00%> (ø)
lib/internal/modules/cjs/loader.js 97.97% <100.00%> (ø)
lib/internal/modules/esm/formats.js 98.57% <100.00%> (ø)
lib/internal/modules/esm/get_format.js 93.15% <100.00%> (ø)
lib/internal/modules/run_main.js 97.64% <100.00%> (ø)
lib/internal/test_runner/utils.js 61.27% <100.00%> (ø)
src/node_options.cc 77.85% <100.00%> (+0.12%) ⬆️
... and 2 more

... and 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Disables the family autoselection algorithm unless connection options explicitly
enables it.

### `--no-strip-types`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the goal is to keep a stable, long-term flag to disable type stripping? Is this something that users want?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a long term goal in the sense I wish there was no need to disable it, but given the ecosystem monkeypatches internal etc and some packages break... it's necessary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the disabling flag as experimental? I don't think we gain anything from migrating that to stable, even though we don't forsee getting rid of it just yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean rename it --no-strip-types but keep it experimental?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the thing, I wouldn't rename it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want type stripping to be stable, it should feel weird to disable it. Keeping the experimental in the flag does a good job at that – albeit the word order is a bit off, but IMO that's acceptable. I'm not against adding the alias without experimental in the name, I don't think it sends the right signal is all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda agree with your point of view, the fact that can be disabled it's not something we want to drag for too long and the flag is there only for people who probably are using some library that does some monkeypatching or wrong assumption and it breaks. We have to temporarly provide users a way to disabled, we will eventually get rid of it. So --no-experimental-strip-types stays but at the same time it feels weird to call it experimental, since we mark it as stable. Whats unstable is the way to disable it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggested approach is to remove experimental from the name, and in a future semver major, make it a no-op

Copy link
Member

@joyeecheung joyeecheung Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to drop the experimental prefix but I am -1 to make it a no-op in the future. That would leave no room for people getting broken to run their code on newer versions of Node.js (I don't think it's just ts-node, the other day I was running the tests of tsx and on 22 there was a regression from 20 that would go away if I disable type stripping).

I don't think having disabling option is weird for a stable feature, we have many disabling flags in Node.js for stable features. Bugs and gotchas happen and people need them to work around whatever issues their setup has with the default behavior. That's fine, the default may work for 99% of the people but there can always be 1% that really have to disable it to be able to run their code at all. For example some time ago I added --disable-wasm-trap-handler because in some environments, the WASM trap handler would make it impossible to run WASM at all. But WASM trap-based bound checks should still be considered stable and perfectly fine to use to provide significant speed up for WASM code. Its design just unfortunately doesn't work in certain niche environments and people have to accept the slowdown for keeping their app functional at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a future semver major, make it a no-op

If you meant "make --strip-types a no-op, then sure that can be discussed; if you mean "make --no-strip-types a no-op, that would be quite weird, it's not how we usually handles such flags (e.g. --experimental-top-level-await is still accepted, --no-experimental-top-level-await throws).

+1 to drop the experimental prefix

But we're not dropping the experimental one, we're adding a new flag that has the same effect, so now we have two.
Anyway, either way is fine, it's not like the additional flag would be a maintenance burden, and I don't feel strongly about the name.

@RafaelGSS RafaelGSS added the notable-change PRs with changes that should be highlighted in changelogs. label Nov 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @RafaelGSS.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section.

@RafaelGSS RafaelGSS added the semver-minor PRs that contain new features and should be released in the next minor version. label Nov 6, 2025
@marco-ippolito marco-ippolito added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Nov 6, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 6, 2025
@nodejs-github-bot
Copy link
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/70070/

##### Goal

The goal is to raise awareness of the Node.js TypeScript Type Stripping in the JavaScript ecosystem.
The goal is to raise awareness of the Node.js TypeScript Type stripping in the JavaScript ecosystem.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Why capitalise "Type" but not "stripping"?

Copy link
Member Author

@marco-ippolito marco-ippolito Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk 😆 I've read "Type Stripping", "Type stripping", "type-stripping" not sure which one is correct

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be "type stripping", personally

/ducks

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nodejs-github-bot
Copy link
Collaborator

@marco-ippolito marco-ippolito added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 7, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 8, 2025
@nodejs-github-bot nodejs-github-bot merged commit 8e5c80d into nodejs:main Nov 8, 2025
82 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 8e5c80d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version. strip-types Issues or PRs related to strip-types support

Projects

None yet

Development

Successfully merging this pull request may close these issues.