From 286e5d0be9bb11a69d55f0eedd4a6678b0d48e7d Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 8 Feb 2023 22:40:18 +0100 Subject: refactor: internal runtime code TS support (#17672) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a proof of concept for being able to snapshot TypeScript files. Currently only a single runtime file is authored in TypeScript - "runtime/js/01_version.ts". Not needed infrastructure was removed from "core/snapshot_util.rs". --------- Co-authored-by: Bartek IwaƄczuk --- runtime/js.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'runtime/js.rs') diff --git a/runtime/js.rs b/runtime/js.rs index 3d14c744c..82e58a09c 100644 --- a/runtime/js.rs +++ b/runtime/js.rs @@ -2,7 +2,6 @@ use deno_core::Snapshot; use log::debug; use once_cell::sync::Lazy; -use std::path::PathBuf; pub static RUNTIME_SNAPSHOT: Lazy> = Lazy::new( #[allow(clippy::uninit_vec)] @@ -35,8 +34,5 @@ pub fn deno_isolate_init() -> Snapshot { Snapshot::Static(&RUNTIME_SNAPSHOT) } -pub fn get_99_main() -> PathBuf { - let manifest = env!("CARGO_MANIFEST_DIR"); - let path = PathBuf::from(manifest); - path.join("js").join("99_main.js") -} +#[cfg(feature = "snapshot_from_snapshot")] +pub static SOURCE_CODE_FOR_99_MAIN_JS: &str = include_str!("js/99_main.js"); -- cgit v1.2.3