Skip to content
Open
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: 1 addition & 9 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2139,14 +2139,6 @@ changes:

Disable the experimental [`node:sqlite`][] module.

### `--no-experimental-websocket`

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

Disable exposition of {WebSocket} on the global scope.

### `--no-experimental-webstorage`

<!-- YAML
Expand Down Expand Up @@ -3889,6 +3881,7 @@ one is included in the list below.
* `--experimental-vfs`
* `--experimental-vm-modules`
* `--experimental-wasi-unstable-preview1`
* `--experimental-websocket`
* `--force-context-aware`
* `--force-fips`
* `--force-node-api-uncaught-exceptions-policy`
Expand Down Expand Up @@ -3919,7 +3912,6 @@ one is included in the list below.
* `--no-experimental-global-navigator`
* `--no-experimental-sqlite`
* `--no-experimental-strip-types`
* `--no-experimental-websocket`
* `--no-experimental-webstorage`
* `--no-extra-info-on-fatal-exception`
* `--no-force-async-hooks-checks`
Expand Down
14 changes: 9 additions & 5 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,13 @@ added: v0.0.1

<!-- YAML
added: v23.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/65284
description: No longer disableable with the `--no-experimental-websocket` CLI flag.
-->

A browser-compatible implementation of {CloseEvent}. Disable this API
with the [`--no-experimental-websocket`][] CLI flag.
A browser-compatible implementation of {CloseEvent}.

## Class: `CompressionStream`

Expand Down Expand Up @@ -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.
Expand All @@ -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`

Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -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<WebSocket>\fR on the global scope.
.
.It Fl -no-experimental-webstorage
Disable \fBWeb Storage\fR support.
.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions lib/internal/process/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ function prepareExecution(options) {
setupVfs();
setupQuic();
setupWebStorage();
setupWebsocket();
setupEventsource();
setupCodeCoverage();
setupDebugEnv();
Expand Down Expand Up @@ -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')) {
Expand Down
6 changes: 1 addition & 5 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 0 additions & 8 deletions test/parallel/test-websocket-disabled.js

This file was deleted.

Loading