diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-09-09 22:44:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-09 23:44:29 +0200 |
commit | 064a73f7a08eb12d99fcdf8844e9ce5db62be78b (patch) | |
tree | a1672b2151d3e7c5db490dad9fc3917064ee64aa /cli/args | |
parent | 560ad0331bf99a2564f53201cd086ff902901bfe (diff) |
BREAKING: Remove `--unstable` flag (#25522)
This commit effectively removes the --unstable flag.
It's still being parsed, but it only prints a warning that a granular
flag should be used instead and doesn't actually enable any
unstable feature.
Closes https://github.com/denoland/deno/issues/25485
Closes https://github.com/denoland/deno/issues/23237
Diffstat (limited to 'cli/args')
-rw-r--r-- | cli/args/flags.rs | 15 | ||||
-rw-r--r-- | cli/args/mod.rs | 4 |
2 files changed, 4 insertions, 15 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index bd92d878f..8e62152da 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -570,6 +570,7 @@ fn parse_packages_allowed_scripts(s: &str) -> Result<String, AnyError> { Clone, Default, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, )] pub struct UnstableConfig { + // TODO(bartlomieju): remove in Deno 2.5 pub legacy_flag_enabled: bool, // --unstable pub bare_node_builtins: bool, // --unstable-bare-node-builts pub sloppy_imports: bool, @@ -5476,6 +5477,7 @@ fn unstable_args_parse( matches: &mut ArgMatches, cfg: UnstableArgsConfig, ) { + // TODO(bartlomieju): remove in Deno 2.5 if matches.get_flag("unstable") { flags.unstable_config.legacy_flag_enabled = true; } @@ -8765,7 +8767,7 @@ mod tests { #[test] fn test_with_flags() { #[rustfmt::skip] - let r = flags_from_vec(svec!["deno", "test", "--unstable", "--no-npm", "--no-remote", "--trace-leaks", "--no-run", "--filter", "- foo", "--coverage=cov", "--clean", "--location", "https:foo", "--allow-net", "--permit-no-files", "dir1/", "dir2/", "--", "arg1", "arg2"]); + let r = flags_from_vec(svec!["deno", "test", "--no-npm", "--no-remote", "--trace-leaks", "--no-run", "--filter", "- foo", "--coverage=cov", "--clean", "--location", "https:foo", "--allow-net", "--permit-no-files", "dir1/", "dir2/", "--", "arg1", "arg2"]); assert_eq!( r.unwrap(), Flags { @@ -8789,10 +8791,6 @@ mod tests { junit_path: None, hide_stacktraces: false, }), - unstable_config: UnstableConfig { - legacy_flag_enabled: true, - ..Default::default() - }, no_npm: true, no_remote: true, location: Some(Url::parse("https://foo/").unwrap()), @@ -10200,7 +10198,6 @@ mod tests { "deno", "bench", "--json", - "--unstable", "--no-npm", "--no-remote", "--no-run", @@ -10228,10 +10225,6 @@ mod tests { }, watch: Default::default(), }), - unstable_config: UnstableConfig { - legacy_flag_enabled: true, - ..Default::default() - }, no_npm: true, no_remote: true, type_check_mode: TypeCheckMode::Local, @@ -10802,10 +10795,10 @@ mod tests { conn_file: None, }), unstable_config: UnstableConfig { - legacy_flag_enabled: false, bare_node_builtins: true, sloppy_imports: false, features: svec!["ffi", "worker-options"], + ..Default::default() }, ..Flags::default() } diff --git a/cli/args/mod.rs b/cli/args/mod.rs index f7623323f..203ceec50 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1548,10 +1548,6 @@ impl CliOptions { &self.flags.unsafely_ignore_certificate_errors } - pub fn legacy_unstable_flag(&self) -> bool { - self.flags.unstable_config.legacy_flag_enabled - } - pub fn unstable_bare_node_builtins(&self) -> bool { self.flags.unstable_config.bare_node_builtins || self.workspace().has_unstable("bare-node-builtins") |