Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: remove --no-experimental-global-customevent flag #52723

Merged
merged 2 commits into from
Apr 29, 2024
Merged
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: 0 additions & 10 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.

Original file line number Diff line number Diff line change
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
Loading