Stream: jco

Topic: jco transpile in the browser


view this post on Zulip James Mart (Dec 18 2023 at 16:51):

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?

view this post on Zulip DougAnderson444 | PeerPiper.io (Jan 10 2024 at 14:11):

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.

A WIT loader that use a custom Rollup plugin to bundles your wasm component into an ES module - GitHub - DougAnderson444/rollup-plugin-wit-component: A WIT loader that use a custom Rollup plugin to...

view this post on Zulip James Mart (Jan 10 2024 at 16:17):

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!

view this post on Zulip Guy Bedford (Jan 10 2024 at 18:03):

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