From 8949145e94af160abf5dab1c6aaaddf8fa3aa8da Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Wed, 2 Nov 2022 18:11:01 +0100 Subject: [PATCH] lib: drop fetch experimental warning Signed-off-by: Matteo Collina --- doc/api/cli.md | 9 --------- doc/api/globals.md | 28 +++++++++++++++++++-------- lib/internal/process/pre_execution.js | 4 +--- src/node_options.cc | 5 ----- test/parallel/test-fetch-disabled.mjs | 13 ------------- 5 files changed, 21 insertions(+), 38 deletions(-) delete mode 100644 test/parallel/test-fetch-disabled.mjs diff --git a/doc/api/cli.md b/doc/api/cli.md index 1f18552dd0cb3b..1ffc7387d0d90a 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -385,14 +385,6 @@ added: v11.8.0 Use the specified file as a security policy. -### `--no-experimental-fetch` - - - -Disable experimental support for the [Fetch API][]. - ### `--no-experimental-global-webcrypto` -> Stability: 1 - Experimental. Disable this API with the [`--no-experimental-fetch`][] +> Stability: 1 - Experimental. > CLI flag. A browser-compatible implementation of the [`fetch()`][] function. @@ -481,12 +484,15 @@ added: - v17.6.0 - v16.15.0 changes: + - version: REPLACEME + pr-url: REPLACEME + description: removed --experimental-global-fetch. - version: v18.0.0 pr-url: https://github.com/nodejs/node/pull/41811 description: No longer behind `--experimental-global-fetch` CLI flag. --> -> Stability: 1 - Experimental. Disable this API with the [`--no-experimental-fetch`][] +> Stability: 1 - Experimental. > CLI flag. A browser-compatible implementation of {FormData}. @@ -513,12 +519,15 @@ added: - v17.5.0 - v16.15.0 changes: + - version: REPLACEME + pr-url: REPLACEME + description: removed --experimental-global-fetch. - version: v18.0.0 pr-url: https://github.com/nodejs/node/pull/41811 description: No longer behind `--experimental-global-fetch` CLI flag. --> -> Stability: 1 - Experimental. Disable this API with the [`--no-experimental-fetch`][] +> Stability: 1 - Experimental. > CLI flag. A browser-compatible implementation of {Headers}. @@ -750,13 +759,15 @@ added: - v17.5.0 - v16.15.0 changes: + - version: REPLACEME + pr-url: REPLACEME + description: removed --experimental-global-fetch. - version: v18.0.0 pr-url: https://github.com/nodejs/node/pull/41811 description: No longer behind `--experimental-global-fetch` CLI flag. --> -> Stability: 1 - Experimental. Disable this API with the [`--no-experimental-fetch`][] -> CLI flag. +> Stability: 1 - Experimental. A browser-compatible implementation of {Response}. @@ -767,13 +778,15 @@ added: - v17.5.0 - v16.15.0 changes: + - version: REPLACEME + pr-url: REPLACEME + description: removed --experimental-global-fetch. - version: v18.0.0 pr-url: https://github.com/nodejs/node/pull/41811 description: No longer behind `--experimental-global-fetch` CLI flag. --> -> Stability: 1 - Experimental. Disable this API with the [`--no-experimental-fetch`][] -> CLI flag. +> Stability: 1 - Experimental. A browser-compatible implementation of {Request}. @@ -971,7 +984,6 @@ added: v18.0.0 A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. [Web Crypto API]: webcrypto.md -[`--no-experimental-fetch`]: cli.md#--no-experimental-fetch [`--no-experimental-global-customevent`]: cli.md#--no-experimental-global-customevent [`--no-experimental-global-webcrypto`]: cli.md#--no-experimental-global-webcrypto [`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js index 0680e06f312b84..e35e9f38e8eef0 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js @@ -220,8 +220,7 @@ function setupWarningHandler() { // https://fetch.spec.whatwg.org/ function setupFetch() { - if (process.config.variables.node_no_browser_globals || - getOptionValue('--no-experimental-fetch')) { + if (process.config.variables.node_no_browser_globals) { return; } @@ -236,7 +235,6 @@ function setupFetch() { } async function fetch(input, init = undefined) { - emitExperimentalWarning('The Fetch API'); return lazyUndici().fetch(input, init); } diff --git a/src/node_options.cc b/src/node_options.cc index ce353bbcf5cbbf..321ffaece62385 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -351,11 +351,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { &EnvironmentOptions::enable_source_maps, kAllowedInEnvvar); AddOption("--experimental-abortcontroller", "", NoOp{}, kAllowedInEnvvar); - AddOption("--experimental-fetch", - "experimental Fetch API", - &EnvironmentOptions::experimental_fetch, - kAllowedInEnvvar, - true); AddOption("--experimental-global-customevent", "expose experimental CustomEvent on the global scope", &EnvironmentOptions::experimental_global_customevent, diff --git a/test/parallel/test-fetch-disabled.mjs b/test/parallel/test-fetch-disabled.mjs deleted file mode 100644 index ea6b6807d8dbb5..00000000000000 --- a/test/parallel/test-fetch-disabled.mjs +++ /dev/null @@ -1,13 +0,0 @@ -// Flags: --no-experimental-fetch -import '../common/index.mjs'; - -import assert from 'assert'; - -assert.strictEqual(typeof globalThis.fetch, 'undefined'); -assert.strictEqual(typeof globalThis.FormData, 'undefined'); -assert.strictEqual(typeof globalThis.Headers, 'undefined'); -assert.strictEqual(typeof globalThis.Request, 'undefined'); -assert.strictEqual(typeof globalThis.Response, 'undefined'); - -assert.strictEqual(typeof WebAssembly.compileStreaming, 'undefined'); -assert.strictEqual(typeof WebAssembly.instantiateStreaming, 'undefined');