What about packing up web assembly into a single file container like runtime designed to run server side web applications? This .war (Webassembly ARchive) file could include the application and all dependencies in a single installable that is JITd on load. Might be useful for the next generation of "serverless" cloud runtimes.
I’d be all for this, honestly, except that the existing containers (yes, even Jetty) are too heavyweight for this use case.
What you really want is a stripped down server runtime that loads and starts your application’s archive, fires it up on a (possibly random) local port and opens a stripped down Chromium instance that loads the app from that port.
clang is pretty big. There's about 55 MB of binaries on that page. When served from localhost, it takes about 10 seconds to load and compile a source file on my machine.
This gets us to two caching-related problems: What if you're offline and how do you decide what you want to be cached?
But browser vendors will solve this.
Isn't this solved with progressive web apps? On the other hand I'm not aware of any UI that allows you to explicitly choose if a PWA should be cached or not.