From ee9a1503edb6ff72cc69514c6336d9f624f0d600 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 15 Jan 2024 11:23:00 -0800 Subject: [PATCH] Async channel v2 (#10692) # Objective - Update async channel to v2. ## Solution - async channel doesn't support `send_blocking` on wasm anymore. So don't compile the pipelined rendering plugin on wasm anymore. - Replaces https://github.com/bevyengine/bevy/pull/10405 ## Migration Guide - The `PipelinedRendering` plugin is no longer exported on wasm. If you are including it in your wasm builds you should remove it. ```rust #[cfg(all(not(target_arch = "wasm32"))] app.add_plugins(bevy_render::pipelined_rendering::PipelinedRenderingPlugin); ``` --------- Co-authored-by: Alice Cecile --- crates/bevy_ecs/Cargo.toml | 2 +- crates/bevy_render/Cargo.toml | 2 +- crates/bevy_render/src/lib.rs | 1 + crates/bevy_tasks/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ecs/Cargo.toml b/crates/bevy_ecs/Cargo.toml index d273ec7746065..da5bc549b9cbc 100644 --- a/crates/bevy_ecs/Cargo.toml +++ b/crates/bevy_ecs/Cargo.toml @@ -21,7 +21,7 @@ bevy_tasks = { path = "../bevy_tasks", version = "0.12.0" } bevy_utils = { path = "../bevy_utils", version = "0.12.0" } bevy_ecs_macros = { path = "macros", version = "0.12.0" } -async-channel = "1.4" +async-channel = "2.1.0" thread_local = "1.1.4" fixedbitset = "0.4.2" rustc-hash = "1.1" diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index fb4a0a04bdea1..bba9e1b98dd27 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -88,7 +88,7 @@ encase = { version = "0.7", features = ["glam"] } profiling = { version = "1", features = [ "profile-with-tracing", ], optional = true } -async-channel = "1.8" +async-channel = "2.1.0" [target.'cfg(target_arch = "wasm32")'.dependencies] js-sys = "0.3" diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index 29d46ae926367..5014b948537bc 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -14,6 +14,7 @@ pub mod extract_resource; pub mod globals; pub mod gpu_component_array_buffer; pub mod mesh; +#[cfg(not(target_arch = "wasm32"))] pub mod pipelined_rendering; pub mod primitives; pub mod render_asset; diff --git a/crates/bevy_tasks/Cargo.toml b/crates/bevy_tasks/Cargo.toml index f374d7f8a9134..1f9f707b0c211 100644 --- a/crates/bevy_tasks/Cargo.toml +++ b/crates/bevy_tasks/Cargo.toml @@ -14,7 +14,7 @@ multi-threaded = [] [dependencies] futures-lite = "2.0.1" async-executor = "1.7.2" -async-channel = "1.4.2" +async-channel = "2.1.0" async-io = { version = "2.0.0", optional = true } async-task = "4.2.0" concurrent-queue = "2.0.0"