Cool, that fixed it!
Now I'm stuck on another problem... trying to return the stream to JS so that it can be passed back for further sending.
Here's a clean repo with everything setup: https://github.com/dakom/hello-rust-sodium-wasm
Just run npm run dev
for dev mode, or npm run bundle
for production builds (after npm install)
In dev mode it'll automatically rebuild and reload the page on save
I'm not quite sure about the cargo ecosystem - I think you also need to install wasm-bindgen-cli globally via cargo +nightly install wasm-bindgen-cli
As of right now - the initial stream send from start_frp()
does do everything right - so now I'm stuck on trying to return the stream and then re-use it. I tried a technique of Box::into_raw
with a different object and it does work. It was suggested on the rust forum
Btw - what do you use for a Rust IDE? I've tried VSCode and NeoVim... VSCode seems to be a nicer experience but it's sooo laggy (I think due to RLS plugin). NeoVim is okay-ish with the LanguageClient plugin but I'm not loving it at a glance