Skip to content
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

module: unflag --experimental-strip-types #56350

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

marco-ippolito
Copy link
Member

@marco-ippolito marco-ippolito commented Dec 24, 2024

It's time to enable it by default to catch some more bugs, currently there are no open issues.
I think it's a semver minor change.

Fixes: nodejs/typescript#17

@nodejs/tsc for visibility

Notable change section:

This change enables the flag --experimental-strip-types by default.
Node.js will be able to execute TypeScript files without additional configuration. Note that there are some limitations in the supported syntax documented at https://nodejs.org/api/typescript.html#type-stripping
This feature is experimental and is subject to change.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/performance
  • @nodejs/test_runner
  • @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 Dec 24, 2024
@marco-ippolito marco-ippolito added strip-types Issues or PRs related to strip-types support blocked PRs that are blocked by other issues or PRs. wip Issues and PRs that are still a work in progress. labels Dec 24, 2024
@marco-ippolito marco-ippolito marked this pull request as ready for review December 24, 2024 18:17
@marco-ippolito marco-ippolito removed wip Issues and PRs that are still a work in progress. blocked PRs that are blocked by other issues or PRs. labels Dec 24, 2024
Copy link

codecov bot commented Dec 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.54%. Comparing base (da3f388) to head (927169a).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56350      +/-   ##
==========================================
- Coverage   88.54%   88.54%   -0.01%     
==========================================
  Files         657      657              
  Lines      190655   190655              
  Branches    36582    36587       +5     
==========================================
- Hits       168824   168823       -1     
- Misses      15008    15017       +9     
+ Partials     6823     6815       -8     
Files with missing lines Coverage Δ
src/node_options.cc 87.92% <ø> (ø)
src/node_options.h 98.30% <100.00%> (ø)

... and 30 files with indirect coverage changes

@marco-ippolito marco-ippolito added semver-minor PRs that contain new features and should be released in the next minor version. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. labels Dec 25, 2024
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@marco-ippolito marco-ippolito added request-ci Add this label to start a Jenkins CI on a PR. notable-change PRs with changes that should be highlighted in changelogs. baking-for-lts PRs that need to wait before landing in a LTS release. labels Dec 25, 2024
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.

@marco-ippolito marco-ippolito added the module Issues and PRs related to the module subsystem. label Dec 25, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 25, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@bmuenzenmeyer bmuenzenmeyer left a comment

Choose a reason for hiding this comment

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

excited for this, having watched it's development and played with it quite a bit.
some suggestions and questions, none blocking

doc/api/cli.md Outdated Show resolved Hide resolved
doc/api/cli.md Show resolved Hide resolved
test/es-module/test-typescript.mjs Outdated Show resolved Hide resolved
@@ -84,7 +86,7 @@ describe('test runner coverage default exclusion', skipIfNoInspector, () => {
assert.strictEqual(result.status, 0);
});

it('should exclude ts test files when using --experimental-strip-types', async () => {
it('should exclude ts test files', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

noting that this suite never positively affirms typescript coverage - perhaps Node.js does not do that yet and I am just mistaken. I could not tell from the source code or API docs

Copy link
Member Author

Choose a reason for hiding this comment

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

Since --experimental-strip-types is unflag it will also execute the .test.ts files that are present in the folder. So it will change the output

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 what confused me - the report on line 90 does not change

Copy link
Member Author

Choose a reason for hiding this comment

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

If you look below --experimental-strip-typed was already enabled

marco-ippolito and others added 2 commits December 25, 2024 13:47
Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>
Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>
doc/api/cli.md Show resolved Hide resolved
doc/api/cli.md Outdated Show resolved Hide resolved
@@ -52,7 +52,7 @@ added: v22.6.0

> Stability: 1.1 - Active development
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
> Stability: 1.1 - Active development
> Stability: 1.2 - Release candidate

We should also add an entry in this document that says on what version type stripping was enabled by default

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
baking-for-lts PRs that need to wait before landing in a LTS release. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. 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. module Issues and PRs related to the module subsystem. 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.

Unflag --experimental-strip-types
5 participants