You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added support for the wasm32v1-none target (#4277)
This PR adds support for the `wasm32v1-none` target and should enable all features previously behind `cfg(feature = "std")` for both `wasm32-unknown-unknown` and `wasm32v1-none`. Additionally, now `js-sys`, `web-sys`, `wasm-bindgen-futures` and `wasm-bindgen-test` support `no_std`.
Changes:
- Use `any(target_os = "unknown", target_os = "none")` instead of `target_os = "unknown"`.
- For globals:
- Continue to use `once_cell::sync::Lazy` when targeting `std`.
- Use `Send + Sync` wrapped `once_cell::unsync::Lazy` when targeting `no_std` without `target_feature = "atomics"`.
- Use `once_cell/critical_section` when targeting `no_std` with `target_feature = "atomics"`. As recommended by `critical_section`, this is something the user has to enable. Notable this only affects `link_to!`, any other feature will work as expected with no additional work required from the user.
- For thread locals:
- Continue to use `std::thread_local!` when targeting `std`.
- Use `static mut` when targeting `no_std` without `target_feature = "atomics"`.
- Use `#[thread_local]` when targeting `no_std` with `target_feature = "atomics"`.
- Add `std` crate feature to `js-sys`, `web-sys`, `wasm-bindgen-futures` and `wasm-bindgen-test` and enable by default. This makes it possible to use these crates with `no_std` for both targets as well.
- Inlined [`console_error_panic_hook`](https://crates.io/crates/console_error_panic_hook) and a `no_std` version of [`scoped_tls`](https://crates.io/crates/scoped-tls).
Missing:
- Add `wasm32v1-none` to CI. Probably in a follow-up when its stable, ergo Rust v1.84.
- run: for i in examples/*/; do cd "$i"; cargo +stable clippy --no-deps --all-features --target wasm32-unknown-unknown -- -D warnings || exit 1; cd ../..; done
* String enums now generate private TypeScript types but only if used.
@@ -46,6 +55,9 @@
46
55
*`wasm-bindgen-test-runner` now tries to restart the WebDriver on failure, instead of spending its timeout period trying to connect to a non-existing WebDriver.
* Deprecated `#[wasm_bindgen(thread_local)]` in favor of `#[wasm_bindgen(thread_local_v2)]`, which creates a `wasm_bindgen::JsThreadLocal`. It is similar to `std::thread::LocalKey` but supports `no_std`.
0 commit comments