-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
experimentalIssues and PRs related to experimental features.Issues and PRs related to experimental features.
Description
Some experimental warning messages' contents are not consistent, for example:
(node:70168) ExperimentalWarning: The ESM module loader is experimental.
(node:70372) ExperimentalWarning: Conditional exports is an experimental feature. This feature could change at any timeShall we make them consistent? If so I'm willing to submit a PR to solve this.
There are two general methods to emit experimental warnings. I think we can make use of them.
JavaScript version
Lines 170 to 176 in 1549c8e
| function emitExperimentalWarning(feature) { | |
| if (experimentalWarnings.has(feature)) return; | |
| const msg = `${feature} is an experimental feature. This feature could ` + | |
| 'change at any time'; | |
| experimentalWarnings.add(feature); | |
| process.emitWarning(msg, 'ExperimentalWarning'); | |
| } |
C++ version (introduced in #30617)
node/src/node_process_events.cc
Lines 102 to 112 in 1549c8e
| Maybe<bool> ProcessEmitExperimentalWarning(Environment* env, | |
| const char* warning) { | |
| if (experimental_warnings.find(warning) != experimental_warnings.end()) | |
| return Nothing<bool>(); | |
| experimental_warnings.insert(warning); | |
| std::string message(warning); | |
| message.append( | |
| " is an experimental feature. This feature could change at any time"); | |
| return ProcessEmitWarningGeneric(env, message.c_str(), "ExperimentalWarning"); | |
| } |
Metadata
Metadata
Assignees
Labels
experimentalIssues and PRs related to experimental features.Issues and PRs related to experimental features.