Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
[target.wasm32-unknown-unknown]
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]

# Make `#[wasm_bindgen]` emit `js_sys::futures` glue instead of
# `wasm_bindgen_futures` for every cargo invocation in this workspace
# (check, clippy, build). The proc-macro reads this at expansion time, so it
# must be present for host builds too, not just the wasm build worker-build runs.
[env]
WASM_BINDGEN_USE_JS_SYS = "1"
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ proc-macro2 = "1.0.60"
quote = "1.0.28"
wasm-bindgen = { version = "0.2.123" }
wasm-bindgen-cli-support = { version = "0.2.123" }
wasm-bindgen-futures = { version = "0.4.73" }
wasm-bindgen-macro-support = { version = "0.2.123" }
wasm-bindgen-shared = { version = "0.2.123" }
wasm-bindgen-test = { version = "0.3.73" }
Expand Down
1 change: 0 additions & 1 deletion examples/axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ worker-macros = { workspace = true, features = ['http'] }
axum = { version = "0.8", default-features = false, features = ['json'] }
axum-macros = "0.5.0"
tower-service = "0.3.3"
wasm-bindgen-futures = { workspace = true }
wasm-bindgen = { workspace = true }
serde = { version = "1.0", features = ["derive"] }
2 changes: 1 addition & 1 deletion examples/tokio-postgres/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async fn main(_req: Request, env: Env, _ctx: Context) -> anyhow::Result<Response

let (client, connection) = config.connect_raw(socket, PassthroughTls).await?;

wasm_bindgen_futures::spawn_local(async move {
js_sys::futures::spawn_local(async move {
if let Err(error) = connection.await {
console_log!("connection error: {:?}", error);
}
Expand Down
1 change: 0 additions & 1 deletion worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ tokio-postgres = { version = "0.7", optional = true, default-features = false, f
"js",
] }
url = "2.4.0"
wasm-bindgen-futures.workspace = true
wasm-bindgen.workspace = true
wasm-streams.workspace = true
web-sys.workspace = true
Expand Down
1 change: 0 additions & 1 deletion worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ pub use async_trait;
pub use js_sys;
pub use url::Url;
pub use wasm_bindgen;
pub use wasm_bindgen_futures;
pub use web_sys;

pub use cf::{Cf, CfResponseProperties, TlsClientAuth};
Expand Down
2 changes: 1 addition & 1 deletion worker/src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ type EvCallback<T> = Closure<dyn FnMut(T)>;
/// server.accept()?;
///
/// // Spawn a future for handling the stream of events from the websocket.
/// wasm_bindgen_futures::spawn_local(async move {
/// js_sys::futures::spawn_local(async move {
/// let mut event_stream = server.events().expect("could not open stream");
///
/// while let Some(event) = event_stream.next().await {
Expand Down
Loading