mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
6cdaf038ce
commit
243f90283c
6 files changed
+4
-21
No files matched your search
@@ -255,8 +255,7 @@ if (config.exposeInternals) {
|
||||
};
|
||||
|
||||
NativeModule.isInternal = function(id) {
|
||||
return id.startsWith('internal/') ||
|
||||
(id === 'worker_threads' && !config.experimentalWorker);
|
||||
return id.startsWith('internal/');
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -179,9 +179,7 @@ function startup() {
|
||||
setupQueueMicrotask();
|
||||
}
|
||||
|
||||
if (getOptionValue('--experimental-worker')) {
|
||||
setupDOMException();
|
||||
}
|
||||
setupDOMException();
|
||||
|
||||
// On OpenBSD process.execPath will be relative unless we
|
||||
// get the full path before process.execPath is used.
|
||||
|
||||
@@ -9,8 +9,6 @@ const {
|
||||
CHAR_HASH,
|
||||
} = require('internal/constants');
|
||||
|
||||
const { getOptionValue } = require('internal/options');
|
||||
|
||||
// Invoke with makeRequireFunction(module) where |module| is the Module object
|
||||
// to use as the context for the require() function.
|
||||
function makeRequireFunction(mod) {
|
||||
@@ -100,14 +98,9 @@ const builtinLibs = [
|
||||
'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'http2', 'https', 'net',
|
||||
'os', 'path', 'perf_hooks', 'punycode', 'querystring', 'readline', 'repl',
|
||||
'stream', 'string_decoder', 'tls', 'trace_events', 'tty', 'url', 'util',
|
||||
'v8', 'vm', 'zlib'
|
||||
'v8', 'vm', 'worker_threads', 'zlib'
|
||||
];
|
||||
|
||||
if (getOptionValue('--experimental-worker')) {
|
||||
builtinLibs.push('worker_threads');
|
||||
builtinLibs.sort();
|
||||
}
|
||||
|
||||
if (typeof internalBinding('inspector').open === 'function') {
|
||||
builtinLibs.push('inspector');
|
||||
builtinLibs.sort();
|
||||
|
||||
@@ -89,9 +89,6 @@ static void Initialize(Local<Object> target,
|
||||
if (env->options()->experimental_vm_modules)
|
||||
READONLY_TRUE_PROPERTY(target, "experimentalVMModules");
|
||||
|
||||
if (env->options()->experimental_worker)
|
||||
READONLY_TRUE_PROPERTY(target, "experimentalWorker");
|
||||
|
||||
if (env->options()->experimental_repl_await)
|
||||
READONLY_TRUE_PROPERTY(target, "experimentalREPLAwait");
|
||||
|
||||
|
||||
+1
-4
@@ -109,10 +109,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
|
||||
"experimental ES Module support in vm module",
|
||||
&EnvironmentOptions::experimental_vm_modules,
|
||||
kAllowedInEnvironment);
|
||||
AddOption("--experimental-worker",
|
||||
"experimental threaded Worker support",
|
||||
&EnvironmentOptions::experimental_worker,
|
||||
kAllowedInEnvironment);
|
||||
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvironment);
|
||||
AddOption("--expose-internals", "", &EnvironmentOptions::expose_internals);
|
||||
AddOption("--http-parser",
|
||||
"Select which HTTP parser to use; either 'legacy' or 'llhttp' "
|
||||
|
||||
@@ -96,7 +96,6 @@ class EnvironmentOptions : public Options {
|
||||
bool experimental_modules = false;
|
||||
bool experimental_repl_await = false;
|
||||
bool experimental_vm_modules = false;
|
||||
bool experimental_worker = true;
|
||||
bool expose_internals = false;
|
||||
std::string http_parser =
|
||||
#ifdef NODE_EXPERIMENTAL_HTTP_DEFAULT
|
||||
|
||||
Reference in new issue
Block a user