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

cli: remove --no-experimental-fetch flag #52611

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1362,14 +1362,6 @@ added: v0.8.0

Silence deprecation warnings.

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

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

Disable exposition of [Fetch API][] on the global scope.

### `--no-experimental-global-customevent`

<!-- YAML
Expand Down Expand Up @@ -2688,7 +2680,6 @@ one is included in the list below.
* `--network-family-autoselection-attempt-timeout`
* `--no-addons`
* `--no-deprecation`
* `--no-experimental-fetch`
* `--no-experimental-global-customevent`
* `--no-experimental-global-navigator`
* `--no-experimental-repl-await`
Expand Down Expand Up @@ -3164,7 +3155,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
[DEP0025 warning]: deprecations.md#dep0025-requirenodesys
[ECMAScript module]: esm.md#modules-ecmascript-modules
[ExperimentalWarning: `vm.measureMemory` is an experimental feature]: vm.md#vmmeasurememoryoptions
[Fetch API]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
[File System Permissions]: permissions.md#file-system-permissions
[Loading ECMAScript modules using `require()`]: modules.md#loading-ecmascript-modules-using-require
[Module customization hooks]: module.md#customization-hooks
Expand Down
3 changes: 0 additions & 3 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ Use this flag to enable ShadowRealm support.
.It Fl -experimental-test-coverage
Enable code coverage in the test runner.
.
.It Fl -no-experimental-fetch
Disable experimental support for the Fetch API.
.
.It Fl -no-experimental-websocket
Disable experimental support for the WebSocket API.
.
Expand Down
13 changes: 2 additions & 11 deletions lib/internal/process/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function prepareExecution(options) {
setupInspectorHooks();
setupNavigator();
setupWarningHandler();
setupUndici();
setupWebsocket();
setupCustomEvent();
setupCodeCoverage();
setupDebugEnv();
Expand Down Expand Up @@ -308,17 +308,8 @@ function setupWarningHandler() {
}
}

// https://fetch.spec.whatwg.org/
// https://websockets.spec.whatwg.org/
function setupUndici() {
if (getOptionValue('--no-experimental-fetch')) {
delete globalThis.fetch;
delete globalThis.FormData;
delete globalThis.Headers;
delete globalThis.Request;
delete globalThis.Response;
}

function setupWebsocket() {
if (getOptionValue('--no-experimental-websocket')) {
delete globalThis.WebSocket;
}
Expand Down
6 changes: 1 addition & 5 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,7 @@ 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-fetch", "", NoOp{}, kAllowedInEnvvar);
AddOption("--experimental-websocket",
"experimental WebSocket API",
&EnvironmentOptions::experimental_websocket,
Expand Down
13 changes: 0 additions & 13 deletions test/parallel/test-fetch-disabled.mjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const undocumented = difference(process.allowedNodeEnvironmentFlags,
assert(undocumented.delete('--debug-arraybuffer-allocations'));
assert(undocumented.delete('--no-debug-arraybuffer-allocations'));
assert(undocumented.delete('--es-module-specifier-resolution'));
assert(undocumented.delete('--experimental-fetch'));
assert(undocumented.delete('--experimental-global-webcrypto'));
assert(undocumented.delete('--experimental-report'));
assert(undocumented.delete('--experimental-worker'));
Expand Down
Loading