Test project for Rust and deno interop via WebAssembly.
Run it by building the WebAssembly module and use deno to import / test it:
wasm-pack build && deno main.ts
Returning a JsValue
or a successful result Ok(JsValue)
yields a pointer instead of the JsValue
?
See returns_js_value_directly and returns_ok_js_value for the Rust implementations and the deno usage.
Strangely, using Err(JsValue)
works as you can see in returns_err_js_value and its usage in deno
wasm-pack build --target web
When initializing through the .js
file, the browser stuff seems to work. Deno is still not really happy with it for now.
. start-deno.sh
This changes the default wasm-pack build
result to provide an init
function. The init
function expects a WebAssembly.Module
which you get by importing the _bg.wasm
file from wasm-pack build
.