wasm-bindgen/Cargo.toml
Alex Crichton 3c887c40b7
Default all async support to std::future (#1741)
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
2019-09-05 11:18:36 -05:00

95 lines
2.6 KiB
TOML

[package]
name = "wasm-bindgen"
version = "0.2.50"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
readme = "README.md"
categories = ["wasm"]
repository = "https://github.com/rustwasm/wasm-bindgen"
homepage = "https://rustwasm.github.io/"
documentation = "https://docs.rs/wasm-bindgen"
description = """
Easy support for interacting between JS and Rust.
"""
edition = "2018"
[package.metadata.docs.rs]
features = ['serde-serialize']
[lib]
test = false
[features]
default = ["spans", "std"]
spans = ["wasm-bindgen-macro/spans"]
std = []
serde-serialize = ["serde", "serde_json", "std"]
nightly = []
enable-interning = ["std"]
# Whether or not the `#[wasm_bindgen]` macro is strict and generates an error on
# all unused attributes
strict-macro = ["wasm-bindgen-macro/strict-macro"]
# This is only for debugging wasm-bindgen! No stability guarantees, so enable
# this at your own peril!
xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"]
[dependencies]
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.50" }
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
cfg-if = "0.1.9"
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
js-sys = { path = 'crates/js-sys', version = '0.3.27' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.3.0' }
serde_derive = "1.0"
wasm-bindgen-test-crate-a = { path = 'tests/crates/a', version = '0.1' }
wasm-bindgen-test-crate-b = { path = 'tests/crates/b', version = '0.1' }
[workspace]
members = [
"benchmarks",
"crates/cli",
"crates/js-sys",
"crates/test",
"crates/test/sample",
"crates/typescript-tests",
"crates/web-sys",
"crates/webidl",
"crates/webidl-tests",
"examples/add",
"examples/canvas",
"examples/char",
"examples/closures",
"examples/console_log",
"examples/dom",
"examples/duck-typed-interfaces",
"examples/fetch",
"examples/guide-supported-types-examples",
"examples/hello_world",
"examples/import_js/crate",
"examples/julia_set",
"examples/paint",
"examples/performance",
"examples/raytrace-parallel",
"examples/request-animation-frame",
"examples/todomvc",
"examples/wasm-in-wasm",
"examples/wasm2js",
"examples/webaudio",
"examples/webgl",
"examples/websockets",
"examples/without-a-bundler",
"examples/without-a-bundler-no-modules",
"tests/no-std",
]
exclude = ['crates/typescript']
[patch.crates-io]
wasm-bindgen = { path = '.' }
wasm-bindgen-futures = { path = 'crates/futures' }
js-sys = { path = 'crates/js-sys' }
web-sys = { path = 'crates/web-sys' }