Skip to content

Commit 1996a2a

Browse files
committed
lib: enable web worker api by default
Signed-off-by: avivkeller <me@aviv.sh>
1 parent 2dbf9d7 commit 1996a2a

9 files changed

Lines changed: 29 additions & 24 deletions

File tree

doc/api/cli.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,14 +1563,6 @@ changes:
15631563

15641564
Enable experimental WebAssembly System Interface (WASI) support.
15651565

1566-
### `--experimental-web-worker`
1567-
1568-
<!-- YAML
1569-
added: REPLACEME
1570-
-->
1571-
1572-
Enable experimental support for the Web Worker API.
1573-
15741566
### `--experimental-worker-inspection`
15751567

15761568
<!-- YAML
@@ -2147,6 +2139,20 @@ changes:
21472139

21482140
Disable the experimental [`node:sqlite`][] module.
21492141

2142+
### `--no-experimental-web-worker`
2143+
2144+
<!-- YAML
2145+
added: REPLACEME
2146+
changes:
2147+
- version: REPLACEME
2148+
pr-url: https://github.com/nodejs/node/pull/65323
2149+
description: This feature is now enabled by default.
2150+
-->
2151+
2152+
> Stability: 1.1 - Active Development
2153+
2154+
Disable support for the Web Worker API.
2155+
21502156
### `--no-experimental-webstorage`
21512157

21522158
<!-- YAML
@@ -3914,7 +3920,6 @@ one is included in the list below.
39143920
* `--experimental-vfs`
39153921
* `--experimental-vm-modules`
39163922
* `--experimental-wasi-unstable-preview1`
3917-
* `--experimental-web-worker`
39183923
* `--experimental-websocket`
39193924
* `--force-context-aware`
39203925
* `--force-fips`
@@ -3946,6 +3951,7 @@ one is included in the list below.
39463951
* `--no-experimental-global-navigator`
39473952
* `--no-experimental-sqlite`
39483953
* `--no-experimental-strip-types`
3954+
* `--no-experimental-web-worker`
39493955
* `--no-experimental-webstorage`
39503956
* `--no-extra-info-on-fatal-exception`
39513957
* `--no-force-async-hooks-checks`

doc/api/globals.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,10 @@ A browser-compatible implementation of {WebSocket}.
13191319

13201320
<!-- YAML
13211321
added: REPLACEME
1322+
changes:
1323+
- version: REPLACEME
1324+
pr-url: https://github.com/nodejs/node/pull/65323
1325+
description: This feature is now enabled by default.
13221326
-->
13231327

13241328
> Stability: 1 - Experimental. Enable this API with the

doc/node.1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -836,9 +836,6 @@ Enable experimental ES Module support in the \fBnode:vm\fR module.
836836
.It Fl -experimental-wasi-unstable-preview1
837837
Enable experimental WebAssembly System Interface (WASI) support.
838838
.
839-
.It Fl -experimental-web-worker
840-
Enable experimental support for the Web Worker API.
841-
.
842839
.It Fl -experimental-worker-inspection
843840
Enable experimental support for the worker inspection with Chrome DevTools.
844841
.
@@ -1110,6 +1107,9 @@ Legacy alias for \fB--no-require-module\fR.
11101107
.It Fl -no-experimental-sqlite
11111108
Disable the experimental \fBnode:sqlite\fR module.
11121109
.
1110+
.It Fl -no-experimental-web-worker
1111+
Disable support for the Web Worker API.
1112+
.
11131113
.It Fl -no-experimental-webstorage
11141114
Disable \fBWeb Storage\fR support.
11151115
.
@@ -2034,8 +2034,6 @@ one is included in the list below.
20342034
.It
20352035
\fB--experimental-wasi-unstable-preview1\fR
20362036
.It
2037-
\fB--experimental-web-worker\fR
2038-
.It
20392037
\fB--experimental-websocket\fR
20402038
.It
20412039
\fB--force-context-aware\fR
@@ -2098,6 +2096,8 @@ one is included in the list below.
20982096
.It
20992097
\fB--no-experimental-strip-types\fR
21002098
.It
2099+
\fB--no-experimental-web-worker\fR
2100+
.It
21012101
\fB--no-experimental-webstorage\fR
21022102
.It
21032103
\fB--no-extra-info-on-fatal-exception\fR

src/node_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
599599
"experimental Web Worker API",
600600
BOOL_FIELD(experimental_web_worker),
601601
kAllowedInEnvvar,
602-
false);
602+
true);
603603
AddOption("--experimental-websocket", "", NoOp{}, kAllowedInEnvvar);
604604
AddOption("--experimental-global-customevent", "", NoOp{}, kAllowedInEnvvar);
605605
AddOption("--experimental-sqlite",

src/node_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class EnvironmentOptions : public Options {
202202
DEFINE_BOOL_FIELD(experimental_addon_modules) = true;
203203
DEFINE_BOOL_FIELD(experimental_eventsource) = EXPERIMENTALS_DEFAULT_VALUE;
204204
DEFINE_BOOL_FIELD(experimental_ffi) = EXPERIMENTALS_DEFAULT_VALUE;
205-
DEFINE_BOOL_FIELD(experimental_web_worker) = EXPERIMENTALS_DEFAULT_VALUE;
205+
DEFINE_BOOL_FIELD(experimental_web_worker) = true;
206206
DEFINE_BOOL_FIELD(experimental_websocket) = true;
207207
DEFINE_BOOL_FIELD(experimental_sqlite) = HAVE_SQLITE;
208208
DEFINE_BOOL_FIELD(experimental_stream_iter) = EXPERIMENTALS_DEFAULT_VALUE;

test/common/wpt.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,7 @@ class WPTRunner {
836836
this.resource = new ResourceLoader(path);
837837
this.concurrency = concurrency;
838838

839-
// Since we need to prepare the Web Worker APIs
840-
// in the harness that runs on all WPT workers,
841-
// we enable the API globally. This has no practical
842-
// effect on the non-web-worker tests, however.
843-
this.flags = ['--experimental-web-worker'];
839+
this.flags = [];
844840
this.globalThisInitScripts = [];
845841
this.initScript = null;
846842

test/parallel/test-common-wpt-backends.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const queueProbe = process.env.NODE_TEST_WPT_QUEUE_PROBE === '1';
1616

1717
const harnessPath = fixtures.path('wpt', 'resources', 'testharness.js');
1818
const specPath = fixtures.path('wpt-backends-spec.js');
19-
const execArgv = ['--experimental-web-worker'];
19+
const execArgv = [];
2020

2121
function payload(throws) {
2222
return {

test/parallel/test-common-wpt-webworker-error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { Worker } = require('worker_threads');
1010

1111
const workerPath = path.join(__dirname, '../common/wpt/worker.js');
1212
const harnessPath = fixtures.path('wpt', 'resources', 'testharness.js');
13-
const execArgv = ['--experimental-web-worker'];
13+
const execArgv = [];
1414
const workerData = {
1515
testRelativePath: 'workers/error-after-result.any.js',
1616
wptRunner: path.join(__dirname, '../common/wpt.js'),

test/parallel/test-worker-spec-differences.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-web-worker
21
'use strict';
32

43
const common = require('../common');

0 commit comments

Comments
 (0)