| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent db27883 commit 89f4b6c
48 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1315,17 +1315,6 @@ Enable module mocking in the test runner. | |||
| 1315 | 1315 | ||
| 1316 | 1316 | This feature requires `--allow-worker` if used with the [Permission Model][]. | |
| 1317 | 1317 | ||
| 1318 | - ### `--experimental-transform-types` | ||
| 1319 | - | ||
| 1320 | - <!-- YAML | ||
| 1321 | - added: v22.7.0 | ||
| 1322 | - --> | ||
| 1323 | - | ||
| 1324 | - > Stability: 1.2 - Release candidate | ||
| 1325 | - | ||
| 1326 | - Enables the transformation of TypeScript-only syntax into JavaScript code. | ||
| 1327 | - Implies `--enable-source-maps`. | ||
| 1328 | - | ||
| 1329 | 1318 | ### `--experimental-vm-modules` | |
| 1330 | 1319 | ||
| 1331 | 1320 | <!-- YAML | |
@@ -3621,7 +3610,6 @@ one is included in the list below. | |||
| 3621 | 3610 | * `--experimental-specifier-resolution` | |
| 3622 | 3611 | * `--experimental-test-isolation` | |
| 3623 | 3612 | * `--experimental-top-level-await` | |
| 3624 | - * `--experimental-transform-types` | ||
| 3625 | 3613 | * `--experimental-vm-modules` | |
| 3626 | 3614 | * `--experimental-wasi-unstable-preview1` | |
| 3627 | 3615 | * `--force-context-aware` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -245,6 +245,10 @@ See [Customization hooks][]. | |||
| 245 | 245 | added: | |
| 246 | 246 | - v23.2.0 | |
| 247 | 247 | - v22.13.0 | |
| 248 | + changes: | ||
| 249 | + - version: REPLACEME | ||
| 250 | + pr-url: https://github.com/nodejs/node/pull/61803 | ||
| 251 | + description: Removed `transform` and `sourceMap` options. | ||
| 248 | 252 | --> | |
| 249 | 253 | ||
| 250 | 254 | > Stability: 1.2 - Release candidate | |
@@ -253,9 +257,6 @@ added: | |||
| 253 | 257 | * `options` {Object} | |
| 254 | 258 | * `mode` {string} **Default:** `'strip'`. Possible values are: | |
| 255 | 259 | * `'strip'` Only strip type annotations without performing the transformation of TypeScript features. | |
| 256 | - * `'transform'` Strip type annotations and transform TypeScript features to JavaScript. | ||
| 257 | - * `sourceMap` {boolean} **Default:** `false`. Only when `mode` is `'transform'`, if `true`, a source map | ||
| 258 | - will be generated for the transformed code. | ||
| 259 | 260 | * `sourceUrl` {string} Specifies the source url used in the source map. | |
| 260 | 261 | * Returns: {string} The code with type annotations stripped. | |
| 261 | 262 | `module.stripTypeScriptTypes()` removes type annotations from TypeScript code. It | |
@@ -264,10 +265,6 @@ added: | |||
| 264 | 265 | By default, it will throw an error if the code contains TypeScript features | |
| 265 | 266 | that require transformation such as `Enums`, | |
| 266 | 267 | see [type-stripping][] for more information. | |
| 267 | - When mode is `'transform'`, it also transforms TypeScript features to JavaScript, | ||
| 268 | - see [transform TypeScript features][] for more information. | ||
| 269 | - When mode is `'strip'`, source maps are not generated, because locations are preserved. | ||
| 270 | - If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown. | ||
| 271 | 268 | ||
| 272 | 269 | _WARNING_: The output of this function should not be considered stable across Node.js versions, | |
| 273 | 270 | due to changes in the TypeScript parser. | |
@@ -306,40 +303,6 @@ console.log(strippedCode); | |||
| 306 | 303 | // Prints: const a = 1\n\n//# sourceURL=source.ts; | |
| 307 | 304 | ``` | |
| 308 | 305 | ||
| 309 | - When `mode` is `'transform'`, the code is transformed to JavaScript: | ||
| 310 | - | ||
| 311 | - ```mjs | ||
| 312 | - import { stripTypeScriptTypes } from 'node:module'; | ||
| 313 | - const code = ` | ||
| 314 | - namespace MathUtil { | ||
| 315 | - export const add = (a: number, b: number) => a + b; | ||
| 316 | - }`; | ||
| 317 | - const strippedCode = stripTypeScriptTypes(code, { mode: 'transform', sourceMap: true }); | ||
| 318 | - console.log(strippedCode); | ||
| 319 | - // Prints: | ||
| 320 | - // var MathUtil; | ||
| 321 | - // (function(MathUtil) { | ||
| 322 | - // MathUtil.add = (a, b)=>a + b; | ||
| 323 | - // })(MathUtil || (MathUtil = {})); | ||
| 324 | - // # sourceMappingURL=data:application/json;base64, ... | ||
| 325 | - ``` | ||
| 326 | - | ||
| 327 | - ```cjs | ||
| 328 | - const { stripTypeScriptTypes } = require('node:module'); | ||
| 329 | - const code = ` | ||
| 330 | - namespace MathUtil { | ||
| 331 | - export const add = (a: number, b: number) => a + b; | ||
| 332 | - }`; | ||
| 333 | - const strippedCode = stripTypeScriptTypes(code, { mode: 'transform', sourceMap: true }); | ||
| 334 | - console.log(strippedCode); | ||
| 335 | - // Prints: | ||
| 336 | - // var MathUtil; | ||
| 337 | - // (function(MathUtil) { | ||
| 338 | - // MathUtil.add = (a, b)=>a + b; | ||
| 339 | - // })(MathUtil || (MathUtil = {})); | ||
| 340 | - // # sourceMappingURL=data:application/json;base64, ... | ||
| 341 | - ``` | ||
| 342 | - | ||
| 343 | 306 | ### `module.syncBuiltinESMExports()` | |
| 344 | 307 | ||
| 345 | 308 | <!-- YAML | |
@@ -2041,5 +2004,4 @@ returned object contains the following keys: | |||
| 2041 | 2004 | [synchronous hook functions]: #hook-functions-accepted-by-moduleregisterhooks | |
| 2042 | 2005 | [the documentation of `Worker`]: worker_threads.md#new-workerfilename-options | |
| 2043 | 2006 | [transferable objects]: worker_threads.md#portpostmessagevalue-transferlist | |
| 2044 | - [transform TypeScript features]: typescript.md#typescript-features | ||
| 2045 | 2007 | [type-stripping]: typescript.md#type-stripping | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2002,6 +2002,9 @@ added: | |||
| 2002 | 2002 | - v23.0.0 | |
| 2003 | 2003 | - v22.10.0 | |
| 2004 | 2004 | changes: | |
| 2005 | + - version: REPLACEME | ||
| 2006 | + pr-url: https://github.com/nodejs/node/pull/61803 | ||
| 2007 | + description: Removed `transform` value. | ||
| 2005 | 2008 | - version: | |
| 2006 | 2009 | - v25.2.0 | |
| 2007 | 2010 | - v24.12.0 | |
@@ -2013,8 +2016,7 @@ changes: | |||
| 2013 | 2016 | ||
| 2014 | 2017 | * Type: {boolean|string} | |
| 2015 | 2018 | ||
| 2016 | - A value that is `"strip"` by default, | ||
| 2017 | - `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if | ||
| 2019 | + A value that is `"strip"` by default, and `false` if | ||
| 2018 | 2020 | Node.js is run with `--no-strip-types`. | |
| 2019 | 2021 | ||
| 2020 | 2022 | ## `process.features.uv` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | 3 | <!-- YAML | |
| 4 | 4 | changes: | |
| 5 | + - version: REPLACEME | ||
| 6 | + pr-url: https://github.com/nodejs/node/pull/61803 | ||
| 7 | + description: Removed `--experimental-transform-types` flag. | ||
| 5 | 8 | - version: | |
| 6 | 9 | - v25.2.0 | |
| 7 | 10 | - v24.12.0 | |
@@ -77,8 +80,6 @@ By default Node.js will execute TypeScript files that contains only | |||
| 77 | 80 | erasable TypeScript syntax. | |
| 78 | 81 | Node.js will replace TypeScript syntax with whitespace, | |
| 79 | 82 | and no type checking is performed. | |
| 80 | - To enable the transformation of non erasable TypeScript syntax, which requires JavaScript code generation, | ||
| 81 | - such as `enum` declarations, parameter properties use the flag [`--experimental-transform-types`][]. | ||
| 82 | 83 | To disable this feature, use the flag [`--no-strip-types`][]. | |
| 83 | 84 | ||
| 84 | 85 | Node.js ignores `tsconfig.json` files and therefore | |
@@ -139,8 +140,7 @@ include the `.ts` extension. | |||
| 139 | 140 | ### TypeScript features | |
| 140 | 141 | ||
| 141 | 142 | Since Node.js is only removing inline types, any TypeScript features that | |
| 142 | - involve _replacing_ TypeScript syntax with new JavaScript syntax will error, | ||
| 143 | - unless the flag [`--experimental-transform-types`][] is passed. | ||
| 143 | + involve _replacing_ TypeScript syntax with new JavaScript syntax will error. | ||
| 144 | 144 | ||
| 145 | 145 | The most prominent features that require transformation are: | |
| 146 | 146 | ||
@@ -210,8 +210,6 @@ TypeScript syntax is unsupported in the REPL, `--check`, and | |||
| 210 | 210 | ||
| 211 | 211 | Since inline types are replaced by whitespace, source maps are unnecessary for | |
| 212 | 212 | correct line numbers in stack traces; and Node.js does not generate them. | |
| 213 | - When [`--experimental-transform-types`][] is enabled, source-maps | ||
| 214 | - are enabled by default. | ||
| 215 | 213 | ||
| 216 | 214 | ### Type stripping in dependencies | |
| 217 | 215 | ||
@@ -228,7 +226,6 @@ with `#`. | |||
| 228 | 226 | [CommonJS]: modules.md | |
| 229 | 227 | [ES Modules]: esm.md | |
| 230 | 228 | [Full TypeScript support]: #full-typescript-support | |
| 231 | - [`--experimental-transform-types`]: cli.md#--experimental-transform-types | ||
| 232 | 229 | [`--no-strip-types`]: cli.md#--no-strip-types | |
| 233 | 230 | [`ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`]: errors.md#err_unsupported_typescript_syntax | |
| 234 | 231 | [`tsconfig` "paths"]: https://www.typescriptlang.org/tsconfig/#paths | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -679,8 +679,7 @@ anotherFunction(); | |||
| 679 | 679 | ||
| 680 | 680 | It is possible to reconstruct the original locations by setting the option `sourceMap` to `true`. | |
| 681 | 681 | If the source map is not available, the original location will be the same as the current location. | |
| 682 | - When the `--enable-source-maps` flag is enabled, for example when using `--experimental-transform-types`, | ||
| 683 | - `sourceMap` will be true by default. | ||
| 682 | + When the `--enable-source-maps` flag is enabled,`sourceMap` will be true by default. | ||
| 684 | 683 | ||
| 685 | 684 | ```ts | |
| 686 | 685 | import { getCallSites } from 'node:util'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -213,10 +213,6 @@ | |||
| 213 | 213 | "type": "boolean", | |
| 214 | 214 | "description": "experimental node:sqlite module" | |
| 215 | 215 | }, | |
| 216 | - "experimental-transform-types": { | ||
| 217 | - "type": "boolean", | ||
| 218 | - "description": "enable transformation of TypeScript-onlysyntax into JavaScript code" | ||
| 219 | - }, | ||
| 220 | 216 | "experimental-vm-modules": { | |
| 221 | 217 | "type": "boolean", | |
| 222 | 218 | "description": "experimental ES Module support in vm module" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -741,10 +741,6 @@ collecting code coverage from tests for more details. | |||
| 741 | 741 | Enable module mocking in the test runner. | |
| 742 | 742 | This feature requires \fB--allow-worker\fR if used with the Permission Model. | |
| 743 | 743 | . | |
| 744 | - .It Fl -experimental-transform-types | ||
| 745 | - Enables the transformation of TypeScript-only syntax into JavaScript code. | ||
| 746 | - Implies \fB--enable-source-maps\fR. | ||
| 747 | - . | ||
| 748 | 744 | .It Fl -experimental-vm-modules | |
| 749 | 745 | Enable experimental ES Module support in the \fBnode:vm\fR module. | |
| 750 | 746 | . | |
@@ -1883,8 +1879,6 @@ one is included in the list below. | |||
| 1883 | 1879 | .It | |
| 1884 | 1880 | \fB--experimental-top-level-await\fR | |
| 1885 | 1881 | .It | |
| 1886 | - \fB--experimental-transform-types\fR | ||
| 1887 | - .It | ||
| 1888 | 1882 | \fB--experimental-vm-modules\fR | |
| 1889 | 1883 | .It | |
| 1890 | 1884 | \fB--experimental-wasi-unstable-preview1\fR | |
| Back | FazBrowse Home | New Git URL |
0 commit comments