Skip to content

Commit 243f902

Browse files
addaleaxBridgeAR
authored andcommitted
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: #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 6cdaf03 commit 243f902

File tree

6 files changed

+4
-21
lines changed

6 files changed

+4
-21
lines changed

lib/internal/bootstrap/loaders.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,7 @@ if (config.exposeInternals) {
255255
};
256256

257257
NativeModule.isInternal = function(id) {
258-
return id.startsWith('internal/') ||
259-
(id === 'worker_threads' && !config.experimentalWorker);
258+
return id.startsWith('internal/');
260259
};
261260
}
262261

lib/internal/bootstrap/node.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ function startup() {
179179
setupQueueMicrotask();
180180
}
181181

182-
if (getOptionValue('--experimental-worker')) {
183-
setupDOMException();
184-
}
182+
setupDOMException();
185183

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

lib/internal/modules/cjs/helpers.js

+1-8
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

-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ static void Initialize(Local<Object> target,
8989
if (env->options()->experimental_vm_modules)
9090
READONLY_TRUE_PROPERTY(target, "experimentalVMModules");
9191

92-
if (env->options()->experimental_worker)
93-
READONLY_TRUE_PROPERTY(target, "experimentalWorker");
94-
9592
if (env->options()->experimental_repl_await)
9693
READONLY_TRUE_PROPERTY(target, "experimentalREPLAwait");
9794

src/node_options.cc

+1-4
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' "

src/node_options.h

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class EnvironmentOptions : public Options {
9696
bool experimental_modules = false;
9797
bool experimental_repl_await = false;
9898
bool experimental_vm_modules = false;
99-
bool experimental_worker = true;
10099
bool expose_internals = false;
101100
std::string http_parser =
102101
#ifdef NODE_EXPERIMENTAL_HTTP_DEFAULT

0 commit comments

Comments
 (0)