by jsheard · 2y ago · 0 comments
EDIT: trying to answer this myself got me down this rathole: https://users.rust-lang.org/t/fixing-rusts-webassembly-targe... and https://github.com/rust-lang/rust/issues/83788
I did find older alternative solutions that uses wasm32-unknown-emscripten, like https://github.com/tanis2000/rust-sdl2-wasm but it's not obvious to me that this is a better solution.
TL;DR: it's currently a mess
That gives you a simple software framebuffer, and it builds as a native app or for the web. You'd set up a window (or web canvas) using winit, then pass that to softbuffer so it can render to it.
I think Trunk is the most streamlined way of building for the web at the moment, superseding wasm-pack.