snaps icon indicating copy to clipboard operation
snaps copied to clipboard

Enable shipping WebAssembly source code alongside main Snap bundle

Open rekmarks opened this issue 3 years ago • 0 comments

Snaps that use WebAssembly (WASM) currently have two options for loading their WASM source at runtime:

  1. Host it somewhere and fetch it at runtime (e.g. here)
  2. Turn the WASM source into a byte string, bundle that into the JavaScript source and convert it to a buffer at runtime

(1) requires network access - which makes it harder to trust the snap - while (2) is clunky and may make the JavaScript bundle impractically large. We need to provide a way for snaps to ship their .wasm files alongside the main JavaScript bundle and load them at runtime.

rekmarks avatar Sep 16 '22 12:09 rekmarks