a demo(practice) project. has yew -> js -> tauri
async call. as well as tauri -> js -> yew
message sending。
rustup target add wasm32-unknown-unknown
cargo install trunk
cargo install wasm-bindgen-cli
cargo install tauri-cli --version ^1.0.0
After installing the above, you should be able to run it with
cargo tauri dev
You can do a release build with
cargo tauri build --verbose
and if you want debug in released app. use --debug
:
cargo tauri build --verbose --debug
an build app in folder: src-tauri/target/release/bundle/
Tauri: https://tauri.studio/en/docs/get-started/intro
Yew: https://yew.rs/docs/getting-started/introduction
wasm-bindgen-usage: https://rustwasm.github.io/wasm-bindgen/reference/passing-rust-closures-to-js.html
trunk: https://trunkrs.dev/
how wasm gc in Ocaml: https://medium.com/@sanderspies/the-road-to-webassembly-gc-for-ocaml-bd44dc7f9a9d how wasm gc need in Chrome: https://docs.google.com/document/d/14ZId5XdETWgQHJe4Jozi-aKwCwqvDLgLuokP0gnJq6Q/edit#
i use dangerousDisableAssetCspModification
in tauri.conf.json
. see reason below[tauri csp bug when use yew(wasm)].
- learn csp: https://content-security-policy.com/
- tauri csp bug when use yew(wasm): tauri-apps/tauri#3583