mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
refactor(core): Extension::builder_with_deps (#18093)
Prerequisite for https://github.com/denoland/deno/pull/18080
This commit is contained in:
parent
521cb4ca9b
commit
c3cba7f22c
17 changed files with 309 additions and 289 deletions
|
@ -117,18 +117,20 @@ impl Resource for WebGpuQuerySet {
|
|||
}
|
||||
|
||||
pub fn init(unstable: bool) -> Extension {
|
||||
Extension::builder(env!("CARGO_PKG_NAME"))
|
||||
.dependencies(vec!["deno_webidl", "deno_web"])
|
||||
.esm(include_js_files!("01_webgpu.js", "02_idl_types.js",))
|
||||
.ops(declare_webgpu_ops())
|
||||
.state(move |state| {
|
||||
// TODO: check & possibly streamline this
|
||||
// Unstable might be able to be OpMiddleware
|
||||
// let unstable_checker = state.borrow::<super::UnstableChecker>();
|
||||
// let unstable = unstable_checker.unstable;
|
||||
state.put(Unstable(unstable));
|
||||
})
|
||||
.build()
|
||||
Extension::builder_with_deps(
|
||||
env!("CARGO_PKG_NAME"),
|
||||
&["deno_webidl", "deno_web"],
|
||||
)
|
||||
.esm(include_js_files!("01_webgpu.js", "02_idl_types.js",))
|
||||
.ops(declare_webgpu_ops())
|
||||
.state(move |state| {
|
||||
// TODO: check & possibly streamline this
|
||||
// Unstable might be able to be OpMiddleware
|
||||
// let unstable_checker = state.borrow::<super::UnstableChecker>();
|
||||
// let unstable = unstable_checker.unstable;
|
||||
state.put(Unstable(unstable));
|
||||
})
|
||||
.build()
|
||||
}
|
||||
|
||||
fn deserialize_features(features: &wgpu_types::Features) -> Vec<&'static str> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue