embed-wasm

https://crates.io/crates/embed-wasm

MIT License

Downloads
5.2K
Stars
11
Committers
2

Library designed to allow for embedding static content generated by building rust wasm code in native rust workspaces. This allows for projects with some properties that I think are neat:

  • wasm and native code in the same workspace, sharing common code including types, serde instances, etc
  • embedding wasm build output in native binaries, allowing for easily-distributable apps serving dynamic frontends
  • for example, a process info visualizer that renders process info using SVG and uses onclick handlers to provide for rich interactivity.

If you want to clone something so you can get started prototyping, here's an example project with a rust webserver (warp) serving a rust frontend (yew).

NOTE: this crate currently requires rust nightly due to a bug fix for a stable regression - no experimental features are used.

TODO:

  • support wasm build methods other than cargo-web (doesn't seem to be under active development)
  • FIXED: use phf instead of lazy_static after https://github.com/rust-lang/rust/issues/70584 is resolved
  • mark as non-nightly after the fix to that issue hits stable
Package Rankings
Top 29.56% on Crates.io
Badges
Extracted from project README
embed-wasm on crates.io Documentation (latest release) Documentation (master) License CircleCI status