Uses old Rust 2015
|0.1.2||Dec 21, 2017|
|0.1.1||Dec 18, 2017|
|0.1.0||Dec 17, 2017|
#19 in #inline
37 downloads per month
Used in embed_js
This project provides a low level interface designed for other crates to build higher level, more ergonomic APIs on top of.
Try out the examples (in the examples subdirectory) to get a feel of how the pieces fit together.
To build wasm applications, make sure you have both a recent Rust nightly and the wasm32-unknown-unknown target installed.Setting up the examples
In an example's directory, make sure you have rustup set up to build with nightly Rust.
Build the example using
cargo make, which ensures that the post-build script is run.
The resulting self-contained HTML file should be in
"target/wasm32-unknown-unknown/release/" and can be ran in a browser (one that supports WebAssembly).
Depending on the example you may need to check the console log in the browser (F12) to see its output.
There are two crates to use.
embed_js is for crates using the
embed_js_build should be used by those crates as a pre-processing stage in their build scripts.
also be used by application crates that build wasm binaries in their post-build scripts in order
See the documentation of both crates for more detailed usage information, or check out the examples in this repository.
[dependencies] embed_js = "^0.1.4"
[build-dependencies] embed_js_build = "^0.1.4"
js macro cannot be used inside other macros, with the exception of the
This is potentially fixable in the future.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.