desub icon indicating copy to clipboard operation
desub copied to clipboard

desub compile to wasm

Open gilescope opened this issue 3 years ago • 4 comments

Would be cool to be able to use this in web contexts. I think I can get away with not needing subxt on the web but I definitely need desub capabilities.

gilescope avatar May 26 '22 04:05 gilescope

I've been working on porting over the dynamic-encode-and-decode-into-Value bits into a new crate, https://github.com/paritytech/scale-value, which has plans to be used in subxt for such decoding (and hopefully cargo-contract). I'm not sure what your exact needs are but perhaps you'd find that useful?

As quite a small crate, it should already support wasm, but there is an issue I raised to add CI to ensure that that is the case going forwards.

jsdw avatar May 26 '22 11:05 jsdw

Actually it looks like desub-current compiles to wasm, it's just desub-legacy that does not (and the top level desub crate because it pulls both in).

gilescope avatar Jun 13 '22 18:06 gilescope

Also having a look at https://github.com/virto-network/sube for fetching data using the browser.

gilescope avatar Jun 13 '22 18:06 gilescope

Actually it looks like desub-current compiles to wasm, it's just desub-legacy that does not (and the top level desub crate because it pulls both in).

That isn't surprising to me offhand! I'd def look towards scale-value where possible, but if you want to decode older blocks in the browser then you may indeed have to look elsewhere at the mo!

jsdw avatar Jun 14 '22 14:06 jsdw