mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 05:52:21 +03:00
269c491380
* Gate `web-sys` APIs on activated features Currently the compile times of `web-sys` are unfortunately prohibitive, increasing the barrier to using it. This commit updates the crate to instead have all APIs gated by a set of Cargo features which affect what bindings are generated at compile time (and which are then compiled by rustc). It's significantly faster to activate only a handful of features vs all thousand of them! A magical env var is added to print the list of all features that should be generated, and then necessary logic is added to ferry features from the build script to the webidl crate which then uses that as a filter to remove items after parsing. Currently parsing is pretty speedy so we'll unconditionally parse all WebIDL files, but this may change in the future! For now this will make the `web-sys` crate a bit less ergonomic to use as lots of features will need to be specified, but it should make it much more approachable in terms of first-user experience with compile times. * Fix AppVeyor testing web-sys * FIx a typo * Udpate feature listings from rebase conflicts * Add some crate docs and such |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
build.bat | ||
build.sh | ||
Cargo.toml | ||
index.html | ||
index.js | ||
package.json | ||
README.md | ||
webpack.config.js |
Web Audio example
This directory is an example of how to use the Web Audio APIs from Rust. It creates a very simple FM (frequency modulation) synth, and let's you control the primary frequency, the modulation amount, and the modulation frequency.
To run, first install some utilities via npm:
npm install
Then build the project with either build.bat
or build.sh
.
Finally, run a development web server with npm run serve
and then open
http://localhost:8080/ in a browser!