-
Notifications
You must be signed in to change notification settings - Fork 5.6k
refactor: gen unstable flags to avoid conflicts and desync with js #28888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
maybe call it "unstable flags" or "feature flags" instead of just "flags", to make it less confusing? |
show_in_help: bool, | ||
} | ||
|
||
fn main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably add a rerun-if-changed
for flags.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna mark as "request changes" because I'd like to discuss this during the CLI meeting first.
I like that there's a single source of truth in the form of JSON file 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A refactor to the feature flag system is welcome!
It should encompass all feature flags tho - for example this PR isn't yet handling unstable-lockfile-v5
Lines 4462 to 4494 in 9145492
Arg::new("unstable-sloppy-imports") | |
.long("unstable-sloppy-imports") | |
.help("Enable unstable resolving of specifiers by extension probing, .js to .ts, and directory probing") | |
.env("DENO_UNSTABLE_SLOPPY_IMPORTS") | |
.value_parser(FalseyValueParser::new()) | |
.action(ArgAction::SetTrue) | |
.hide(true) | |
.long_help(match cfg { | |
UnstableArgsConfig::None => None, | |
UnstableArgsConfig::ResolutionOnly | UnstableArgsConfig::ResolutionAndRuntime => Some("true") | |
}) | |
.help_heading(UNSTABLE_HEADING) | |
.display_order(next_display_order()) | |
).arg( | |
Arg::new("unstable-npm-lazy-caching") | |
.long("unstable-npm-lazy-caching") | |
.help("Enable unstable lazy caching of npm dependencies, downloading them only as needed (disabled: all npm packages in package.json are installed on startup; enabled: only npm packages that are actually referenced in an import are installed") | |
.env("DENO_UNSTABLE_NPM_LAZY_CACHING") | |
.value_parser(FalseyValueParser::new()) | |
.action(ArgAction::SetTrue) | |
.hide(true) | |
.help_heading(UNSTABLE_HEADING) | |
.display_order(next_display_order()), | |
).arg( | |
Arg::new("unstable-lockfile-v5") | |
.long("unstable-lockfile-v5") | |
.help("Enable unstable lockfile v5") | |
.env("DENO_UNSTABLE_LOCKFILE_V5") | |
.value_parser(FalseyValueParser::new()) | |
.action(ArgAction::SetTrue) | |
.help_heading(UNSTABLE_HEADING) | |
.hide(true) | |
.display_order(next_display_order()), |
or fmt-sql
Lines 1129 to 1142 in 9145492
let all_valid_unstable_flags: Vec<&str> = crate::UNSTABLE_GRANULAR_FLAGS | |
.iter() | |
.map(|granular_flag| granular_flag.name) | |
.chain([ | |
"byonm", | |
"bare-node-builtins", | |
"detect-cjs", | |
"fmt-component", | |
"fmt-sql", | |
"lazy-dynamic-imports", | |
"npm-lazy-caching", | |
"npm-patch", | |
"sloppy-imports", | |
"lockfile-v5", |
generate unstable flags from one source to avoid merge conflicts and desync with ids in js