Skip to content

Commit 8170b1b

Browse files
module: mark type stripping as stable
1 parent b4b1413 commit 8170b1b

File tree

19 files changed

+63
-49
lines changed

19 files changed

+63
-49
lines changed

doc/api/cli.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ only recognizes double `"` for quoting. In Powershell or Git bash, both `'`
977977
and `"` are usable.
978978

979979
It is possible to run code containing inline types unless the
980-
[`--no-experimental-strip-types`][] flag is provided.
980+
[`--no-strip-types`][] flag is provided.
981981

982982
### `--experimental-addon-modules`
983983

@@ -1586,7 +1586,7 @@ changes:
15861586

15871587
This configures Node.js to interpret `--eval` or `STDIN` input as CommonJS or
15881588
as an ES module. Valid values are `"commonjs"`, `"module"`, `"module-typescript"` and `"commonjs-typescript"`.
1589-
The `"-typescript"` values are not available with the flag `--no-experimental-strip-types`.
1589+
The `"-typescript"` values are not available with the flag `--no-strip-types`.
15901590
The default is no value, or `"commonjs"` if `--no-experimental-detect-module` is passed.
15911591

15921592
If `--input-type` is not provided,
@@ -1902,23 +1902,6 @@ changes:
19021902

19031903
Disable the experimental [`node:sqlite`][] module.
19041904

1905-
### `--no-experimental-strip-types`
1906-
1907-
<!-- YAML
1908-
added: v22.6.0
1909-
changes:
1910-
- version:
1911-
- v23.6.0
1912-
- v22.18.0
1913-
pr-url: https://github.com/nodejs/node/pull/56350
1914-
description: Type stripping is enabled by default.
1915-
-->
1916-
1917-
> Stability: 1.2 - Release candidate
1918-
1919-
Disable experimental type-stripping for TypeScript files.
1920-
For more information, see the [TypeScript type-stripping][] documentation.
1921-
19221905
### `--no-experimental-websocket`
19231906

19241907
<!-- YAML
@@ -1968,6 +1951,24 @@ changes:
19681951
Disables the family autoselection algorithm unless connection options explicitly
19691952
enables it.
19701953

1954+
### `--no-strip-types`
1955+
1956+
<!-- YAML
1957+
added: v22.6.0
1958+
changes:
1959+
- version: REPLACEME
1960+
pr-url: https://github.com/nodejs/node/pull/60600
1961+
description: Type Stripping is now stable.
1962+
- version:
1963+
- v23.6.0
1964+
- v22.18.0
1965+
pr-url: https://github.com/nodejs/node/pull/56350
1966+
description: Type stripping is enabled by default.
1967+
-->
1968+
1969+
Disable type-stripping for TypeScript files.
1970+
For more information, see the [TypeScript type-stripping][] documentation.
1971+
19711972
### `--no-warnings`
19721973

19731974
<!-- YAML
@@ -3548,6 +3549,7 @@ one is included in the list below.
35483549
* `--no-force-async-hooks-checks`
35493550
* `--no-global-search-paths`
35503551
* `--no-network-family-autoselection`
3552+
* `--no-strip-types`
35513553
* `--no-warnings`
35523554
* `--no-webstorage`
35533555
* `--node-memory-debug`
@@ -4111,7 +4113,7 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
41114113
[`--experimental-sea-config`]: single-executable-applications.md#generating-single-executable-preparation-blobs
41124114
[`--heap-prof-dir`]: #--heap-prof-dir
41134115
[`--import`]: #--importmodule
4114-
[`--no-experimental-strip-types`]: #--no-experimental-strip-types
4116+
[`--no-strip-types`]: #--no-strip-types
41154117
[`--openssl-config`]: #--openssl-configfile
41164118
[`--preserve-symlinks`]: #--preserve-symlinks
41174119
[`--print`]: #-p---print-script

doc/api/process.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,6 +2001,10 @@ This value is therefore identical to that of `process.features.tls`.
20012001
added:
20022002
- v23.0.0
20032003
- v22.10.0
2004+
changes:
2005+
- version: REPLACEME
2006+
pr-url: https://github.com/nodejs/node/pull/60600
2007+
description: Type Stripping is now stable.
20042008
-->
20052009
20062010
> Stability: 1.2 - Release candidate
@@ -2009,7 +2013,7 @@ added:
20092013
20102014
A value that is `"strip"` by default,
20112015
`"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if
2012-
Node.js is run with `--no-experimental-strip-types`.
2016+
Node.js is run with `--no-strip-types`.
20132017
20142018
## `process.features.uv`
20152019

doc/api/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ By default, Node.js will run all files matching these patterns:
514514
* `**/test.{cjs,mjs,js}`
515515
* `**/test/**/*.{cjs,mjs,js}`
516516

517-
Unless [`--no-experimental-strip-types`][] is supplied, the following
517+
Unless [`--no-strip-types`][] is supplied, the following
518518
additional patterns are also matched:
519519

520520
* `**/*.test.{cts,mts,ts}`
@@ -3996,7 +3996,7 @@ Can be used to abort test subtasks when the test has been aborted.
39963996
[`--experimental-test-coverage`]: cli.md#--experimental-test-coverage
39973997
[`--experimental-test-module-mocks`]: cli.md#--experimental-test-module-mocks
39983998
[`--import`]: cli.md#--importmodule
3999-
[`--no-experimental-strip-types`]: cli.md#--no-experimental-strip-types
3999+
[`--no-strip-types`]: cli.md#--no-strip-types
40004000
[`--test-concurrency`]: cli.md#--test-concurrency
40014001
[`--test-coverage-exclude`]: cli.md#--test-coverage-exclude
40024002
[`--test-coverage-include`]: cli.md#--test-coverage-include

doc/api/typescript.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<!-- YAML
44
changes:
5+
- version: REPLACEME
6+
pr-url: https://github.com/nodejs/node/pull/60600
7+
description: Type Stripping is now stable.
58
- version:
69
- v24.3.0
710
- v22.18.0
@@ -19,7 +22,7 @@ changes:
1922

2023
<!--introduced_in=v22.6.0-->
2124

22-
> Stability: 1.2 - Release candidate
25+
> Stability: 2 - Stable
2326
2427
## Enabling
2528

@@ -60,6 +63,10 @@ To use TypeScript with full support for all TypeScript features, including
6063

6164
<!-- YAML
6265
added: v22.6.0
66+
changes:
67+
- version: REPLACEME
68+
pr-url: https://github.com/nodejs/node/pull/60600
69+
description: Type Stripping is now stable.
6370
-->
6471

6572
By default Node.js will execute TypeScript files that contains only
@@ -68,7 +75,7 @@ Node.js will replace TypeScript syntax with whitespace,
6875
and no type checking is performed.
6976
To enable the transformation of non erasable TypeScript syntax, which requires JavaScript code generation,
7077
such as `enum` declarations, parameter properties use the flag [`--experimental-transform-types`][].
71-
To disable this feature, use the flag [`--no-experimental-strip-types`][].
78+
To disable this feature, use the flag [`--no-strip-types`][].
7279

7380
Node.js ignores `tsconfig.json` files and therefore
7481
features that depend on settings within `tsconfig.json`,
@@ -219,7 +226,7 @@ with `#`.
219226
[ES Modules]: esm.md
220227
[Full TypeScript support]: #full-typescript-support
221228
[`--experimental-transform-types`]: cli.md#--experimental-transform-types
222-
[`--no-experimental-strip-types`]: cli.md#--no-experimental-strip-types
229+
[`--no-strip-types`]: cli.md#--no-strip-types
223230
[`ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`]: errors.md#err_unsupported_typescript_syntax
224231
[`tsconfig` "paths"]: https://www.typescriptlang.org/tsconfig/#paths
225232
[`tsx`]: https://tsx.is/

doc/contributing/advocacy-ambassador-program.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ with projects learning from one another and their users.
271271
| [reading environment](https://nodejs.org/api/cli.html#--env-filefile) | [20.6.0](https://nodejs.org/en/blog/release/v20.6.0) | Active Development |
272272
| [styling output](https://nodejs.org/docs/latest-v22.x/api/util.html#utilstyletextformat-text-options) | [20.12.0](https://nodejs.org/en/blog/release/v20.12.0) | Stable, as of [22.13.0](https://github.com/nodejs/node/pull/56329) |
273273
| [run scripts](https://nodejs.org/docs/latest/api/cli.html#--run) | [22.0.0](https://nodejs.org/en/blog/release/v22.0.0) | Stable, as of 22.0.0 |
274-
| [run TypeScript](https://nodejs.org/api/cli.html#--experimental-strip-types) | [22.6.0](https://nodejs.org/en/blog/release/v22.6.0) | Active Development |
274+
| [run TypeScript](https://nodejs.org/api/cli.html#--strip-types) | [22.6.0](https://nodejs.org/en/blog/release/v22.6.0) | Stable, as of REPLACEME |
275275

276276
##### Related Links
277277

@@ -284,7 +284,7 @@ with projects learning from one another and their users.
284284
* <https://nodejs.org/api/cli.html#--env-filefile>
285285
* <https://nodejs.org/docs/latest-v22.x/api/util.html#utilstyletextformat-text-options>
286286
* <https://nodejs.org/api/cli.html#--run>
287-
* <https://nodejs.org/api/cli.html#--experimental-strip-types>
287+
* <https://nodejs.org/api/cli.html#--strip-types>
288288

289289
<!-- lint enable prohibited-strings remark-lint-->
290290

doc/node-config-schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@
177177
"experimental-sqlite": {
178178
"type": "boolean"
179179
},
180-
"experimental-strip-types": {
181-
"type": "boolean"
182-
},
183180
"experimental-transform-types": {
184181
"type": "boolean"
185182
},
@@ -361,6 +358,9 @@
361358
"stack-trace-limit": {
362359
"type": "number"
363360
},
361+
"strip-types": {
362+
"type": "boolean"
363+
},
364364
"test-coverage-branches": {
365365
"type": "number"
366366
},

doc/node.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ Disable top-level await keyword support in REPL.
216216
.It Fl -no-experimental-sqlite
217217
Disable the experimental node:sqlite module.
218218
.
219-
.It Fl -no-experimental-strip-types
220-
Disable experimental type-stripping for TypeScript files.
219+
.It Fl -no-strip-types
220+
Disable type-stripping for TypeScript files.
221221
.
222222
.It Fl -experimental-vm-modules
223223
Enable experimental ES module support in VM module.

lib/internal/bootstrap/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ ObjectDefineProperty(process.features, 'typescript', {
334334
if (kTypeStrippingMode === null) {
335335
if (getOptionValue('--experimental-transform-types')) {
336336
kTypeStrippingMode = 'transform';
337-
} else if (getOptionValue('--experimental-strip-types')) {
337+
} else if (getOptionValue('--strip-types')) {
338338
kTypeStrippingMode = 'strip';
339339
} else {
340340
kTypeStrippingMode = false;

lib/internal/main/eval_stdin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ readStdin((code) => {
2929
const print = getOptionValue('--print');
3030
const shouldLoadESM = getOptionValue('--import').length > 0;
3131
const inputType = getOptionValue('--input-type');
32-
const tsEnabled = getOptionValue('--experimental-strip-types');
32+
const tsEnabled = getOptionValue('--strip-types');
3333
if (inputType === 'module') {
3434
evalModuleEntryPoint(code, print);
3535
} else if (inputType === 'module-typescript' && tsEnabled) {

lib/internal/main/eval_string.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const code = getOptionValue('--eval');
3232
const print = getOptionValue('--print');
3333
const shouldLoadESM = getOptionValue('--import').length > 0 || getOptionValue('--experimental-loader').length > 0;
3434
const inputType = getOptionValue('--input-type');
35-
const tsEnabled = getOptionValue('--experimental-strip-types');
35+
const tsEnabled = getOptionValue('--strip-types');
3636
if (inputType === 'module') {
3737
evalModuleEntryPoint(code, print);
3838
} else if (inputType === 'module-typescript' && tsEnabled) {

0 commit comments

Comments
 (0)