-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Motivation
Wasm-bindgen provide all requirements to generate Wasm application. Including the startup with the #[wasm_bindgen(start)] attribute.
It miss a very little portion of code to:
- start a server
- (re-)build the wasm application
Today, it requires an external tool, hot reloading is not provided etc.
It can be with WebPack:
Paint example
Or using the wasm-bindgen-cli
GFX example
One of the paint/complex work is to manage cross target libraries.
For example the Quad example from GFX is a main as it can run on all platforms.
But the same code can also run for Web with WebAssembly.
I have tried to manage that in that issue: gfx-rs/gfx#3475
It works using 2 Cargo manifests, requires to duplicate dependencies and do some tricks.
Proposed Solution
Improve the CLI crate to add a mode to serve the application.
maybe to provide a command like:
wasm-bindgen --server
Or maybe add a server target.