GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — module: add --experimental-transform-types flag by marco-ippolito · Pull Request #54283 · nodejs/node

Conversation

@marco-ippolito

@marco-ippolito marco-ippolito commented Aug 9, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

With the new flag --experimental-transform-types it is possible to enable the transformation of TypeScript-only syntax into JavaScript code.
This feature allows Node.js to support TypeScript syntax such as Enum and namespace.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

andreujuanc, flacial, notDemian, MomenNano, vimutti77, mvsde, jaencarlosap, ansavchenco, gioragutt, haltcase, and 13 more reacted with thumbs up emoji typed-sigterm and cjnoname reacted with confused emoji allisonkarlitskaya, mitschabaude, kirillgroshkov, gioragutt, starman-vlad, cjnoname, bennypowers, pshaddel, nalejandroveron, and Shazcarrera96 reacted with heart emoji bricss, shrujalshah28, khaosdoctor, legendecas, KhafraDev, VoltrexKeyva, H4ad, mattpocock, kernoeb, mehulmpt, and 74 more reacted with rocket emoji avivkeller, H4ad, mattpocock, ncamera, alvarlagerlof, michscho, octet-stream, andreujuanc, flacial, notDemian, and 7 more reacted with eyes emoji
All reactions
  • 👍 23 reactions
  • 😕 2 reactions
  • ❤️ 10 reactions
  • 🚀 84 reactions
  • 👀 17 reactions
@nodejs-github-bot

nodejs-github-bot commented Aug 9, 2024

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/typescript
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito marco-ippolito changed the title module: add --experimental-enable-transformation for strip-types [WIP] module: add --experimental-enable-transformation for strip-types Aug 9, 2024
@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Aug 9, 2024
@marco-ippolito marco-ippolito added wip Issues and PRs that are still a work in progress. strip-types Issues and PRs related to TypeScript type stripping. labels Aug 9, 2024
benjamingr
benjamingr approved these changes Aug 9, 2024
View reviewed changes
@marco-ippolito
marco-ippolito force-pushed the feat/enable-transformations branch from 29040a6 to c5da92e Compare August 9, 2024 11:20
@marco-ippolito
marco-ippolito marked this pull request as ready for review August 9, 2024 11:20
@marco-ippolito marco-ippolito changed the title [WIP] module: add --experimental-enable-transformation for strip-types module: add --experimental-enable-transformation for strip-types Aug 9, 2024
@marco-ippolito marco-ippolito removed the wip Issues and PRs that are still a work in progress. label Aug 9, 2024
mcollina
mcollina approved these changes Aug 9, 2024
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
marco-ippolito
marco-ippolito commented Aug 9, 2024
View reviewed changes
Comment thread doc/api/cli.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito marco-ippolito added the semver-minor PRs that contain new features and should be released in the next minor version. label Aug 9, 2024
@marco-ippolito
marco-ippolito force-pushed the feat/enable-transformations branch 2 times, most recently from de62233 to 7343717 Compare August 9, 2024 12:15
legendecas
legendecas reviewed Aug 9, 2024
View reviewed changes
Comment thread doc/api/cli.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

legendecas
legendecas reviewed Aug 9, 2024
View reviewed changes

@legendecas legendecas left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can we also add a test case that --experimental-enable-transformation doesn't eliminate unused imports, like this example?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marco-ippolito
marco-ippolito force-pushed the feat/enable-transformations branch from 7343717 to b67230f Compare August 9, 2024 12:58
marco-ippolito
marco-ippolito commented Aug 9, 2024
View reviewed changes
Comment thread test/fixtures/typescript/ts/transformation/test-unused-import.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

khaosdoctor
khaosdoctor reviewed Aug 9, 2024
View reviewed changes
Comment thread doc/api/cli.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito
marco-ippolito force-pushed the feat/enable-transformations branch from b67230f to e0ac82e Compare August 9, 2024 13:27
khaosdoctor
khaosdoctor approved these changes Aug 9, 2024
View reviewed changes
@marco-ippolito
marco-ippolito force-pushed the feat/enable-transformations branch from e0ac82e to 3578d86 Compare August 9, 2024 13:35
@marco-ippolito marco-ippolito changed the title module: add --experimental-enable-transformation for strip-types module: add --experimental-enable--type-transform for strip-types Aug 9, 2024
@marco-ippolito marco-ippolito changed the title module: add --experimental-enable--type-transform for strip-types module: add --experimental-enable-type-transform for strip-types Aug 9, 2024
@marco-ippolito
marco-ippolito force-pushed the feat/enable-transformations branch from 3578d86 to 6b155bd Compare August 9, 2024 13:37
mcollina
mcollina requested changes Aug 9, 2024
View reviewed changes

@mcollina mcollina left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actually, on closer look I have a change request: I think --experimental-enable-type-transform should imply --enable-source-maps.

(I'm +1 on the feature)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

khaosdoctor reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@marco-ippolito

marco-ippolito commented Aug 9, 2024

Copy link
Copy Markdown
Member Author

Actually, on closer look I have a change request: I think --experimental-enable-type-transform should imply --enable-source-maps.

(I'm +1 on the feature)

Probably makes more sense, otherwise location will be always wrong

khaosdoctor and mcollina reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Aug 9, 2024
View reviewed changes
Comment thread doc/api/typescript.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 12, 2024
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 12, 2024
@nodejs-github-bot

nodejs-github-bot commented Aug 12, 2024

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@legendecas legendecas mentioned this pull request Aug 12, 2024
SyntaxError stack trace source maps nodejs/typescript#4
Open
@nodejs-github-bot

nodejs-github-bot commented Aug 12, 2024

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 12, 2024

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 12, 2024

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ShogunPanda
ShogunPanda approved these changes Aug 12, 2024
View reviewed changes
@marco-ippolito marco-ippolito added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. author ready PRs with CI started, the required approvals, and no outstanding review comments. labels Aug 12, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 12, 2024
@nodejs-github-bot
nodejs-github-bot merged commit 0301309 into nodejs:main Aug 12, 2024
@nodejs-github-bot

nodejs-github-bot commented Aug 12, 2024

Copy link
Copy Markdown
Collaborator

Landed in 0301309

marco-ippolito, SuperchupuDev, DanielRamosAcosta, alexbechmann, shrujalshah28, styfle, allisonkarlitskaya, and MartinCura reacted with hooray emoji
All reactions
  • 🎉 8 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@statianzo

statianzo commented Aug 12, 2024

Copy link
Copy Markdown

Has there been discussion around writing out the result of typescript transformation?

It would allow package creators to publish TS -> JS consistent with the transformations node is doing internally. Given transformations don't apply to node_modules, packages authored using TS will require additional tooling to apply before the ability to publish. If publishers opt for tsc it wouldn't exactly match the calling the .ts from node directly.

Happy to post this comment elsewhere if more suitable.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito

marco-ippolito commented Aug 12, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Has there been discussion around writing out the result of typescript transformation?

It would allow package creators to publish TS -> JS consistent with the transformations node is doing internally. Given transformations don't apply to node_modules, packages authored using TS will require additional tooling to apply before the ability to publish. If publishers opt for tsc it wouldn't exactly match the calling the .ts from node directly.

Happy to post this comment elsewhere if more suitable.

We have a repository for this kind of discussion nodejs/typescript

statianzo and codyebberson reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RyanCavanaugh RyanCavanaugh mentioned this pull request Aug 12, 2024
Tsconfig option to disallow features requiring transformations which are not supported by Node.js' --strip-types microsoft/TypeScript#59601
Closed
6 tasks done
@Bnaya

Bnaya commented Aug 13, 2024

Copy link
Copy Markdown

Sorry if i'm later to the party :)
Does it supports only the features that are supported by typescript's isolatedModules, or also the cross-file features?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jakebailey

jakebailey commented Aug 13, 2024

Copy link
Copy Markdown
Member

No, this is just isolatedModules. Node.js is not shipping a type checker that can perform that kind of analysis.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented Aug 14, 2024

Copy link
Copy Markdown
Member

I optimistically pushed it to v22.x-staging but tests failed, so I took it out: https://github.com/nodejs/node/actions/runs/10382663326/job/28746123871

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito

marco-ippolito commented Aug 14, 2024

Copy link
Copy Markdown
Member Author

I optimistically pushed it to v22.x-staging but tests failed, so I took it out: https://github.com/nodejs/node/actions/runs/10382663326/job/28746123871

It requires backport I think, to imply the experimental-detect-module

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito marco-ippolito mentioned this pull request Aug 14, 2024
[v22.x] Backport: "module: add --experimental-transform-types flag" #54373
Closed
@justinfagnani justinfagnani mentioned this pull request Aug 15, 2024
Design Meeting Notes, 8/13/2024 microsoft/TypeScript#59624
Closed
@allisonkarlitskaya allisonkarlitskaya mentioned this pull request Aug 16, 2024
Build Arm64 cockpit-project/cockpit-files#609
Closed
@RafaelGSS RafaelGSS mentioned this pull request Aug 20, 2024
v22.7.0 proposal #54452
Merged
@marco-ippolito marco-ippolito mentioned this pull request Aug 20, 2024
lib: expose tsParse as util.stripTypescriptTypes #54250
Closed
@ShenHongFei ShenHongFei mentioned this pull request Sep 3, 2024
Use the compilation cache when running typescript files through --experimental-transform-types #54741
Closed
@karlhorky karlhorky mentioned this pull request Aug 6, 2025
Change Request: Remove unstable_native_nodejs_ts_config after Node.js v22.18.0 / v24.3.0 eslint/eslint#19985
Closed
1 task
@wagenet wagenet mentioned this pull request Oct 16, 2025
Inaccurate Decorator Status Documentation #60282
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 17, 2026
Overnight integration #1: trusted-state (real kill-9) + effect-protocol + git-hardening + hermetic-rehearsal + durable effect-event store aumara-xyz/aukora-alpha#127
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aduh95 aduh95 aduh95 left review comments
@avivkeller avivkeller avivkeller left review comments
@mcollina mcollina mcollina approved these changes
@ShogunPanda ShogunPanda ShogunPanda approved these changes
@jasnell jasnell jasnell approved these changes
@benjamingr benjamingr benjamingr approved these changes
@anonrig anonrig anonrig approved these changes
@legendecas legendecas legendecas approved these changes
@himself65 himself65 himself65 approved these changes
+5 more reviewers
@jakebailey jakebailey jakebailey left review comments
@magic-akari magic-akari magic-akari left review comments
@VoltrexKeyva VoltrexKeyva VoltrexKeyva left review comments
@khaosdoctor khaosdoctor khaosdoctor approved these changes
@mertcanaltin mertcanaltin mertcanaltin approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. 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 and PRs related to TypeScript type stripping.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

20 participants

@marco-ippolito @nodejs-github-bot @mcollina @legendecas @robpalme @statianzo @Bnaya @jakebailey @targos @ShogunPanda @jasnell @benjamingr @anonrig @khaosdoctor @magic-akari @himself65 @aduh95 @mertcanaltin @avivkeller @VoltrexKeyva
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.