Skip to content

cli: add --enable-all-experimentals build flag#62755

Open
ShogunPanda wants to merge 2 commits intonodejs:mainfrom
ShogunPanda:experimental-flag
Open

cli: add --enable-all-experimentals build flag#62755
ShogunPanda wants to merge 2 commits intonodejs:mainfrom
ShogunPanda:experimental-flag

Conversation

@ShogunPanda
Copy link
Copy Markdown
Contributor

@ShogunPanda ShogunPanda commented Apr 15, 2026

This PR adds a new --enable-all-experimentals BUILD flag which can be used to turn ALL experimental features on by default.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/inspector

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 15, 2026
@aduh95
Copy link
Copy Markdown
Contributor

aduh95 commented Apr 15, 2026

That seems like a bad idea; if you want to avoid long commands, use a config file, no?

@marco-ippolito
Copy link
Copy Markdown
Member

why would you want to enable ALL experimental flags? It might have side effects the user is not aware of

@ShogunPanda
Copy link
Copy Markdown
Contributor Author

I can document this to be very bad or dangerous.
But I find myself something struggling to remember all the experimental flags I need to enabled.
Also, one thing: can we please start treating users as adults: adding a global flag won't make the runtime more dangerous, to be honest.

@ShogunPanda
Copy link
Copy Markdown
Contributor Author

That seems like a bad idea; if you want to avoid long commands, use a config file, no?

Just to enable a bunch of experimental flags you have to create a JSON file with schema and so forth. Seems to be a little overkill.

Copy link
Copy Markdown
Member

@marco-ippolito marco-ippolito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making my objection explicit. The node.config.json exists for this specific reason: improve the dx of having a lot of cli flags. I cannot think a use case where you want to enable all experimental flags. This might cause unexpected effects because the interaction between multiple experimental flag is untested. I'd rather have user write a json file than a dangerous "free for all flag"

@ShogunPanda
Copy link
Copy Markdown
Contributor Author

@marco-ippolito I understand your concerns. I disagree, which is totally fine.
Do you think that explicitly stating that is dangerous and also listing out which flags it enables would lift your objection?

@aduh95
Copy link
Copy Markdown
Contributor

aduh95 commented Apr 15, 2026

An alternative would be a build/configure flag, would that work for you?

@marco-ippolito
Copy link
Copy Markdown
Member

An alternative would be a build/configure flag, would that work for you?

I'm fine with a build flag

@ShogunPanda
Copy link
Copy Markdown
Contributor Author

An alternative would be a build/configure flag, would that work for you?

Do you mean a configure flag that enables the CLI flag on C++ side so that only people with custom build will see it?

If that's the idea, I'm up for it. Good idea. @marco-ippolito Would it solve your objection?

@ShogunPanda
Copy link
Copy Markdown
Contributor Author

Amazing. Updating this soon.

@marco-ippolito
Copy link
Copy Markdown
Member

marco-ippolito commented Apr 15, 2026

An alternative would be a build/configure flag, would that work for you?

Do you mean a configure flag that enables the CLI flag on C++ side so that only people with custom build will see it?

If that's the idea, I'm up for it. Good idea. @marco-ippolito Would it solve your objection?

yes, I'm fine with it, would be nice to actually have them enabled without a runtime flag (just the build flag) so you can run the test suite and test the interaction among all the experimental features.
This PR only enables an arbitrary subset of experimental features though, not all of them

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.69%. Comparing base (3f52482) to head (31ba820).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62755      +/-   ##
==========================================
- Coverage   91.55%   89.69%   -1.86%     
==========================================
  Files         356      706     +350     
  Lines      149601   218127   +68526     
  Branches    23395    41734   +18339     
==========================================
+ Hits       136967   195651   +58684     
- Misses      12371    14399    +2028     
- Partials      263     8077    +7814     
Files with missing lines Coverage Δ
src/node_options.h 98.00% <100.00%> (ø)

... and 473 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ShogunPanda ShogunPanda changed the title cli: add --experimental flag cli: add --experimental build flag Apr 15, 2026
@ShogunPanda
Copy link
Copy Markdown
Contributor Author

@marco-ippolito @aduh95 Updated now. WDYT?

Comment thread src/node_options.h Outdated
Comment thread configure.py Outdated
@ShogunPanda ShogunPanda changed the title cli: add --experimental build flag cli: add --enable-all-experimentals build flag Apr 16, 2026
@marco-ippolito marco-ippolito dismissed their stale review April 16, 2026 09:43

Changed applied

Signed-off-by: Paolo Insogna <paolo@cowtech.it>
Comment thread common.gypi Outdated
'python%': 'python',

'node_shared%': 'false',
'node_enable_experimentals%': 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'node_enable_experimentals%': 0,
'node_enable_experimentals%': 'false',

Comment thread common.gypi Outdated
Comment on lines +441 to +443
['node_enable_experimentals==1', {
'defines': ['NODE_ENABLE_EXPERIMENTALS'],
}],
Copy link
Copy Markdown
Contributor

@aduh95 aduh95 Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we simply pass the value rather than using a single use precompile variable?

Suggested change
['node_enable_experimentals==1', {
'defines': ['NODE_ENABLE_EXPERIMENTALS'],
}],
['true', {
'defines': ['EXPERIMENTALS_DEFAULT_VALUE=<(node_enable_experimentals)'],
}],

Signed-off-by: Paolo Insogna <paolo@cowtech.it>
@ShogunPanda
Copy link
Copy Markdown
Contributor Author

@aduh95 How about now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants