From 95392decd0ce364f9f4b9bd94e72bc28ab95fa60 Mon Sep 17 00:00:00 2001 From: Rob <136381220+robertpakalns@users.noreply.github.com> Date: Thu, 12 Feb 2026 01:39:34 +0200 Subject: [PATCH] Add `no_std` support for the `wgpu/web` feature (#8981) Co-authored-by: Connor Fitzgerald --- Cargo.toml | 8 ++++---- wgpu/Cargo.toml | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8321e4229..0eb305aaa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -288,11 +288,11 @@ windows = { version = "0.62", default-features = false } # wasm32 dependencies console_error_panic_hook = "0.1.5" console_log = "1" -js-sys = { version = "0.3.77", default-features = false } -wasm-bindgen = "0.2.100" -wasm-bindgen-futures = "0.4.43" +js-sys = { version = "0.3.85", default-features = false } +wasm-bindgen = { version = "0.2.108", default-features = false } +wasm-bindgen-futures = { version = "0.4.58", default-features = false } wasm-bindgen-test = "0.3" -web-sys = { version = "0.3.77", default-features = false } +web-sys = { version = "0.3.85", default-features = false } web-time = "1.1.0" # deno dependencies diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 35d827254..ccb10f837 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -172,7 +172,15 @@ web = ["dep:wasm-bindgen", "dep:js-sys", "dep:web-sys", "wgpu-types/web"] ## ## This can allow for better error reporting and for improved multithreading ## support. -std = ["raw-window-handle/std", "wgpu-types/std", "wgpu-core?/std"] +std = [ + "raw-window-handle/std", + "wgpu-types/std", + "wgpu-core?/std", + "js-sys?/std", + "web-sys?/std", + "wasm-bindgen?/std", + "wasm-bindgen-futures?/std", +] ## Uses `parking_lot` as the implementation for locking primitives. ## @@ -227,7 +235,7 @@ smallvec.workspace = true ############### [target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies] # Needed for all backends -js-sys = { workspace = true, optional = true, features = ["default"] } +js-sys = { workspace = true, optional = true } wasm-bindgen = { workspace = true, optional = true } web-sys = { workspace = true, optional = true, features = [ "HtmlCanvasElement",