← Back to context

Comment by flohofwoe

4 days ago

I'm pretty sure you'll will still need a JS shim to talk to most web APIs. For instance the Mozilla DOM experiments seems to use a special JS variant with a 'use component' header (similar to the old 'use asm' for asm.js) as shim, but the JS shim is still there. The component model can marshal 'record types' between different WASM modules, but AFAIK not between a WASM module and a web API.

> For instance the Mozilla DOM experiments seems to use a special JS variant with a 'use component' header

As per the article, that's temporary until Component Model 1.0 is implemented natively in the browser. In the meantime, jco can be used:

> The groundwork for browser implementations is being laid today: jco’s transpile command already converts any component into equivalent core Wasm and JavaScript glue, making components runnable in any browser without native support.

That's no longer needed once native support is there.