Skip to content

Commit 63d4cae

Browse files
committed
worker: remove --experimental-worker flag
Having an experimental feature behind a flag makes change if we are expecting significant breaking changes to its API. Since the Worker API has been essentially stable since its initial introduction, and no noticeable doubt about possibly not keeping the feature around has been voiced, removing the flag and thereby reducing the barrier to experimentation, and consequently receiving feedback on the implementation, seems like a good idea. PR-URL: nodejs#25361 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 8ec3c35 commit 63d4cae

File tree

59 files changed

+19
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+19
-89
lines changed

benchmark/misc/startup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
1010
script: ['benchmark/fixtures/require-cachable', 'test/fixtures/semicolon'],
1111
mode: ['process', 'worker']
1212
}, {
13-
flags: ['--expose-internals', '--experimental-worker'] // for workers
13+
flags: ['--expose-internals']
1414
});
1515

1616
function spawnProcess(script) {

benchmark/worker/echo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
77
payload: ['string', 'object'],
88
sendsPerBroadcast: [1, 10],
99
n: [1e5]
10-
}, { flags: ['--experimental-worker'] });
10+
});
1111

1212
const workerPath = path.resolve(__dirname, '..', 'fixtures', 'echo.worker.js');
1313

doc/api/cli.md

Lines changed: 0 additions & 8 deletions

doc/api/worker_threads.md

Lines changed: 1 addition & 1 deletion

doc/node.1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ keyword support in REPL.
9494
.It Fl -experimental-vm-modules
9595
Enable experimental ES module support in VM module.
9696
.
97-
.It Fl -experimental-worker
98-
Enable experimental worker threads using worker_threads module.
99-
.
10097
.It Fl -force-fips
10198
Force FIPS-compliant crypto on startup
10299
(Cannot be disabled from script code).

lib/internal/bootstrap/loaders.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ if (config.exposeInternals) {
253253
};
254254

255255
NativeModule.isInternal = function(id) {
256-
return id.startsWith('internal/') ||
257-
(id === 'worker_threads' && !config.experimentalWorker);
256+
return id.startsWith('internal/');
258257
};
259258
}
260259

lib/internal/bootstrap/node.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@ function startup() {
187187
setupQueueMicrotask();
188188
}
189189

190-
if (getOptionValue('--experimental-worker')) {
191-
setupDOMException();
192-
}
190+
setupDOMException();
193191

194192
// On OpenBSD process.execPath will be relative unless we
195193
// get the full path before process.execPath is used.

lib/internal/modules/cjs/helpers.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const {
99
CHAR_HASH,
1010
} = require('internal/constants');
1111

12-
const { getOptionValue } = require('internal/options');
13-
1412
// Invoke with makeRequireFunction(module) where |module| is the Module object
1513
// to use as the context for the require() function.
1614
function makeRequireFunction(mod) {
@@ -100,14 +98,9 @@ const builtinLibs = [
10098
'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'http2', 'https', 'net',
10199
'os', 'path', 'perf_hooks', 'punycode', 'querystring', 'readline', 'repl',
102100
'stream', 'string_decoder', 'tls', 'trace_events', 'tty', 'url', 'util',
103-
'v8', 'vm', 'zlib'
101+
'v8', 'vm', 'worker_threads', 'zlib'
104102
];
105103

106-
if (getOptionValue('--experimental-worker')) {
107-
builtinLibs.push('worker_threads');
108-
builtinLibs.sort();
109-
}
110-
111104
if (typeof internalBinding('inspector').open === 'function') {
112105
builtinLibs.push('inspector');
113106
builtinLibs.sort();

src/node_config.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ static void Initialize(Local<Object> target,
8585
if (env->options()->experimental_vm_modules)
8686
READONLY_TRUE_PROPERTY(target, "experimentalVMModules");
8787

88-
if (env->options()->experimental_worker)
89-
READONLY_TRUE_PROPERTY(target, "experimentalWorker");
90-
9188
if (env->options()->experimental_repl_await)
9289
READONLY_TRUE_PROPERTY(target, "experimentalREPLAwait");
9390

src/node_options.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
109109
"experimental ES Module support in vm module",
110110
&EnvironmentOptions::experimental_vm_modules,
111111
kAllowedInEnvironment);
112-
AddOption("--experimental-worker",
113-
"experimental threaded Worker support",
114-
&EnvironmentOptions::experimental_worker,
115-
kAllowedInEnvironment);
112+
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvironment);
116113
AddOption("--expose-internals", "", &EnvironmentOptions::expose_internals);
117114
AddOption("--http-parser",
118115
"Select which HTTP parser to use; either 'legacy' or 'llhttp' "

0 commit comments

Comments
 (0)