Display "loading" screen while rust/wasm32 is downloading/unpacking


I have a Rust/wasm32/webgl codebase that compiles to ~3MB (on release). As a result, when I load the webpage, there's often a ~1.5 second delay while the wasm32 downloads, unpacks, starts to execute.


I would like some way of displaying a

<blink> loading </blink>

screen while this is happening. Then have the Rust kill the loading screen when it starts execution.

Has anyone done something similar to this before?

webassembly in a browser is always loaded from a HTML page with a javascript loader

so the straightforward way would be to put a <div> on that page that shows it is loading (and possibly fetch progress, updated by the javascript loader), then have the wasm code change the DOM to hide it, and show its own UI, once initialized

1 Like