diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-11-27 00:58:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 00:58:23 +0100 |
commit | 28b5a7e2ec519e6c1ff928d57368c0d8741a8bb4 (patch) | |
tree | 791f02bb6b41cfa250e56a07c64a1d75010de033 /runtime/build.rs | |
parent | d4f659d1d3caa550dfc15ca9e62d4ad6a31db7ac (diff) |
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 <crowlkats@toaxl.com>
Diffstat (limited to 'runtime/build.rs')
-rw-r--r-- | runtime/build.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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<PathBuf>) { - let extensions: Vec<Extension> = vec![ + let extensions_with_js: Vec<Extension> = 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( |