-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for non-browser wasm
#17499
base: main
Are you sure you want to change the base?
Support for non-browser wasm
#17499
Conversation
I'd like to test this with the Bevy CLI prototype before we merge this if possible. Right now, |
Totally reasonable! I personally haven't done much tearing at all with this branch beyond checking compilation works and that CI passes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested on your branch bevy run --example=breakout web --open
and in one of my mini test repos bevy run web --open
.
It both still works out of the box! (well, except for porting to Bevy 0.16)
The code looks sensible as well.
Beautiful! Looking forward to this getting merged 🚀 |
# Objective - Fixes CI failure due to `uuid` 1.13 using the new version of `getrandom` which requires using a new API to work on Wasm. ## Solution - Based on [`uuid` 1.13 release notes](https://github.com/uuid-rs/uuid/releases/tag/1.13.0) I've enabled the `js` feature on `wasm32`. This will need to be revisited once #17499 is up for review - Updated minimum `uuid` version to 1.13.1, which fixes a separate issue with `target_feature = atomics` on `wasm`. ## Testing - `cargo check --target wasm32-unknown-unknown`
…7689) # Objective - Fixes CI failure due to `uuid` 1.13 using the new version of `getrandom` which requires using a new API to work on Wasm. ## Solution - Based on [`uuid` 1.13 release notes](https://github.com/uuid-rs/uuid/releases/tag/1.13.0) I've enabled the `js` feature on `wasm32`. This will need to be revisited once bevyengine#17499 is up for review - Updated minimum `uuid` version to 1.13.1, which fixes a separate issue with `target_feature = atomics` on `wasm`. ## Testing - `cargo check --target wasm32-unknown-unknown`
Objective
no_std
Bevy #15460Solution
browser
feature tobevy_platform_support
,bevy_tasks
, andbevy_app
.browser
feature automatically within crates withoutno_std
support.Testing
compile-check-no-std
with newwasm32v1-none
target andwasm32-wasip1
successfully.Migration Guide
When using Bevy crates which don't automatically enable the
browser
feature, please enable it when building for the browser.Notes
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.wasm
targets (e.g., wasm32-wasip1) provide an incomplete implementation forstd
. 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, considerwasm32-unknown-unknown
as the onlywasm
platform with support from Bevy forstd
. All others likely will need to be treated asno_std
platforms.