diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-11-01 23:15:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 23:15:08 +0100 |
commit | 24c3c9695865bb478f5651da4982b7e0a34afc72 (patch) | |
tree | 5afe78a8c67bb9e9c1cd69d56a9a0c68bca67515 /cli/factory.rs | |
parent | 42c426e7695a0037032d1ac5237830800eeaaed4 (diff) |
feat: granular --unstable-* flags (#20968)
This commit adds granular `--unstable-*` flags:
- "--unstable-broadcast-channel"
- "--unstable-ffi"
- "--unstable-fs"
- "--unstable-http"
- "--unstable-kv"
- "--unstable-net"
- "--unstable-worker-options"
- "--unstable-cron"
These flags are meant to replace a "catch-all" flag - "--unstable", that
gives a binary control whether unstable features are enabled or not. The
downside of this flag that allowing eg. Deno KV API also enables the FFI
API (though the latter is still gated with a permission).
These flags can also be specified in `deno.json` file under `unstable`
key.
Currently, "--unstable" flag works the same way - I will open a follow
up PR that will print a warning when using "--unstable" and suggest to use
concrete "--unstable-*" flag instead. We plan to phase out "--unstable"
completely in Deno 2.
Diffstat (limited to 'cli/factory.rs')
-rw-r--r-- | cli/factory.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/factory.rs b/cli/factory.rs index 389c4dbe0..06c9472fa 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -595,6 +595,12 @@ impl CliFactory { if self.options.unstable() { checker.enable_legacy_unstable(); } + let unstable_features = self.options.unstable_features(); + for (flag_name, _, _) in crate::UNSTABLE_GRANULAR_FLAGS { + if unstable_features.contains(&flag_name.to_string()) { + checker.enable_feature(flag_name); + } + } Arc::new(checker) }) |