mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-15 04:23:12 +03:00
3c887c40b7
This commit defaults all crates in-tree to use `std::future` by default and none of them support the crates.io `futures` 0.1 crate any more. This is a breaking change for `wasm-bindgen-futures` and `wasm-bindgen-test` so they've both received a major version bump to reflect the new defaults. Historical versions of these crates should continue to work if necessary, but they won't receive any more maintenance after this is merged. The movement here liberally uses `async`/`await` to remove the need for using any combinators on the `Future` trait. As a result many of the crates now rely on a much more recent version of the compiler, especially to run tests. The `wasm-bindgen-futures` crate was updated to remove all of its futures-related dependencies and purely use `std::future`, hopefully improving its compatibility by not having any version compat considerations over time. The implementations of the executors here are relatively simple and only delve slightly into the `RawWaker` business since there are no other stable APIs in `std::task` for wrapping these. This commit also adds support for: #[wasm_bindgen_test] async fn foo() { // ... } where previously you needed to pass `(async)` now that's inferred because it's an `async fn`. Closes #1558 Closes #1695
27 lines
491 B
TOML
27 lines
491 B
TOML
[package]
|
|
name = "fetch"
|
|
version = "0.1.0"
|
|
authors = ["The wasm-bindgen Developers"]
|
|
edition = "2018"
|
|
|
|
[lib]
|
|
crate-type = ["cdylib"]
|
|
|
|
[dependencies]
|
|
wasm-bindgen = { version = "0.2.50", features = ["serde-serialize"] }
|
|
js-sys = "0.3.27"
|
|
wasm-bindgen-futures = "0.4.0"
|
|
serde = { version = "1.0.80", features = ["derive"] }
|
|
serde_derive = "^1.0.59"
|
|
|
|
[dependencies.web-sys]
|
|
version = "0.3.4"
|
|
features = [
|
|
'Headers',
|
|
'Request',
|
|
'RequestInit',
|
|
'RequestMode',
|
|
'Response',
|
|
'Window',
|
|
]
|