mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
... and add a parallel raytracing demo! This commit adds enough support to `wasm-bindgen` to produce a workable wasm binary *today* with the experimental WebAssembly threads support implemented in Firefox Nightly. I've tried to comment what's going on in the commits and such, but at a high level the changes made here are: * A new transformation, living in a new `wasm-bindgen-threads-xform` crate, prepares a wasm module for parallel execution. This performs a number of mundane tasks which I hope to detail in a blog post later on. * The `--no-modules` output is enhanced with more support for when shared memory is enabled, allowing passing in the module/memory to initialize the wasm instance on multiple threads (sharing both module and memory). * The `wasm-bindgen` crate now offers the ability, in `--no-modules` mode, to get a handle on the `WebAssembly.Module` instance. * The example itself requires Xargo to recompile the standard library with atomics and an experimental feature enabled. Afterwards it experimentally also enables threading support in wasm-bindgen. I've also added hopefully enough CI support to compile this example in a builder so we can upload it and poke around live online. I hope to detail more about the technical details here in a blog post soon as well!
85 lines
2.3 KiB
TOML
85 lines
2.3 KiB
TOML
[package]
|
|
name = "wasm-bindgen"
|
|
version = "0.2.25"
|
|
authors = ["The wasm-bindgen Developers"]
|
|
license = "MIT/Apache-2.0"
|
|
# Because only a single `wasm_bindgen` version can be used in a dependency
|
|
# graph, pretend we link a native library so that `cargo` will provide better
|
|
# error messages than the esoteric linker errors we would otherwise trigger.
|
|
links = "wasm_bindgen"
|
|
readme = "README.md"
|
|
categories = ["wasm"]
|
|
repository = "https://github.com/rustwasm/wasm-bindgen"
|
|
homepage = "https://rustwasm.github.io/wasm-bindgen/"
|
|
documentation = "https://docs.rs/wasm-bindgen"
|
|
description = """
|
|
Easy support for interacting between JS and Rust.
|
|
"""
|
|
|
|
[package.metadata.docs.rs]
|
|
features = ['serde-serialize']
|
|
|
|
[lib]
|
|
test = false
|
|
doctest = false
|
|
|
|
[features]
|
|
default = ["spans", "std"]
|
|
spans = ["wasm-bindgen-macro/spans"]
|
|
std = []
|
|
serde-serialize = ["serde", "serde_json", "std"]
|
|
nightly = []
|
|
|
|
# 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.25" }
|
|
serde = { version = "1.0", optional = true }
|
|
serde_json = { version = "1.0", optional = true }
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
|
js-sys = { path = 'crates/js-sys', version = '0.3.2' }
|
|
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.25' }
|
|
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 = [
|
|
"crates/cli",
|
|
"crates/js-sys",
|
|
"crates/test",
|
|
"crates/test/sample",
|
|
"crates/typescript",
|
|
"crates/macro/ui-tests",
|
|
"crates/web-sys",
|
|
"crates/webidl",
|
|
"crates/webidl-tests",
|
|
"examples/add",
|
|
"examples/canvas",
|
|
"examples/char",
|
|
"examples/closures",
|
|
"examples/console_log",
|
|
"examples/duck-typed-interfaces",
|
|
"examples/dom",
|
|
"examples/fetch",
|
|
"examples/guide-supported-types-examples",
|
|
"examples/hello_world",
|
|
"examples/import_js",
|
|
"examples/julia_set",
|
|
"examples/no_modules",
|
|
"examples/paint",
|
|
"examples/performance",
|
|
"examples/raytrace-parallel",
|
|
"examples/wasm-in-wasm",
|
|
"examples/wasm2js",
|
|
"examples/webaudio",
|
|
"examples/webgl",
|
|
"tests/no-std",
|
|
]
|
|
|
|
[patch.crates-io]
|
|
wasm-bindgen = { path = '.' }
|