Reland "refactor(core): cleanup feature flags for js source inclusion" (#19519)

Relands #19463. This time the `ExtensionFileSourceCode` enum is
preserved, so this effectively just splits feature
`include_js_for_snapshotting` into `exclude_js_sources` and
`runtime_js_sources`, adds a `force_include_js_sources` option on
`extension!()`, and unifies `ext::Init_ops_and_esm()` and
`ext::init_ops()` into `ext::init()`.
This commit is contained in:
Nayeem Rahman 2023-06-25 08:35:31 +01:00 committed by GitHub
parent a181ceb0e3
commit 28a4f3d0f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 290 additions and 326 deletions

View file

@ -122,7 +122,7 @@ fn get_asset_texts_from_new_runtime() -> Result<Vec<AssetText>, AnyError> {
// the assets are stored within the typescript isolate, so take them out of there
let mut runtime = JsRuntime::new(RuntimeOptions {
startup_snapshot: Some(compiler_snapshot()),
extensions: vec![deno_cli_tsc::init_ops()],
extensions: vec![deno_cli_tsc::init_ext()],
..Default::default()
});
let global = runtime
@ -787,7 +787,7 @@ pub fn exec(request: Request) -> Result<Response, AnyError> {
let mut runtime = JsRuntime::new(RuntimeOptions {
startup_snapshot: Some(compiler_snapshot()),
extensions: vec![deno_cli_tsc::init_ops(
extensions: vec![deno_cli_tsc::init_ext(
request,
root_map,
remapped_specifiers,