mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
a4597a9c14
# Objective - **Describe the objective or issue this PR addresses.** `bevy_asset` includes code [here](4350ad0bd1/crates/bevy_asset/src/io/wasm.rs (L61)
) that references `web_sys::WorkerGlobalScope`. However, `bevy_asset` does not enable this feature, see [here](4350ad0bd1/crates/bevy_asset/Cargo.toml (L50)
). Running examples does not catch this problem because the feature is implicitly included by `wgpu` when `bevy_render` is also a dependency, see [bevy_render](4350ad0bd1/crates/bevy_render/Cargo.toml (L73-L80)
) and [wgpu](3b6112d45d/wgpu/Cargo.toml (L201)
). This results in compile errors for environments that are not using `bevy_render`. To reproduce the problem, try to build the crate individually for wasm targets by running `cargo build -p bevy_asset --target wasm32-unknown-unknown`. Running `cargo tree -e features --target wasm32-unknown-unknown` helped diagnose the issue. ## Solution - **Describe the solution used to achieve the objective above.** This PR adds the `WorkerGlobalScope` feature to the `web-sys` portion of `bevy_asset`'s `Cargo.toml`. It also seems to be the case that `bevy_asset` no longer needs the `Request` feature, since no code for `Request` is present anymore. I confirmed that building the crate individually for wasm succeeds without the feature, so that change is also included here. This is a little off-topic, but the repository would probably benefit from some automation around these types of changes, but I'm not sure what would work there. For example, building each crate individually for some key targets would work, but is...well, a lot. Happy to follow up if there is agreement on a good direction. ## Testing - **Did you test these changes? If so, how?** - **How can other people (reviewers) test your changes? Is there anything specific they need to know?** Building the crate individually for wasm by running `cargo build -p bevy_asset --target wasm32-unknown-unknown`. - **Are there any parts that need more testing?** I don't believe so.
70 lines
2 KiB
TOML
70 lines
2 KiB
TOML
[package]
|
|
name = "bevy_asset"
|
|
version = "0.14.0-dev"
|
|
edition = "2021"
|
|
description = "Provides asset functionality for Bevy Engine"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[features]
|
|
file_watcher = ["notify-debouncer-full", "watch"]
|
|
embedded_watcher = ["file_watcher"]
|
|
multi_threaded = ["bevy_tasks/multi_threaded"]
|
|
asset_processor = []
|
|
watch = []
|
|
trace = []
|
|
|
|
[dependencies]
|
|
bevy_app = { path = "../bevy_app", version = "0.14.0-dev" }
|
|
bevy_asset_macros = { path = "macros", version = "0.14.0-dev" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.14.0-dev" }
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.14.0-dev", features = [
|
|
"uuid",
|
|
] }
|
|
bevy_tasks = { path = "../bevy_tasks", version = "0.14.0-dev" }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.14.0-dev" }
|
|
|
|
async-broadcast = "0.5"
|
|
async-fs = "2.0"
|
|
async-lock = "3.0"
|
|
crossbeam-channel = "0.5"
|
|
downcast-rs = "1.2"
|
|
futures-io = "0.3"
|
|
futures-lite = "2.0.1"
|
|
blake3 = "1.5"
|
|
parking_lot = { version = "0.12", features = ["arc_lock", "send_guard"] }
|
|
ron = "0.8"
|
|
serde = { version = "1", features = ["derive"] }
|
|
thiserror = "1.0"
|
|
uuid = { version = "1.0", features = ["v4"] }
|
|
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
|
bevy_winit = { path = "../bevy_winit", version = "0.14.0-dev" }
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
wasm-bindgen = { version = "0.2" }
|
|
web-sys = { version = "0.3", features = [
|
|
"Window",
|
|
"Response",
|
|
"WorkerGlobalScope",
|
|
] }
|
|
wasm-bindgen-futures = "0.4"
|
|
js-sys = "0.3"
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
notify-debouncer-full = { version = "0.3.1", optional = true }
|
|
|
|
[dev-dependencies]
|
|
bevy_core = { path = "../bevy_core", version = "0.14.0-dev" }
|
|
bevy_log = { path = "../bevy_log", version = "0.14.0-dev" }
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[package.metadata.docs.rs]
|
|
rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
|
|
all-features = true
|