Skip to content

Commit f7e73cd

Browse files
authored
cli: remove --no-experimental-global-customevent flag
Signed-off-by: Daeyeon Jeong <[email protected]> PR-URL: #52723 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent 81a9a97 commit f7e73cd

10 files changed

+8
-42
lines changed

doc/api/cli.md

-10
Original file line numberDiff line numberDiff line change
@@ -1364,14 +1364,6 @@ added: v0.8.0
13641364

13651365
Silence deprecation warnings.
13661366

1367-
### `--no-experimental-global-customevent`
1368-
1369-
<!-- YAML
1370-
added: v19.0.0
1371-
-->
1372-
1373-
Disable exposition of [CustomEvent Web API][] on the global scope.
1374-
13751367
### `--no-experimental-global-navigator`
13761368

13771369
<!-- YAML
@@ -2682,7 +2674,6 @@ one is included in the list below.
26822674
* `--network-family-autoselection-attempt-timeout`
26832675
* `--no-addons`
26842676
* `--no-deprecation`
2685-
* `--no-experimental-global-customevent`
26862677
* `--no-experimental-global-navigator`
26872678
* `--no-experimental-repl-await`
26882679
* `--no-experimental-websocket`
@@ -3153,7 +3144,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
31533144
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
31543145
[CommonJS]: modules.md
31553146
[CommonJS module]: modules.md
3156-
[CustomEvent Web API]: https://dom.spec.whatwg.org/#customevent
31573147
[DEP0025 warning]: deprecations.md#dep0025-requirenodesys
31583148
[ECMAScript module]: esm.md#modules-ecmascript-modules
31593149
[ExperimentalWarning: `vm.measureMemory` is an experimental feature]: vm.md#vmmeasurememoryoptions

doc/api/globals.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,15 @@ added:
422422
- v18.7.0
423423
- v16.17.0
424424
changes:
425+
- version: REPLACEME
426+
pr-url: https://github.com/nodejs/node/pull/52723
427+
description: No longer experimental.
425428
- version: v19.0.0
426429
pr-url: https://github.com/nodejs/node/pull/44860
427430
description: No longer behind `--experimental-global-customevent` CLI flag.
428431
-->
429432

430-
> Stability: 1 - Experimental. Disable this API with the
431-
> [`--no-experimental-global-customevent`][] CLI flag.
433+
> Stability: 2 - Stable
432434
433435
<!-- type=global -->
434436

@@ -1150,7 +1152,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
11501152
[Navigator API]: https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object
11511153
[RFC 5646]: https://www.rfc-editor.org/rfc/rfc5646.txt
11521154
[Web Crypto API]: webcrypto.md
1153-
[`--no-experimental-global-customevent`]: cli.md#--no-experimental-global-customevent
11541155
[`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator
11551156
[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket
11561157
[`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController

doc/node.1

-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ Enable code coverage in the test runner.
186186
.It Fl -no-experimental-websocket
187187
Disable experimental support for the WebSocket API.
188188
.
189-
.It Fl -no-experimental-global-customevent
190-
Disable exposition of the CustomEvent on the global scope.
191-
.
192189
.It Fl -no-experimental-repl-await
193190
Disable top-level await keyword support in REPL.
194191
.

lib/internal/bootstrap/web/exposed-wildcard.js

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const {
5050
} = require('internal/event_target');
5151
exposeInterface(globalThis, 'Event', Event);
5252
exposeInterface(globalThis, 'EventTarget', EventTarget);
53+
exposeLazyInterfaces(globalThis, 'internal/event_target', ['CustomEvent']);
5354

5455
// https://encoding.spec.whatwg.org/#textencoder
5556
// https://encoding.spec.whatwg.org/#textdecoder

lib/internal/process/pre_execution.js

-13
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const {
2828
} = require('internal/options');
2929
const { reconnectZeroFillToggle } = require('internal/buffer');
3030
const {
31-
exposeInterface,
3231
exposeLazyInterfaces,
3332
defineReplaceableLazyAttribute,
3433
setupCoverageHooks,
@@ -104,7 +103,6 @@ function prepareExecution(options) {
104103
setupNavigator();
105104
setupWarningHandler();
106105
setupWebsocket();
107-
setupCustomEvent();
108106
setupCodeCoverage();
109107
setupDebugEnv();
110108
// Process initial diagnostic reporting configuration, if present.
@@ -341,17 +339,6 @@ function setupCodeCoverage() {
341339
}
342340
}
343341

344-
// TODO(daeyeon): move this to internal/bootstrap/web/* when the CLI flag is
345-
// removed.
346-
function setupCustomEvent() {
347-
if (getEmbedderOptions().noBrowserGlobals ||
348-
getOptionValue('--no-experimental-global-customevent')) {
349-
return;
350-
}
351-
const { CustomEvent } = require('internal/event_target');
352-
exposeInterface(globalThis, 'CustomEvent', CustomEvent);
353-
}
354-
355342
function setupStacktracePrinterOnSigint() {
356343
if (!getOptionValue('--trace-sigint')) {
357344
return;

src/node_options.cc

+1-5
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
402402
&EnvironmentOptions::experimental_websocket,
403403
kAllowedInEnvvar,
404404
true);
405-
AddOption("--experimental-global-customevent",
406-
"expose experimental CustomEvent on the global scope",
407-
&EnvironmentOptions::experimental_global_customevent,
408-
kAllowedInEnvvar,
409-
true);
405+
AddOption("--experimental-global-customevent", "", NoOp{}, kAllowedInEnvvar);
410406
AddOption("--experimental-global-navigator",
411407
"expose experimental Navigator API on the global scope",
412408
&EnvironmentOptions::experimental_global_navigator,

src/node_options.h

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ class EnvironmentOptions : public Options {
111111
bool enable_source_maps = false;
112112
bool experimental_fetch = true;
113113
bool experimental_websocket = true;
114-
bool experimental_global_customevent = true;
115114
bool experimental_global_navigator = true;
116115
bool experimental_global_web_crypto = true;
117116
bool experimental_https_modules = false;

test/common/globals.js

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const webIdlExposedWildcard = new Set([
7979
'TextDecoder',
8080
'AbortController',
8181
'AbortSignal',
82+
'CustomEvent',
8283
'EventTarget',
8384
'Event',
8485
'URL',

test/parallel/test-global-customevent-disabled.js

-7
This file was deleted.

test/parallel/test-process-env-allowed-flags-are-documented.js

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ assert(undocumented.delete('--debug-arraybuffer-allocations'));
100100
assert(undocumented.delete('--no-debug-arraybuffer-allocations'));
101101
assert(undocumented.delete('--es-module-specifier-resolution'));
102102
assert(undocumented.delete('--experimental-fetch'));
103+
assert(undocumented.delete('--experimental-global-customevent'));
103104
assert(undocumented.delete('--experimental-global-webcrypto'));
104105
assert(undocumented.delete('--experimental-report'));
105106
assert(undocumented.delete('--experimental-worker'));

0 commit comments

Comments
 (0)