Skip to content

Commit 057e591

Browse files
authored
lib,src: remove --no-experimental-websocket CLI flag
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65284 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 857e438 commit 057e591

6 files changed

Lines changed: 13 additions & 41 deletions

File tree

‎doc/api/cli.md‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,14 +2147,6 @@ changes:
21472147

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

2150-
### `--no-experimental-websocket`
2151-
2152-
<!-- YAML
2153-
added: v22.0.0
2154-
-->
2155-
2156-
Disable exposition of {WebSocket} on the global scope.
2157-
21582150
### `--no-experimental-webstorage`
21592151

21602152
<!-- YAML
@@ -3911,6 +3903,7 @@ one is included in the list below.
39113903
* `--experimental-vm-modules`
39123904
* `--experimental-wasi-unstable-preview1`
39133905
* `--experimental-web-worker`
3906+
* `--experimental-websocket`
39143907
* `--force-context-aware`
39153908
* `--force-fips`
39163909
* `--force-node-api-uncaught-exceptions-policy`
@@ -3941,7 +3934,6 @@ one is included in the list below.
39413934
* `--no-experimental-global-navigator`
39423935
* `--no-experimental-sqlite`
39433936
* `--no-experimental-strip-types`
3944-
* `--no-experimental-websocket`
39453937
* `--no-experimental-webstorage`
39463938
* `--no-extra-info-on-fatal-exception`
39473939
* `--no-force-async-hooks-checks`

‎doc/api/globals.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,13 @@ added: v0.0.1
334334

335335
<!-- YAML
336336
added: v23.0.0
337+
changes:
338+
- version: REPLACEME
339+
pr-url: https://github.com/nodejs/node/pull/65284
340+
description: No longer disableable with the `--no-experimental-websocket` CLI flag.
337341
-->
338342

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

342345
## Class: `CompressionStream`
343346

@@ -1299,6 +1302,9 @@ added:
12991302
- v21.0.0
13001303
- v20.10.0
13011304
changes:
1305+
- version: REPLACEME
1306+
pr-url: https://github.com/nodejs/node/pull/65284
1307+
description: No longer disableable with the `--no-experimental-websocket` CLI flag.
13021308
- version: v22.4.0
13031309
pr-url: https://github.com/nodejs/node/pull/53352
13041310
description: No longer experimental.
@@ -1307,8 +1313,7 @@ changes:
13071313
description: No longer behind `--experimental-websocket` CLI flag.
13081314
-->
13091315

1310-
A browser-compatible implementation of {WebSocket}. Disable this API
1311-
with the [`--no-experimental-websocket`][] CLI flag.
1316+
A browser-compatible implementation of {WebSocket}.
13121317

13131318
## Class: `Worker`
13141319

@@ -1462,7 +1467,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
14621467
[`--experimental-web-worker`]: cli.md#--experimental-web-worker
14631468
[`--localstorage-file`]: cli.md#--localstorage-filefile
14641469
[`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator
1465-
[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket
14661470
[`--no-experimental-webstorage`]: cli.md#--no-experimental-webstorage
14671471
[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
14681472
[`CompressionStream`]: webstreams.md#class-compressionstream

‎doc/node.1‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,9 +1110,6 @@ Legacy alias for \fB--no-require-module\fR.
11101110
.It Fl -no-experimental-sqlite
11111111
Disable the experimental \fBnode:sqlite\fR module.
11121112
.
1113-
.It Fl -no-experimental-websocket
1114-
Disable exposition of \fB<WebSocket>\fR on the global scope.
1115-
.
11161113
.It Fl -no-experimental-webstorage
11171114
Disable \fBWeb Storage\fR support.
11181115
.
@@ -2032,6 +2029,8 @@ one is included in the list below.
20322029
.It
20332030
\fB--experimental-web-worker\fR
20342031
.It
2032+
\fB--experimental-websocket\fR
2033+
.It
20352034
\fB--force-context-aware\fR
20362035
.It
20372036
\fB--force-fips\fR
@@ -2092,8 +2091,6 @@ one is included in the list below.
20922091
.It
20932092
\fB--no-experimental-strip-types\fR
20942093
.It
2095-
\fB--no-experimental-websocket\fR
2096-
.It
20972094
\fB--no-experimental-webstorage\fR
20982095
.It
20992096
\fB--no-extra-info-on-fatal-exception\fR

‎lib/internal/process/pre_execution.js‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ function prepareExecution(options) {
122122
setupQuic();
123123
setupWebStorage();
124124
removeWebWorkersIfDisabled();
125-
setupWebsocket();
126125
setupEventsource();
127126
setupCodeCoverage();
128127
setupDebugEnv();
@@ -358,14 +357,6 @@ function setupWarningHandler() {
358357
}
359358
}
360359

361-
// https://websockets.spec.whatwg.org/
362-
function setupWebsocket() {
363-
if (getOptionValue('--no-experimental-websocket')) {
364-
delete globalThis.WebSocket;
365-
delete globalThis.CloseEvent;
366-
}
367-
}
368-
369360
// https://html.spec.whatwg.org/multipage/workers.html
370361
function removeWebWorkersIfDisabled() {
371362
if (!getOptionValue('--experimental-web-worker')) {

‎src/node_options.cc‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
600600
BOOL_FIELD(experimental_web_worker),
601601
kAllowedInEnvvar,
602602
false);
603-
AddOption("--experimental-websocket",
604-
"experimental WebSocket API",
605-
BOOL_FIELD(experimental_websocket),
606-
kAllowedInEnvvar,
607-
true);
603+
AddOption("--experimental-websocket", "", NoOp{}, kAllowedInEnvvar);
608604
AddOption("--experimental-global-customevent", "", NoOp{}, kAllowedInEnvvar);
609605
AddOption("--experimental-sqlite",
610606
"experimental node:sqlite module",

‎test/parallel/test-websocket-disabled.js‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)