From 28b5a7e2ec519e6c1ff928d57368c0d8741a8bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 27 Nov 2022 00:58:23 +0100 Subject: feat(core): support initializing extensions with and without JS (#16789) This commit allows to execute more JS code from extensions when creating a snapshot from an existing snapshot. "deno_core::RuntimeOptions::extensions_with_js" field was added that is used to pass a list of extensions whose both "ops" and associated JS source should be executed upon start. Co-authored-by: crowlkats --- runtime/build.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/build.rs b/runtime/build.rs index bab7745cc..62a3da03b 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -120,7 +120,7 @@ mod not_docs { } fn create_runtime_snapshot(snapshot_path: PathBuf, files: Vec) { - let extensions: Vec = vec![ + let extensions_with_js: Vec = vec![ deno_webidl::init(), deno_console::init(), deno_url::init(), @@ -154,7 +154,8 @@ mod not_docs { cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"), snapshot_path, startup_snapshot: None, - extensions, + extensions: vec![], + extensions_with_js, additional_files: files, compression_cb: Some(Box::new(|vec, snapshot_slice| { lzzzz::lz4_hc::compress_to_vec( -- cgit v1.2.3