Skip to content

module: remove --experimental-transform-types#61803

Open
marco-ippolito wants to merge 1 commit intonodejs:mainfrom
marco-ippolito:rip-transform-type
Open

module: remove --experimental-transform-types#61803
marco-ippolito wants to merge 1 commit intonodejs:mainfrom
marco-ippolito:rip-transform-type

Conversation

@marco-ippolito
Copy link
Member

@marco-ippolito marco-ippolito commented Feb 13, 2026

This PR removes the --experimental-transform-types flag and all related code, tests, and documentation.

Refs: nodejs/typescript#51

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/loaders
  • @nodejs/performance
  • @nodejs/startup
  • @nodejs/typescript

@marco-ippolito marco-ippolito added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 13, 2026
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. 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 Feb 13, 2026
@marco-ippolito marco-ippolito added module Issues and PRs related to the module subsystem. strip-types Issues or PRs related to strip-types support and removed c++ Issues and PRs that require attention from people who are familiar with C++. 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 Feb 13, 2026
@GeoffreyBooth
Copy link
Member

process.features.typescript now only returns a boolean

I think we should add process.features.stripTypes that returns a boolean. This should be a separate PR so that it can be backported.

Then the question becomes what to do with process.features.typescript. I think having a feature called typescript only makes sense if the overall feature has various modes, like currently it's either off (false), strip or transform. But we might someday add other TypeScript-related features like type checking, or tsconfig.json support, or support for various features within tsconfig.json; and these might be individual features to be toggled on or off (like maybe a user enables tsconfig.json paths support but not type checking) and so a single string value for an overall mode doesn't make sense. We could make process.features.typescript a Record<string, boolean> so that there's something like process.features.typescript.strip === true and other features add onto there, or treat each new TypeScript-related feature as a top-level key on process.features.

For the purposes of this PR, perhaps the simplest thing to do would be to just keep process.features.typescript as it is but remove transform as a possible return type. Then a redesign of process.features.typescript can happen in a dedicated PR.

@marco-ippolito
Copy link
Member Author

User can run --no-strip-types so typescript might not be enabled

@aduh95
Copy link
Contributor

aduh95 commented Feb 13, 2026

  • process.features.typescript now only returns a boolean.

I wouldn't do that:

  • it's perfectly workable as is, as a string
  • if we end up re-introducing --transform-type or another type of typescript handling, it will put us in an awkard position.

Why risk it?

@styfle
Copy link
Member

styfle commented Feb 13, 2026

if we end up re-introducing --transform-type or another type of typescript handling, it will put us in an awkard position.

If we think thats a possibility in the future, then we should keep process.features.typescript as a string and also keep the options object in stripTypeScriptTypes() so we can allow strip but throw and error for other modes.

TLDR - keep this semver-major change as breaking only for those using transform but anyone using strip should not have a breaking change. Does that make sense?

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.66%. Comparing base (da5efc4) to head (1708c57).
⚠️ Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/modules/typescript.js 75.00% 1 Missing ⚠️
src/compile_cache.cc 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61803      +/-   ##
==========================================
+ Coverage   88.84%   89.66%   +0.82%     
==========================================
  Files         674      676       +2     
  Lines      204957   205951     +994     
  Branches    39309    39434     +125     
==========================================
+ Hits       182087   184670    +2583     
+ Misses      15088    13426    -1662     
- Partials     7782     7855      +73     
Files with missing lines Coverage Δ
lib/internal/bootstrap/node.js 98.96% <100.00%> (-0.01%) ⬇️
src/compile_cache.h 100.00% <ø> (ø)
src/node_options.cc 76.32% <ø> (-0.05%) ⬇️
lib/internal/modules/typescript.js 92.30% <75.00%> (-5.18%) ⬇️
src/compile_cache.cc 79.09% <0.00%> (-1.64%) ⬇️

... and 210 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.

@GeoffreyBooth
Copy link
Member

This PR's goal is to remove transform-types. So in this PR, I think just remove the transform response from process.features.typescript. Any other rethinking or redesign of that property can come in a follow-up PR.

@marco-ippolito
Copy link
Member Author

Applied suggestions, only remove transform related stuff

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

LGTM overall

@marco-ippolito
Copy link
Member Author

Cna someone help me understand the CI failure?

@Renegade334
Copy link
Member

Renegade334 commented Feb 25, 2026

Cna someone help me understand the CI failure?

The --[experimental-]strip-types CLI flag needs to be reintroduced here:

const args = ['--test', '--test-reporter=tap', '--no-warnings',
`--test-isolation=${isolation}`];

@aduh95
Copy link
Contributor

aduh95 commented Feb 26, 2026

Cna someone help me understand the CI failure?

The --experimental-strip-types CLI flag needs to be reintroduced here:

That doesn't really make sense, type stripping has been unflagged for a while, that flag is now a no-op. The issue seems to be that the following branch is no longer needed:

if (!process.config.variables.node_use_amaro) {
// e.g. Compiled with `--without-amaro`.
assert.strictEqual(child.status, 1);
} else {

@Renegade334
Copy link
Member

The flag still forces an early exit if no amaro, but if it's not provided, then the default-off behaviour can still be tested.

    assert.strictEqual(child.stderr.toString(), '');
    const stdout = child.stdout.toString();

    assert.match(stdout, /ok 1 - this should pass/);
    assert.match(stdout, /ok 2 - this should pass/);
    assert.match(stdout, /ok 3 - this should pass/);
    if (!process.config.variables.node_use_amaro) {
      // e.g. Compiled with `--without-amaro`.
      assert.doesNotMatch(stdout, /ok 4 - this should pass/);
    } else {
      assert.match(stdout, /ok 4 - this should pass/);
      assert.match(stdout, /ok 5 - this should pass/);
      assert.match(stdout, /ok 6 - this should pass/);
    }

    assert.strictEqual(child.status, 0);
    assert.strictEqual(child.signal, null);

@nodejs-github-bot
Copy link
Collaborator

@marco-ippolito marco-ippolito added the notable-change PRs with changes that should be highlighted in changelogs. label Feb 26, 2026
@github-actions
Copy link
Contributor

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

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.

@nodejs-github-bot
Copy link
Collaborator

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

Labels

module Issues and PRs related to the module subsystem. notable-change PRs with changes that should be highlighted in changelogs. semver-major PRs that contain breaking changes and should be released in the next major version. strip-types Issues or PRs related to strip-types support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants