diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-09 20:22:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-09 19:22:27 -0500 |
commit | d1685b120bf7da5ba384806153f65d90ef156b77 (patch) | |
tree | 155c87f1beae810f52fb2a9ef9ab7526fa1af990 /runtime/worker.rs | |
parent | 78d430103a8f6931154ddbbe19d36f3b8630286d (diff) |
refactor(core): remove RuntimeOptions::extensions_with_js (#18099)
This commit removes "deno_core::RuntimeOptions::extensions_with_js".
Now it's embedders' responsibility to properly register extensions
that will not contains JavaScript sources when running from an existing
snapshot.
Prerequisite for https://github.com/denoland/deno/pull/18080
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r-- | runtime/worker.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs index ff55e27cc..7ce6eb58d 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -72,21 +72,11 @@ pub struct WorkerOptions { pub bootstrap: BootstrapOptions, /// JsRuntime extensions, not to be confused with ES modules. - /// Only ops registered by extensions will be initialized. If you need - /// to execute JS code from extensions, use `extensions_with_js` options - /// instead. - pub extensions: Vec<Extension>, - - /// JsRuntime extensions, not to be confused with ES modules. - /// Ops registered by extensions will be initialized and JS code will be - /// executed. If you don't need to execute JS code from extensions, use - /// `extensions` option instead. /// - /// This is useful when creating snapshots, in such case you would pass - /// extensions using `extensions_with_js`, later when creating a runtime - /// from the snapshot, you would pass these extensions using `extensions` - /// option. - pub extensions_with_js: Vec<Extension>, + /// Extensions register "ops" and JavaScript sources provided in `js` or `esm` + /// configuration. If you are using a snapshot, then extensions shouldn't + /// provide JavaScript sources that were already snapshotted. + pub extensions: Vec<Extension>, /// V8 snapshot that should be loaded on startup. pub startup_snapshot: Option<Snapshot>, @@ -174,7 +164,6 @@ impl Default for WorkerOptions { npm_resolver: Default::default(), blob_store: Default::default(), extensions: Default::default(), - extensions_with_js: Default::default(), startup_snapshot: Default::default(), bootstrap: Default::default(), stdio: Default::default(), @@ -299,7 +288,6 @@ impl MainWorker { shared_array_buffer_store: options.shared_array_buffer_store.clone(), compiled_wasm_module_store: options.compiled_wasm_module_store.clone(), extensions, - extensions_with_js: options.extensions_with_js, inspector: options.maybe_inspector_server.is_some(), is_main: true, leak_isolate: options.leak_isolate, |