bevy/crates/bevy_tasks/src
Zachary Harrold c6204279eb
Support for non-browser wasm (#17499)
# Objective

- Contributes to #15460
- Supersedes #8520
- Fixes #4906

## Solution

- Added a new `web` feature to `bevy`, and several of its crates.
- Enabled new `web` feature automatically within crates without `no_std`
support.

## Testing

- `cargo build --no-default-features --target wasm32v1-none`

---

## Migration Guide

When using Bevy crates which _don't_ automatically enable the `web`
feature, please enable it when building for the browser.

## Notes

- I added [`cfg_if`](https://crates.io/crates/cfg-if) to help manage
some of the feature gate gore that this extra feature introduces. It's
still pretty ugly, but I think much easier to read.
- Certain `wasm` targets (e.g.,
[wasm32-wasip1](https://doc.rust-lang.org/nightly/rustc/platform-support/wasm32-wasip1.html#wasm32-wasip1))
provide an incomplete implementation for `std`. I have not tested these
platforms, but I suspect Bevy's liberal use of usually unsupported
features (e.g., threading) will cause these targets to fail. As such,
consider `wasm32-unknown-unknown` as the only `wasm` platform with
support from Bevy for `std`. All others likely will need to be treated
as `no_std` platforms.
2025-03-07 21:22:28 +00:00
..
iter Add no_std support to bevy_tasks (#15464) 2024-12-06 02:14:54 +00:00
edge_executor.rs Add no_std support to bevy (#17955) 2025-03-07 03:39:46 +00:00
executor.rs Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
futures.rs Move futures.rs, ConditionalSend and BoxedFuture types to bevy_tasks (#16951) 2024-12-29 19:29:53 +00:00
lib.rs Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
single_threaded_task_pool.rs Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
slice.rs Remove Implicit std Prelude from no_std Crates (#17086) 2025-01-03 01:58:43 +00:00
task_pool.rs TaskPool: Prefer task completion over executing new tasks (#18009) 2025-02-26 00:08:36 +00:00
task.rs Fix no_std CI Warnings and WASM Compatibility (#17049) 2024-12-30 23:01:27 +00:00
thread_executor.rs Fix no_std CI Warnings and WASM Compatibility (#17049) 2024-12-30 23:01:27 +00:00
usages.rs Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
wasm_task.rs Fix no_std CI Warnings and WASM Compatibility (#17049) 2024-12-30 23:01:27 +00:00