Skip to content

Commit

Permalink
cli: remove --no-experimental-global-customevent flag
Browse files Browse the repository at this point in the history
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: #52723
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
  • Loading branch information
daeyeon committed Apr 29, 2024
1 parent 81a9a97 commit f7e73cd
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 42 deletions.
10 changes: 0 additions & 10 deletions doc/api/cli.md
Expand Up @@ -1364,14 +1364,6 @@ added: v0.8.0

Silence deprecation warnings.

### `--no-experimental-global-customevent`

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

Disable exposition of [CustomEvent Web API][] on the global scope.

### `--no-experimental-global-navigator`

<!-- YAML
Expand Down Expand Up @@ -2682,7 +2674,6 @@ one is included in the list below.
* `--network-family-autoselection-attempt-timeout`
* `--no-addons`
* `--no-deprecation`
* `--no-experimental-global-customevent`
* `--no-experimental-global-navigator`
* `--no-experimental-repl-await`
* `--no-experimental-websocket`
Expand Down Expand Up @@ -3153,7 +3144,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
[CommonJS]: modules.md
[CommonJS module]: modules.md
[CustomEvent Web API]: https://dom.spec.whatwg.org/#customevent
[DEP0025 warning]: deprecations.md#dep0025-requirenodesys
[ECMAScript module]: esm.md#modules-ecmascript-modules
[ExperimentalWarning: `vm.measureMemory` is an experimental feature]: vm.md#vmmeasurememoryoptions
Expand Down
7 changes: 4 additions & 3 deletions doc/api/globals.md
Expand Up @@ -422,13 +422,15 @@ added:
- v18.7.0
- v16.17.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/52723
description: No longer experimental.
- version: v19.0.0
pr-url: https://github.com/nodejs/node/pull/44860
description: No longer behind `--experimental-global-customevent` CLI flag.
-->

> Stability: 1 - Experimental. Disable this API with the
> [`--no-experimental-global-customevent`][] CLI flag.
> Stability: 2 - Stable
<!-- type=global -->

Expand Down Expand Up @@ -1150,7 +1152,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
[Navigator API]: https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object
[RFC 5646]: https://www.rfc-editor.org/rfc/rfc5646.txt
[Web Crypto API]: webcrypto.md
[`--no-experimental-global-customevent`]: cli.md#--no-experimental-global-customevent
[`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator
[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket
[`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
Expand Down
3 changes: 0 additions & 3 deletions doc/node.1
Expand Up @@ -186,9 +186,6 @@ Enable code coverage in the test runner.
.It Fl -no-experimental-websocket
Disable experimental support for the WebSocket API.
.
.It Fl -no-experimental-global-customevent
Disable exposition of the CustomEvent on the global scope.
.
.It Fl -no-experimental-repl-await
Disable top-level await keyword support in REPL.
.
Expand Down
1 change: 1 addition & 0 deletions lib/internal/bootstrap/web/exposed-wildcard.js
Expand Up @@ -50,6 +50,7 @@ const {
} = require('internal/event_target');
exposeInterface(globalThis, 'Event', Event);
exposeInterface(globalThis, 'EventTarget', EventTarget);
exposeLazyInterfaces(globalThis, 'internal/event_target', ['CustomEvent']);

// https://encoding.spec.whatwg.org/#textencoder
// https://encoding.spec.whatwg.org/#textdecoder
Expand Down
13 changes: 0 additions & 13 deletions lib/internal/process/pre_execution.js
Expand Up @@ -28,7 +28,6 @@ const {
} = require('internal/options');
const { reconnectZeroFillToggle } = require('internal/buffer');
const {
exposeInterface,
exposeLazyInterfaces,
defineReplaceableLazyAttribute,
setupCoverageHooks,
Expand Down Expand Up @@ -104,7 +103,6 @@ function prepareExecution(options) {
setupNavigator();
setupWarningHandler();
setupWebsocket();
setupCustomEvent();
setupCodeCoverage();
setupDebugEnv();
// Process initial diagnostic reporting configuration, if present.
Expand Down Expand Up @@ -341,17 +339,6 @@ function setupCodeCoverage() {
}
}

// TODO(daeyeon): move this to internal/bootstrap/web/* when the CLI flag is
// removed.
function setupCustomEvent() {
if (getEmbedderOptions().noBrowserGlobals ||
getOptionValue('--no-experimental-global-customevent')) {
return;
}
const { CustomEvent } = require('internal/event_target');
exposeInterface(globalThis, 'CustomEvent', CustomEvent);
}

function setupStacktracePrinterOnSigint() {
if (!getOptionValue('--trace-sigint')) {
return;
Expand Down
6 changes: 1 addition & 5 deletions src/node_options.cc
Expand Up @@ -402,11 +402,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
&EnvironmentOptions::experimental_websocket,
kAllowedInEnvvar,
true);
AddOption("--experimental-global-customevent",
"expose experimental CustomEvent on the global scope",
&EnvironmentOptions::experimental_global_customevent,
kAllowedInEnvvar,
true);
AddOption("--experimental-global-customevent", "", NoOp{}, kAllowedInEnvvar);
AddOption("--experimental-global-navigator",
"expose experimental Navigator API on the global scope",
&EnvironmentOptions::experimental_global_navigator,
Expand Down
1 change: 0 additions & 1 deletion src/node_options.h
Expand Up @@ -111,7 +111,6 @@ class EnvironmentOptions : public Options {
bool enable_source_maps = false;
bool experimental_fetch = true;
bool experimental_websocket = true;
bool experimental_global_customevent = true;
bool experimental_global_navigator = true;
bool experimental_global_web_crypto = true;
bool experimental_https_modules = false;
Expand Down
1 change: 1 addition & 0 deletions test/common/globals.js
Expand Up @@ -79,6 +79,7 @@ const webIdlExposedWildcard = new Set([
'TextDecoder',
'AbortController',
'AbortSignal',
'CustomEvent',
'EventTarget',
'Event',
'URL',
Expand Down
7 changes: 0 additions & 7 deletions test/parallel/test-global-customevent-disabled.js

This file was deleted.

Expand Up @@ -100,6 +100,7 @@ assert(undocumented.delete('--debug-arraybuffer-allocations'));
assert(undocumented.delete('--no-debug-arraybuffer-allocations'));
assert(undocumented.delete('--es-module-specifier-resolution'));
assert(undocumented.delete('--experimental-fetch'));
assert(undocumented.delete('--experimental-global-customevent'));
assert(undocumented.delete('--experimental-global-webcrypto'));
assert(undocumented.delete('--experimental-report'));
assert(undocumented.delete('--experimental-worker'));
Expand Down

0 comments on commit f7e73cd

Please sign in to comment.