@Guy Bedford I've been working on a series of examples of using a component for the Coalition for Content Provenance and Authenticity (C2PA). I have both web and nodeJS examples working.
For the transpiled JS for browsers, it would be nice if we had a utility to convert a https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream to an InputStream (or 0.3 Stream). Is that covered in the issue Jco transpile: implementation of wasi-io for Web?
My examples: https://github.com/cdmurph32/c2pa-component/tree/v24
Thanks for sharing, this looks great! For Preview2 you would need to write an adapter to convert from the preview2 polling IO into a readable stream. We do something similar for the Node.js WASI implementation already in the preview2-shims project, but don't have anything existing for the browser currently.
@Calvin Prewitt is working on a PR (https://github.com/bytecodealliance/jco/pull/518) to support async bindings for preview2-shims, which could then in theory support a preview2 web streams adapter.
Looking forward, Preview3 streams will embed async and support web streams from the start.
If you're interested in more of the details happy to discuss further as well.
That's great about Preview 3. That should probably be good enough. Will it likely land in the first half of the year?
Good to hear. I can't give really give an estimate right now unfortunately. But in terms of unblocking the workflow today it might well be worth trying to use PR 518 and writing a web streams adapter against it similarly to our Node.js stream wrapper approach, as that PR is ready for testing. Happy to talk this through more if you're interested.
OK. I'll give that a shot.
Last updated: Jan 24 2025 at 00:11 UTC