I want to serve a wasm component to the browser and use jco transpile (or similar) from within my webapp to dynamically generate the core module + bindings. Is that possible today?
James Mart said:
I want to serve a wasm component to the browser and use jco transpile (or similar) from within my webapp to dynamically generate the core module + bindings. Is that possible today?
Yes it can be done, I've done it. I had to build a couple of tools (such as https://github.com/DougAnderson444/rollup-plugin-wit-component) in order to bundle the code together, but it can be done.
Also have a look at https://wasmbuilder.app/ which allows compose
right in the browser too.
Thanks @DougAnderson444 | PeerPiper.io , for some reason Zulip isn't letting me mark this thread as resolved? But in fact I found your rollup plugin a couple weeks ago and it has been extremely helpful :) Thanks!
For browser transpile, there is an example in the JCO repo at https://github.com/bytecodealliance/jco/blob/main/test/browser.html demonstrating a simple case of transpiling and importing all in the browser.
Last updated: Dec 23 2024 at 12:05 UTC