mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
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.
This commit is contained in:
parent
42c426e769
commit
24c3c96958
13 changed files with 266 additions and 27 deletions
|
@ -54,7 +54,10 @@ pub struct BootstrapOptions {
|
|||
pub runtime_version: String,
|
||||
/// Sets `Deno.version.typescript` in JS runtime.
|
||||
pub ts_version: String,
|
||||
// --unstable flag, deprecated
|
||||
pub unstable: bool,
|
||||
// --unstable-* flags
|
||||
pub unstable_features: Vec<i32>,
|
||||
pub user_agent: String,
|
||||
pub inspect: bool,
|
||||
pub has_node_modules_dir: bool,
|
||||
|
@ -82,6 +85,7 @@ impl Default for BootstrapOptions {
|
|||
locale: "en".to_string(),
|
||||
location: Default::default(),
|
||||
unstable: Default::default(),
|
||||
unstable_features: Default::default(),
|
||||
inspect: Default::default(),
|
||||
args: Default::default(),
|
||||
has_node_modules_dir: Default::default(),
|
||||
|
@ -121,6 +125,8 @@ struct BootstrapV8<'a>(
|
|||
&'a str,
|
||||
// unstable
|
||||
bool,
|
||||
// granular unstable flags
|
||||
&'a [i32],
|
||||
// process_id
|
||||
i32,
|
||||
// env!("TARGET")
|
||||
|
@ -159,6 +165,7 @@ impl BootstrapOptions {
|
|||
self.is_tty,
|
||||
&self.ts_version,
|
||||
self.unstable,
|
||||
self.unstable_features.as_ref(),
|
||||
std::process::id() as _,
|
||||
env!("TARGET"),
|
||||
deno_core::v8_version(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue