bevy/crates/bevy_app/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
..
app.rs Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
lib.rs Add no_std support to bevy (#17955) 2025-03-07 03:39:46 +00:00
main_schedule.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
panic_handler.rs Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
plugin_group.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
plugin.rs Update downcast-rs to version 2 (#17223) 2025-01-07 21:33:40 +00:00
schedule_runner.rs Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
sub_app.rs BevyError: Bevy's new catch-all error type (#18144) 2025-03-07 01:50:07 +00:00
task_pool_plugin.rs Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
terminal_ctrl_c_handler.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00