From aaf2bf4bfbf90bed0b6e9812f337f057d1d24f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 17 Sep 2024 02:13:34 +0100 Subject: chore: upgrade deno_core (#25674) No functional changes, just removes dead code. --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- cli/factory.rs | 1 - cli/main.rs | 12 ------------ ext/broadcast_channel/lib.rs | 9 +++------ ext/cron/lib.rs | 4 +--- ext/kv/lib.rs | 4 +--- ext/net/lib.rs | 4 +--- ext/net/ops.rs | 5 +---- runtime/ops/mod.rs | 6 +----- 10 files changed, 15 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2636e236..13f757f0e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1405,9 +1405,9 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.308.0" +version = "0.309.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62fc8250fa9da059cc05b18328319a9048c73e4889ca929cc60877a8a1bfc4d4" +checksum = "eaecc78e8903d1b5d95c7fb01a14eb342b9e63484763a304fd30a8f48861f9df" dependencies = [ "anyhow", "bincode", @@ -1887,9 +1887,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.184.0" +version = "0.185.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a465b7d691ad7cae41e8f51bd954b1e3ffd201b84dc30de2c16cf91034946e" +checksum = "2d817c00b3f30bef495c84080b5ed327ed68d6d2636b5ed8b730d00a06221dc1" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -6257,9 +6257,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.217.0" +version = "0.218.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467c0a7bfc67cd918f1f7ab7a5ab70a9e744e466ff428cd728ff2c03bc77874c" +checksum = "134add6f9dc7a226912468f7c427a476583ab362e094f04ff3a9fa79f2df97c7" dependencies = [ "num-bigint", "serde", diff --git a/Cargo.toml b/Cargo.toml index e5d8c6e05..5cf29fadc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ repository = "https://github.com/denoland/deno" [workspace.dependencies] deno_ast = { version = "=0.42.0", features = ["transpiling"] } -deno_core = { version = "0.308.0" } +deno_core = { version = "0.309.0" } deno_bench_util = { version = "0.162.0", path = "./bench_util" } deno_lockfile = "=0.23.1" diff --git a/cli/factory.rs b/cli/factory.rs index fe6d5b92a..6d14475b2 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -726,7 +726,6 @@ impl CliFactory { let cli_options = self.cli_options()?; let mut checker = FeatureChecker::default(); checker.set_exit_cb(Box::new(crate::unstable_exit_cb)); - checker.set_warn_cb(Box::new(crate::unstable_warn_cb)); let unstable_features = cli_options.unstable_features(); for granular_flag in crate::UNSTABLE_GRANULAR_FLAGS { if unstable_features.contains(&granular_flag.name.to_string()) { diff --git a/cli/main.rs b/cli/main.rs index 6a4fa6f9d..10d9ead4e 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -417,18 +417,6 @@ pub(crate) fn unstable_exit_cb(feature: &str, api_name: &str) { std::process::exit(70); } -// TODO(bartlomieju): remove when `--unstable` flag is removed. -#[allow(clippy::print_stderr)] -pub(crate) fn unstable_warn_cb(feature: &str, api_name: &str) { - eprintln!( - "⚠️ {}", - colors::yellow(format!( - "The `{}` API was used with `--unstable` flag. The `--unstable` flag is deprecated and will be removed in Deno 2.0. Use granular `--unstable-{}` instead.\nLearn more at: https://docs.deno.com/runtime/manual/tools/unstable_flags", - api_name, feature - )) - ); -} - pub fn main() { setup_panic_hook(); diff --git a/ext/broadcast_channel/lib.rs b/ext/broadcast_channel/lib.rs index 437580971..47c48656d 100644 --- a/ext/broadcast_channel/lib.rs +++ b/ext/broadcast_channel/lib.rs @@ -50,12 +50,9 @@ pub fn op_broadcast_subscribe( where BC: BroadcastChannel + 'static, { - // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` - // once we phase out `check_or_exit_with_legacy_fallback` - state.feature_checker.check_or_exit_with_legacy_fallback( - UNSTABLE_FEATURE_NAME, - "BroadcastChannel", - ); + state + .feature_checker + .check_or_exit(UNSTABLE_FEATURE_NAME, "BroadcastChannel"); let bc = state.borrow::(); let resource = bc.subscribe()?; Ok(state.resource_table.add(resource)) diff --git a/ext/cron/lib.rs b/ext/cron/lib.rs index 95e38179d..e350e4d69 100644 --- a/ext/cron/lib.rs +++ b/ext/cron/lib.rs @@ -62,11 +62,9 @@ where { let cron_handler = { let state = state.borrow(); - // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` - // once we phase out `check_or_exit_with_legacy_fallback` state .feature_checker - .check_or_exit_with_legacy_fallback(UNSTABLE_FEATURE_NAME, "Deno.cron"); + .check_or_exit(UNSTABLE_FEATURE_NAME, "Deno.cron"); state.borrow::>().clone() }; diff --git a/ext/kv/lib.rs b/ext/kv/lib.rs index c7a995073..45095724d 100644 --- a/ext/kv/lib.rs +++ b/ext/kv/lib.rs @@ -129,11 +129,9 @@ where { let handler = { let state = state.borrow(); - // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` - // once we phase out `check_or_exit_with_legacy_fallback` state .feature_checker - .check_or_exit_with_legacy_fallback(UNSTABLE_FEATURE_NAME, "Deno.openKv"); + .check_or_exit(UNSTABLE_FEATURE_NAME, "Deno.openKv"); state.borrow::>().clone() }; let db = handler.open(state.clone(), path).await?; diff --git a/ext/net/lib.rs b/ext/net/lib.rs index 0ef3e85c4..b039965d4 100644 --- a/ext/net/lib.rs +++ b/ext/net/lib.rs @@ -88,11 +88,9 @@ impl NetPermissions for deno_permissions::PermissionsContainer { /// Helper for checking unstable features. Used for sync ops. fn check_unstable(state: &OpState, api_name: &str) { - // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` - // once we phase out `check_or_exit_with_legacy_fallback` state .feature_checker - .check_or_exit_with_legacy_fallback(UNSTABLE_FEATURE_NAME, api_name); + .check_or_exit(UNSTABLE_FEATURE_NAME, api_name); } pub fn get_declaration() -> PathBuf { diff --git a/ext/net/ops.rs b/ext/net/ops.rs index 67d32fe03..f2735eda9 100644 --- a/ext/net/ops.rs +++ b/ext/net/ops.rs @@ -1063,12 +1063,9 @@ mod tests { } ); - let mut feature_checker = deno_core::FeatureChecker::default(); - feature_checker.enable_legacy_unstable(); - let mut runtime = JsRuntime::new(RuntimeOptions { extensions: vec![test_ext::init_ops()], - feature_checker: Some(Arc::new(feature_checker)), + feature_checker: Some(Arc::new(Default::default())), ..Default::default() }); diff --git a/runtime/ops/mod.rs b/runtime/ops/mod.rs index ad650a776..feed5052b 100644 --- a/runtime/ops/mod.rs +++ b/runtime/ops/mod.rs @@ -17,11 +17,7 @@ use deno_core::OpState; /// Helper for checking unstable features. Used for sync ops. pub fn check_unstable(state: &OpState, feature: &str, api_name: &str) { - // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` - // once we phase out `check_or_exit_with_legacy_fallback` - state - .feature_checker - .check_or_exit_with_legacy_fallback(feature, api_name); + state.feature_checker.check_or_exit(feature, api_name); } pub struct TestingFeaturesEnabled(pub bool); -- cgit v1.2.3