inanna-malick / embed-wasm

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

embed-wasm on crates.io Documentation (latest release) Documentation (master)LicenseCircleCI status

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 rust-lang/rust#70584 is resolved
  • mark as non-nightly after the fix to that issue hits stable

About

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

License:MIT License


Languages

Language:Rust 100.0%