pyrossh / rust-embed

Rust Macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
MIT License
1.67k stars 85 forks source link

A feature analogous to debug-embed, but for WASM? #226

Open JohnDowson opened 11 months ago

JohnDowson commented 11 months ago

My use case is that I want embed some prefabs in wasm build, but load them(as well as user-defined ones) from fs at runtime everywhere else.

pyrossh commented 11 months ago

What wasm runtime are you using? Does it support he WASI API. It should technically work though if it builds.

JohnDowson commented 11 months ago

I am running in the browser.

Should probably explain my use case better.
I am building a modular synthesizer, and I need some default modules and widget prefabs to serve as examples. For the most part, I can ask the user to select a file to load, but it's bad UX to ask the user to download example for use with a web app.

So I want to bundle those examples on wasm32, but keep loading everything at runtime on native, in case the user made or downloaded some extra modules.