mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 16:42:21 -05:00
fix(runtime): feature-flag snapshot from snapshot (#16843)
This commit is contained in:
parent
1dd4843b62
commit
9202611e36
4 changed files with 13 additions and 3 deletions
|
@ -26,7 +26,7 @@ harness = false
|
||||||
path = "./bench/lsp_bench_standalone.rs"
|
path = "./bench/lsp_bench_standalone.rs"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
deno_runtime.workspace = true
|
deno_runtime = { workspace = true, features = ["snapshot_from_snapshot"] }
|
||||||
deno_core.workspace = true
|
deno_core.workspace = true
|
||||||
regex.workspace = true
|
regex.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
|
|
|
@ -12,6 +12,8 @@ description = "Provides the deno runtime library"
|
||||||
[features]
|
[features]
|
||||||
# "fake" feature that allows to generate docs on docs.rs
|
# "fake" feature that allows to generate docs on docs.rs
|
||||||
docsrs = []
|
docsrs = []
|
||||||
|
# feature that modifies the snapshot to allow extending it
|
||||||
|
snapshot_from_snapshot = []
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "deno_runtime"
|
name = "deno_runtime"
|
||||||
|
|
|
@ -169,7 +169,14 @@ mod not_docs {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_snapshot(runtime_snapshot_path: PathBuf) {
|
pub fn build_snapshot(runtime_snapshot_path: PathBuf) {
|
||||||
let js_files = get_js_files(env!("CARGO_MANIFEST_DIR"), "js");
|
#[allow(unused_mut)]
|
||||||
|
let mut js_files = get_js_files(env!("CARGO_MANIFEST_DIR"), "js");
|
||||||
|
#[cfg(not(feature = "snapshot_from_snapshot"))]
|
||||||
|
{
|
||||||
|
let manifest = env!("CARGO_MANIFEST_DIR");
|
||||||
|
let path = PathBuf::from(manifest);
|
||||||
|
js_files.push(path.join("js").join("99_main.js"));
|
||||||
|
}
|
||||||
create_runtime_snapshot(runtime_snapshot_path, js_files);
|
create_runtime_snapshot(runtime_snapshot_path, js_files);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ use deno_core::futures::channel::mpsc;
|
||||||
use deno_core::futures::future::poll_fn;
|
use deno_core::futures::future::poll_fn;
|
||||||
use deno_core::futures::stream::StreamExt;
|
use deno_core::futures::stream::StreamExt;
|
||||||
use deno_core::futures::task::AtomicWaker;
|
use deno_core::futures::task::AtomicWaker;
|
||||||
|
use deno_core::located_script_name;
|
||||||
use deno_core::serde::Deserialize;
|
use deno_core::serde::Deserialize;
|
||||||
use deno_core::serde::Serialize;
|
use deno_core::serde::Serialize;
|
||||||
use deno_core::serde_json::json;
|
use deno_core::serde_json::json;
|
||||||
|
@ -31,8 +32,8 @@ use deno_core::ModuleLoader;
|
||||||
use deno_core::ModuleSpecifier;
|
use deno_core::ModuleSpecifier;
|
||||||
use deno_core::RuntimeOptions;
|
use deno_core::RuntimeOptions;
|
||||||
use deno_core::SharedArrayBufferStore;
|
use deno_core::SharedArrayBufferStore;
|
||||||
|
use deno_core::Snapshot;
|
||||||
use deno_core::SourceMapGetter;
|
use deno_core::SourceMapGetter;
|
||||||
use deno_core::{located_script_name, Snapshot};
|
|
||||||
use deno_node::RequireNpmResolver;
|
use deno_node::RequireNpmResolver;
|
||||||
use deno_tls::rustls::RootCertStore;
|
use deno_tls::rustls::RootCertStore;
|
||||||
use deno_web::create_entangled_message_port;
|
use deno_web::create_entangled_message_port;
|
||||||
|
|
Loading…
Reference in a new issue