diff --git a/Cargo.toml b/Cargo.toml index 8a40873..4e92be9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ default = ["es_modules"] es_modules = [] [target.'cfg(target_arch = "wasm32")'.dependencies] -wasm-bindgen = "0.2" -web-sys = { version = "0.3", features = [ +wasm-bindgen = "0.2.95" +web-sys = { version = "0.3.72", features = [ "Blob", "DedicatedWorkerGlobalScope", "MessageEvent", @@ -30,18 +30,18 @@ web-sys = { version = "0.3", features = [ "Navigator", "WorkerNavigator", ] } -js-sys = "0.3" -futures = "0.3" +js-sys = "0.3.72" +futures = "0.3.31" [dev-dependencies] -log = "0.4" -env_logger = "0.11" +log = "0.4.22" +env_logger = "0.11.5" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -console_log = { version = "1.0", features = ["color"] } -console_error_panic_hook = "0.1" -wasm-bindgen-test = "0.3" -async-channel = "2.2" +console_log = { version = "1.0.0", features = ["color"] } +console_error_panic_hook = "0.1.7" +wasm-bindgen-test = "0.3.45" +async-channel = "2.3.1" [package.metadata.docs.rs] targets = ["wasm32-unknown-unknown"] diff --git a/src/wasm32/mod.rs b/src/wasm32/mod.rs index 2435747..27cf3c6 100644 --- a/src/wasm32/mod.rs +++ b/src/wasm32/mod.rs @@ -1,4 +1,3 @@ -pub use std::thread::{current, sleep, Result, Thread, ThreadId}; use std::{ cell::UnsafeCell, fmt, @@ -7,6 +6,7 @@ use std::{ panic::{catch_unwind, AssertUnwindSafe}, rc::Rc, sync::{Arc, Mutex}, + thread::{Result, Thread}, }; use scoped::ScopeData; @@ -280,17 +280,17 @@ impl Builder { let script = worker_script_url.unwrap_or(get_worker_script(wasm_bindgen_shim_url)); // Todo: figure out how to set stack size - let mut options = WorkerOptions::new(); + let options = WorkerOptions::new(); match (name, prefix) { (Some(name), Some(prefix)) => { - options.name(&format!("{}:{}", prefix, name)); + options.set_name(&format!("{}:{}", prefix, name)); } (Some(name), None) => { - options.name(&name); + options.set_name(&name); } (None, Some(prefix)) => { let random = (js_sys::Math::random() * 10e10) as u64; - options.name(&format!("{}:{}", prefix, random)); + options.set_name(&format!("{}:{}", prefix, random)); } (None, None) => {} }; @@ -298,11 +298,11 @@ impl Builder { #[cfg(feature = "es_modules")] { js_sys::eval(include_str!("js/module_workers_polyfill.min.js")).unwrap(); - options.type_(WorkerType::Module); + options.set_type(WorkerType::Module); } #[cfg(not(feature = "es_modules"))] { - options.type_(WorkerType::Classic); + options.set_type(WorkerType::Classic); } // Spawn the worker