diff --git a/doc/api/cli.md b/doc/api/cli.md index e213d055b8e9..cb94c9ebf91e 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2139,14 +2139,6 @@ changes: Disable the experimental [`node:sqlite`][] module. -### `--no-experimental-websocket` - - - -Disable exposition of {WebSocket} on the global scope. - ### `--no-experimental-webstorage` -A browser-compatible implementation of {CloseEvent}. Disable this API -with the [`--no-experimental-websocket`][] CLI flag. +A browser-compatible implementation of {CloseEvent}. ## Class: `CompressionStream` @@ -1299,6 +1302,9 @@ added: - v21.0.0 - v20.10.0 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/65284 + description: No longer disableable with the `--no-experimental-websocket` CLI flag. - version: v22.4.0 pr-url: https://github.com/nodejs/node/pull/53352 description: No longer experimental. @@ -1307,8 +1313,7 @@ changes: description: No longer behind `--experimental-websocket` CLI flag. --> -A browser-compatible implementation of {WebSocket}. Disable this API -with the [`--no-experimental-websocket`][] CLI flag. +A browser-compatible implementation of {WebSocket}. ## Class: `WritableStream` @@ -1361,7 +1366,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. [`--experimental-eventsource`]: cli.md#--experimental-eventsource [`--localstorage-file`]: cli.md#--localstorage-filefile [`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator -[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket [`--no-experimental-webstorage`]: cli.md#--no-experimental-webstorage [`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy [`CompressionStream`]: webstreams.md#class-compressionstream diff --git a/doc/node.1 b/doc/node.1 index 4af724f56419..15d1edb4e881 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -1107,9 +1107,6 @@ Legacy alias for \fB--no-require-module\fR. .It Fl -no-experimental-sqlite Disable the experimental \fBnode:sqlite\fR module. . -.It Fl -no-experimental-websocket -Disable exposition of \fB\fR on the global scope. -. .It Fl -no-experimental-webstorage Disable \fBWeb Storage\fR support. . @@ -2022,6 +2019,8 @@ one is included in the list below. .It \fB--experimental-wasi-unstable-preview1\fR .It +\fB--experimental-websocket\fR +.It \fB--force-context-aware\fR .It \fB--force-fips\fR @@ -2082,8 +2081,6 @@ one is included in the list below. .It \fB--no-experimental-strip-types\fR .It -\fB--no-experimental-websocket\fR -.It \fB--no-experimental-webstorage\fR .It \fB--no-extra-info-on-fatal-exception\fR diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js index 9d5891e7a24a..82d4604dd62f 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js @@ -121,7 +121,6 @@ function prepareExecution(options) { setupVfs(); setupQuic(); setupWebStorage(); - setupWebsocket(); setupEventsource(); setupCodeCoverage(); setupDebugEnv(); @@ -352,14 +351,6 @@ function setupWarningHandler() { } } -// https://websockets.spec.whatwg.org/ -function setupWebsocket() { - if (getOptionValue('--no-experimental-websocket')) { - delete globalThis.WebSocket; - delete globalThis.CloseEvent; - } -} - // https://html.spec.whatwg.org/multipage/server-sent-events.html function setupEventsource() { if (!getOptionValue('--experimental-eventsource')) { diff --git a/src/node_options.cc b/src/node_options.cc index fedd2cd792d2..0e420ffe98e0 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -595,11 +595,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { kAllowedInEnvvar, false); #endif // HAVE_FFI - AddOption("--experimental-websocket", - "experimental WebSocket API", - BOOL_FIELD(experimental_websocket), - kAllowedInEnvvar, - true); + AddOption("--experimental-websocket", "", NoOp{}, kAllowedInEnvvar); AddOption("--experimental-global-customevent", "", NoOp{}, kAllowedInEnvvar); AddOption("--experimental-sqlite", "experimental node:sqlite module", diff --git a/test/parallel/test-websocket-disabled.js b/test/parallel/test-websocket-disabled.js deleted file mode 100644 index ae8a761b1d66..000000000000 --- a/test/parallel/test-websocket-disabled.js +++ /dev/null @@ -1,8 +0,0 @@ -// Flags: --no-experimental-websocket -'use strict'; - -require('../common'); -const assert = require('assert'); - -assert.strictEqual(typeof WebSocket, 'undefined'); -assert.strictEqual(typeof CloseEvent, 'undefined');