xh
xh copied to clipboard
Investigate compiling xh to WebAssembly
It seems WASI could be the perfect solution for us.
- https://medium.com/wasmer/webassembly-sh-408b010c14db
- https://blog.jeremylikness.com/blog/explore-wasi-from-your-browser/
- https://wapm.io/interface/wasi
- https://rreverser.com/webassembly-shell-with-a-real-filesystem-access-in-a-browser/
That being said:
- I have been able to compile reqwest into WASI yet.
- reqwest's blocking API is not available in WASM 😬.
Edit: WASI doesn't seem to support async/await currently so WASM would be the way to go.
Proof of concept: https://xh-playground.netlify.app/
crates + npm packages used
- wasmer-js.
- reqwest
- syntect
- jsonxf
Edit: the code is hosted at https://github.com/ducaale/xh-playground