forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: snapshotting of runtime/ and cli/ (denoland#21430)
This commit removes some of the technical debt related to snapshotting JS code: - "cli/ops/mod.rs" and "cli/build.rs" no longer define "cli" extension which was not required anymore - Cargo features for "deno_runtime" crate have been unified in "cli/Cargo.toml" - "cli/build.rs" uses "deno_runtime::snapshot::create_runtime_snapshot" API instead of copy-pasting the code - "cli/js/99_main.js" was completely removed as it's not necessary anymore Towards denoland#21137
- Loading branch information
1 parent
0f990d9
commit f6b889b
Showing
9 changed files
with
30 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,5 @@ | ||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. | ||
|
||
use deno_core::Extension; | ||
|
||
pub mod bench; | ||
pub mod jupyter; | ||
pub mod testing; | ||
|
||
pub fn cli_exts() -> Vec<Extension> { | ||
vec![ | ||
#[cfg(not(feature = "__runtime_js_sources"))] | ||
cli::init_ops(), | ||
#[cfg(feature = "__runtime_js_sources")] | ||
cli::init_ops_and_esm(), | ||
] | ||
} | ||
|
||
// ESM parts duplicated in `../build.rs`. Keep in sync! | ||
deno_core::extension!(cli, | ||
deps = [runtime], | ||
esm_entry_point = "ext:cli/99_main.js", | ||
esm = [ | ||
dir "js", | ||
"40_testing.js", | ||
"99_main.js" | ||
], | ||
customizer = |ext: &mut deno_core::Extension| { | ||
ext.esm_files.to_mut().push(deno_core::ExtensionFileSource { | ||
specifier: "ext:cli/runtime/js/99_main.js", | ||
code: deno_core::ExtensionFileSourceCode::LoadedFromFsDuringSnapshot( | ||
deno_runtime::js::PATH_FOR_99_MAIN_JS, | ||
), | ||
}); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters