2018-09-20 16:20:42 -07:00
|
|
|
# Examples of using `wasm-bindgen`, `js-sys`, and `web-sys`
|
|
|
|
|
|
|
|
This subsection contains examples of using the `wasm-bindgen`, `js-sys`, and
|
|
|
|
`web-sys` crates. Each example should have more information about what it's
|
|
|
|
doing.
|
|
|
|
|
2019-02-21 11:49:08 -08:00
|
|
|
These examples all assume familiarity with `wasm-bindgen`, `wasm-pack`, and
|
|
|
|
building a Rust and WebAssembly project. If you're unfamiliar with these check
|
|
|
|
out the [Game of Life tutorial][gol] to help you get started.
|
|
|
|
|
|
|
|
The source code for all examples can also be [found online][code] to download
|
|
|
|
and run locally. Most examples are configured with Webpack/`wasm-pack` and can
|
2019-01-08 15:14:15 -08:00
|
|
|
be built with `npm run serve`. Other examples which don't use Webpack are
|
|
|
|
accompanied with a `build.sh` showing how to build it.
|
2018-09-20 16:20:42 -07:00
|
|
|
|
|
|
|
Note that most examples currently use Webpack to assemble the final output
|
2019-02-21 11:49:08 -08:00
|
|
|
artifact, but this is not required! You can review the [deployment
|
|
|
|
documentation][deploy] for other options of how to deploy Rust and WebAssembly.
|
2018-09-20 16:20:42 -07:00
|
|
|
|
|
|
|
[code]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples
|
2019-03-08 05:58:22 -08:00
|
|
|
[gol]: https://rustwasm.github.io/docs/book/
|
2019-02-21 11:49:08 -08:00
|
|
|
[deploy]: ../reference/deployment.html
|