Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab7284a

Browse filesBrowse 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: #25361 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 21096f9 commit ab7284a
Copy full SHA for ab7284a

File tree

Expand file treeCollapse file tree

6 files changed

+4
-21
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+4
-21
lines changed
Open diff view settings
Collapse file

‎lib/internal/bootstrap/loaders.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/loaders.js
+1-2Lines changed: 1 addition & 2 deletions
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

Collapse file

‎lib/internal/bootstrap/node.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js
+1-3Lines changed: 1 addition & 3 deletions
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.
Collapse file

‎lib/internal/modules/cjs/helpers.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/helpers.js
+1-8Lines 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();
Collapse file

‎src/node_config.cc‎

Copy file name to clipboardExpand all lines: src/node_config.cc
-3Lines changed: 0 additions & 3 deletions
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

Collapse file

‎src/node_options.cc‎

Copy file name to clipboardExpand all lines: src/node_options.cc
+1-4Lines 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' "
Collapse file

‎src/node_options.h‎

Copy file name to clipboardExpand all lines: src/node_options.h
-1Lines changed: 0 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.