| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9a4052c commit c975384
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | const common = require('../common.js'); | |
| 4 | 4 | const crypto = require('crypto'); | |
| 5 | 5 | const http = require('http'); | |
| 6 | - const { WebSocket } = require('../../deps/undici/undici'); | ||
| 7 | 6 | ||
| 8 | 7 | const GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; | |
| 9 | 8 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -949,16 +949,6 @@ added: v12.3.0 | |||
| 949 | 949 | ||
| 950 | 950 | Enable experimental WebAssembly module support. | |
| 951 | 951 | ||
| 952 | - ### `--experimental-websocket` | ||
| 953 | - | ||
| 954 | - <!-- YAML | ||
| 955 | - added: | ||
| 956 | - - v21.0.0 | ||
| 957 | - - v20.10.0 | ||
| 958 | - --> | ||
| 959 | - | ||
| 960 | - Enable experimental [`WebSocket`][] support. | ||
| 961 | - | ||
| 962 | 952 | ### `--force-context-aware` | |
| 963 | 953 | ||
| 964 | 954 | <!-- YAML | |
@@ -1377,6 +1367,14 @@ added: v16.6.0 | |||
| 1377 | 1367 | ||
| 1378 | 1368 | Use this flag to disable top-level await in REPL. | |
| 1379 | 1369 | ||
| 1370 | + ### `--no-experimental-websocket` | ||
| 1371 | + | ||
| 1372 | + <!-- YAML | ||
| 1373 | + added: REPLACEME | ||
| 1374 | + --> | ||
| 1375 | + | ||
| 1376 | + Use this flag to disable experimental [`WebSocket`][] support. | ||
| 1377 | + | ||
| 1380 | 1378 | ### `--no-extra-info-on-fatal-exception` | |
| 1381 | 1379 | ||
| 1382 | 1380 | <!-- YAML | |
@@ -2511,7 +2509,6 @@ Node.js options that are allowed are: | |||
| 2511 | 2509 | * `--experimental-vm-modules` | |
| 2512 | 2510 | * `--experimental-wasi-unstable-preview1` | |
| 2513 | 2511 | * `--experimental-wasm-modules` | |
| 2514 | - * `--experimental-websocket` | ||
| 2515 | 2512 | * `--force-context-aware` | |
| 2516 | 2513 | * `--force-fips` | |
| 2517 | 2514 | * `--force-node-api-uncaught-exceptions-policy` | |
@@ -2536,6 +2533,7 @@ Node.js options that are allowed are: | |||
| 2536 | 2533 | * `--no-experimental-global-navigator` | |
| 2537 | 2534 | * `--no-experimental-global-webcrypto` | |
| 2538 | 2535 | * `--no-experimental-repl-await` | |
| 2536 | + * `--no-experimental-websocket` | ||
| 2539 | 2537 | * `--no-extra-info-on-fatal-exception` | |
| 2540 | 2538 | * `--no-force-async-hooks-checks` | |
| 2541 | 2539 | * `--no-global-search-paths` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1097,12 +1097,16 @@ The object that acts as the namespace for all W3C | |||
| 1097 | 1097 | added: | |
| 1098 | 1098 | - v21.0.0 | |
| 1099 | 1099 | - v20.10.0 | |
| 1100 | + changes: | ||
| 1101 | + - version: REPLACEME | ||
| 1102 | + pr-url: https://github.com/nodejs/node/pull/51594 | ||
| 1103 | + description: No longer behind `--experimental-websocket` CLI flag. | ||
| 1100 | 1104 | --> | |
| 1101 | 1105 | ||
| 1102 | 1106 | > Stability: 1 - Experimental. | |
| 1103 | 1107 | ||
| 1104 | - A browser-compatible implementation of [`WebSocket`][]. Enable this API | ||
| 1105 | - with the [`--experimental-websocket`][] CLI flag. | ||
| 1108 | + A browser-compatible implementation of [`WebSocket`][]. Disable this API | ||
| 1109 | + with the [`--no-experimental-websocket`][] CLI flag. | ||
| 1106 | 1110 | ||
| 1107 | 1111 | ## Class: `WritableStream` | |
| 1108 | 1112 | ||
@@ -1139,10 +1143,10 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. | |||
| 1139 | 1143 | [Navigator API]: https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object | |
| 1140 | 1144 | [RFC 5646]: https://www.rfc-editor.org/rfc/rfc5646.txt | |
| 1141 | 1145 | [Web Crypto API]: webcrypto.md | |
| 1142 | - [`--experimental-websocket`]: cli.md#--experimental-websocket | ||
| 1143 | 1146 | [`--no-experimental-global-customevent`]: cli.md#--no-experimental-global-customevent | |
| 1144 | 1147 | [`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator | |
| 1145 | 1148 | [`--no-experimental-global-webcrypto`]: cli.md#--no-experimental-global-webcrypto | |
| 1149 | + [`--no-experimental-websocket`]: cli.md#--no-experimental-websocket | ||
| 1146 | 1150 | [`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController | |
| 1147 | 1151 | [`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy | |
| 1148 | 1152 | [`CompressionStream`]: webstreams.md#class-compressionstream | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -186,12 +186,12 @@ Use this flag to enable ShadowRealm support. | |||
| 186 | 186 | .It Fl -experimental-test-coverage | |
| 187 | 187 | Enable code coverage in the test runner. | |
| 188 | 188 | . | |
| 189 | - .It Fl -experimental-websocket | ||
| 190 | - Enable experimental support for the WebSocket API. | ||
| 191 | - . | ||
| 192 | 189 | .It Fl -no-experimental-fetch | |
| 193 | 190 | Disable experimental support for the Fetch API. | |
| 194 | 191 | . | |
| 192 | + .It Fl -no-experimental-websocket | ||
| 193 | + Disable experimental support for the WebSocket API. | ||
| 194 | + . | ||
| 195 | 195 | .It Fl -no-experimental-global-customevent | |
| 196 | 196 | Disable exposition of the CustomEvent on the global scope. | |
| 197 | 197 | . | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,6 +92,9 @@ exposeLazyInterfaces(globalThis, 'internal/deps/undici/undici', [ | |||
| 92 | 92 | 'FormData', 'Headers', 'Request', 'Response', | |
| 93 | 93 | ]); | |
| 94 | 94 | ||
| 95 | + // https://websockets.spec.whatwg.org/ | ||
| 96 | + exposeLazyInterfaces(globalThis, 'internal/deps/undici/undici', ['WebSocket']); | ||
| 97 | + | ||
| 95 | 98 | // The WebAssembly Web API which relies on Response. | |
| 96 | 99 | // https:// webassembly.github.io/spec/web-api/#streaming-modules | |
| 97 | 100 | internalBinding('wasm_web_api').setImplementation((streamState, source) => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -315,8 +315,8 @@ function setupUndici() { | |||
| 315 | 315 | delete globalThis.Response; | |
| 316 | 316 | } | |
| 317 | 317 | ||
| 318 | - if (!getEmbedderOptions().noBrowserGlobals && getOptionValue('--experimental-websocket')) { | ||
| 319 | - exposeLazyInterfaces(globalThis, 'internal/deps/undici/undici', ['WebSocket']); | ||
| 318 | + if (getOptionValue('--no-experimental-websocket')) { | ||
| 319 | + delete globalThis.WebSocket; | ||
| 320 | 320 | } | |
| 321 | 321 | } | |
| 322 | 322 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -108,7 +108,7 @@ class EnvironmentOptions : public Options { | |||
| 108 | 108 | std::string dns_result_order; | |
| 109 | 109 | bool enable_source_maps = false; | |
| 110 | 110 | bool experimental_fetch = true; | |
| 111 | - bool experimental_websocket = false; | ||
| 111 | + bool experimental_websocket = true; | ||
| 112 | 112 | bool experimental_global_customevent = true; | |
| 113 | 113 | bool experimental_global_navigator = true; | |
| 114 | 114 | bool experimental_global_web_crypto = true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -369,9 +369,6 @@ if (global.ReadableStream) { | |||
| 369 | 369 | global.DecompressionStream, | |
| 370 | 370 | ); | |
| 371 | 371 | } | |
| 372 | - if (global.WebSocket) { | ||
| 373 | - knownGlobals.push(WebSocket); | ||
| 374 | - } | ||
| 375 | 372 | ||
| 376 | 373 | function allowGlobals(...allowlist) { | |
| 377 | 374 | knownGlobals = knownGlobals.concat(allowlist); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + // Flags: --no-experimental-websocket | ||
| 2 | + 'use strict'; | ||
| 3 | + | ||
| 4 | + require('../common'); | ||
| 5 | + const assert = require('assert'); | ||
| 6 | + | ||
| 7 | + assert.strictEqual(typeof WebSocket, 'undefined'); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,3 @@ | |||
| 1 | - // Flags: --experimental-websocket | ||
| 2 | 1 | 'use strict'; | |
| 3 | 2 | ||
| 4 | 3 | require('../common'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments