Skip to content

Roadmap to stable strip-types #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 of 8 tasks
marco-ippolito opened this issue Jan 8, 2025 · 13 comments
Open
5 of 8 tasks

Roadmap to stable strip-types #24

marco-ippolito opened this issue Jan 8, 2025 · 13 comments

Comments

@marco-ippolito
Copy link
Member

marco-ippolito commented Jan 8, 2025

We have unflagged --experimental-strip-types in v23.6.0.
Here what I think are some of the next steps:

Feel free to add items if you think I missed something

@mcollina
Copy link
Member

mcollina commented Jan 8, 2025

I think we should publish the suggested tsconfig on npm and maintain it.

Plan sounds good.

@JakobJingleheimer
Copy link
Member

I think we should publish the suggested tsconfig on npm and maintain it.

Plan sounds good.

Great idea 🙂 could go under the @nodejs namespace we already have

@JakobJingleheimer
Copy link
Member

Article on how to publish a new package node/nodejs.org#7279

I'm getting back to this tonight. I have made the requested updates locally. Need to finish a couple other things and then will push.

Wait for TypeScript 5.8 (at least beta) compatibility flag with strip-types (@nodejs/typescript ETA?)

Looks like this is still an unknown: https://bsky.app/profile/jakebailey.dev/post/3lf4igi3lzc2m

Create some utilities to validate tsconfig or generate tsconfig compatible with --experimental-strip-types

I can do! I recently did something similar for one of my own libraries.

@marco-ippolito marco-ippolito changed the title Roadmap to stable --strip-types Roadmap to stable strip-types Jan 8, 2025
@ljharb
Copy link
Member

ljharb commented Jan 8, 2025

What about TS syntax in the repl? Should that work by default too?

@marco-ippolito
Copy link
Member Author

What about TS syntax in the repl? Should that work by default too?

I did not dare to try implement it in the REPL as it looks quite complicate.

@RyanCavanaugh
Copy link

We've named and approved microsoft/TypeScript#59601 which should land in either TS 5.8 or 5.9 depending on timing, so that should be a recommended flag once it's in

@khaosdoctor
Copy link
Member

On the tsconfig file, @jakebailey brought up that we could also use https://github.com/tsconfig/bases which is kinda the "standard" way to get the base files with minimal effort, so I'll add the file there once the 5.8 Beta comes out extending it from the main Node 22 base config

@khaosdoctor
Copy link
Member

Well that was fast: https://devblogs.microsoft.com/typescript/announcing-typescript-5-8-beta/

@simonbuchan
Copy link

Small heads up since it seems to be easy to miss that 5.7 also added --rewriteRelativeImportExtensions to support importing .ts in ts code without disabling build (like --allowImportingTsExtensions does )for code you use both locally and in published packages.

I've added a PR in tsconfig/bases#300 to add it already, but thought it was worth mentioning here.

@albertodiazdorado
Copy link

Do you have any insights about the possibility of --experimental-transform-types becoming stable?

The existence of this roadmap for type stripping is excellent news, because it means that the feature is likely to become stable and we are already considering it for our projects. I wonder whether there is any similar information about type transformation :)

@marco-ippolito
Copy link
Member Author

--experimental-transform-types will become stable but will not be unflagged and stay behind the --transform-types flag

@jakebailey
Copy link
Contributor

Of course note that TS itself is "unstable", so you may end up with a break when using that flag eventually (e.g., we will probably be removing the module keyword to make way for TC39 use).

@marco-ippolito
Copy link
Member Author

marco-ippolito commented Apr 1, 2025

Of course note that TS itself is "unstable", so you may end up with a break when using that flag eventually (e.g., we will probably be removing the module keyword to make way for TC39 use).

We have already removed the module keyword support completely.
If there are semver major changes to the syntax that break transpilation we will update node in a semver major.

nodejs-github-bot pushed a commit to nodejs/node that referenced this issue Apr 3, 2025
PR-URL: #57705
Refs: nodejs/typescript#24
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
JonasBa pushed a commit to JonasBa/node that referenced this issue Apr 11, 2025
PR-URL: nodejs#57705
Refs: nodejs/typescript#24
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants