Skip to content

Commit

Permalink
lib: drop fetch experimental warning
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Nov 2, 2022
1 parent 86088ab commit 8949145
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 38 deletions.
9 changes: 0 additions & 9 deletions doc/api/cli.md
Expand Up @@ -385,14 +385,6 @@ added: v11.8.0

Use the specified file as a security policy.

### `--no-experimental-fetch`

<!-- YAML
added: v18.0.0
-->

Disable experimental support for the [Fetch API][].

### `--no-experimental-global-webcrypto`

<!-- YAML
Expand Down Expand Up @@ -2267,7 +2259,6 @@ done
[CustomEvent Web API]: https://dom.spec.whatwg.org/#customevent
[ECMAScript module]: esm.md#modules-ecmascript-modules
[ECMAScript module loader]: esm.md#loaders
[Fetch API]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
[Modules loaders]: packages.md#modules-loaders
[Node.js issue tracker]: https://github.com/nodejs/node/issues
[OSSL_PROVIDER-legacy]: https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html
Expand Down
28 changes: 20 additions & 8 deletions doc/api/globals.md
Expand Up @@ -464,12 +464,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 the [`fetch()`][] function.
Expand All @@ -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}.
Expand All @@ -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}.
Expand Down Expand Up @@ -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}.

Expand All @@ -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}.

Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions lib/internal/process/pre_execution.js
Expand Up @@ -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;
}

Expand All @@ -236,7 +235,6 @@ function setupFetch() {
}

async function fetch(input, init = undefined) {
emitExperimentalWarning('The Fetch API');
return lazyUndici().fetch(input, init);
}

Expand Down
5 changes: 0 additions & 5 deletions src/node_options.cc
Expand Up @@ -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,
Expand Down
13 changes: 0 additions & 13 deletions test/parallel/test-fetch-disabled.mjs

This file was deleted.

0 comments on commit 8949145

Please sign in to comment.