Skip to content

cli: add --experimental build flag#62755

Open
ShogunPanda wants to merge 1 commit intonodejs:mainfrom
ShogunPanda:experimental-flag
Open

cli: add --experimental build flag#62755
ShogunPanda wants to merge 1 commit intonodejs:mainfrom
ShogunPanda:experimental-flag

Conversation

@ShogunPanda
Copy link
Copy Markdown
Contributor

@ShogunPanda ShogunPanda commented Apr 15, 2026

This PR adds a new --experimental 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.

Signed-off-by: Paolo Insogna <paolo@cowtech.it>
@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
Comment on lines +131 to +137
EXPERIMENTAL_OPTION(experimental_addon_modules, false)
EXPERIMENTAL_OPTION(experimental_eventsource, false)
EXPERIMENTAL_OPTION(experimental_fetch, true)
EXPERIMENTAL_OPTION(experimental_ffi, false)
EXPERIMENTAL_OPTION(experimental_websocket, true)
EXPERIMENTAL_OPTION(experimental_sqlite, true)
EXPERIMENTAL_OPTION(experimental_stream_iter, false)
Copy link
Copy Markdown
Contributor

@aduh95 aduh95 Apr 15, 2026

Choose a reason for hiding this comment

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

Wouldn't it make more sense to have a EXPERIMENTAL_DISABLED_BY_DEFAULT be set to true or false? Seems more intent reveling to me

Suggested change
EXPERIMENTAL_OPTION(experimental_addon_modules, false)
EXPERIMENTAL_OPTION(experimental_eventsource, false)
EXPERIMENTAL_OPTION(experimental_fetch, true)
EXPERIMENTAL_OPTION(experimental_ffi, false)
EXPERIMENTAL_OPTION(experimental_websocket, true)
EXPERIMENTAL_OPTION(experimental_sqlite, true)
EXPERIMENTAL_OPTION(experimental_stream_iter, false)
bool experimental_addon_modules = EXPERIMENTAL_DISABLED_BY_DEFAULT;
bool experimental_eventsource = EXPERIMENTAL_DISABLED_BY_DEFAULT;
bool experimental_fetch = true;
bool experimental_ffi = EXPERIMENTAL_DISABLED_BY_DEFAULT;
bool experimental_websocket = EXPERIMENTAL_DISABLED_BY_DEFAULT;
bool experimental_sqlite = HAVE_SQLITE;
bool experimental_stream_iter = EXPERIMENTAL_DISABLED_BY_DEFAULT;

Comment thread configure.py
default=None,
help='Enable the --trace-maps flag in V8 (use at your own risk)')

parser.add_argument('--experimental',
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.

--experimental is not a great name. wdyt of the following:

Suggested change
parser.add_argument('--experimental',
parser.add_argument('--disable-experimental-flags-gating',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

or --enable-all-experimental rather than disable

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