Closed evbo closed 2 years ago
actually it could work just like it has been shown here I think! https://dev.to/stevepryde/create-a-desktop-app-in-rust-using-tauri-and-yew-2bhe
please check this template repo: https://github.com/jetli/rust-yew-axum-tauri-desktop it wraps Yew/Tauri/Axum all together for desktop dev.
Thanks, if I understand correctly you're using a webserver in the Tauri backend rather than using the built-in RPC. I'm not sure of the security or performance considerations for doing so, but that's an interesting alternate path forward!
if you want to call tauri command, here's demo in that repo: https://github.com/jetli/rust-yew-axum-tauri-desktop/blob/9fd99e0ae3aace47c1e634c4b0c07275182b628e/crates/frontend/src/main.rs#L146, gets the port of backend server on startup. and yes, localhost server sure is a security concern one should consider, but it's an easy way to use restful apis and json for Yew.
Thanks and this pretty much sums up all the paths forward so I'll close
It would be interesting to see the Yew application handle calling the Tauri js API and receiving results from the backend via Tauri Commands.
For many desktop applications this is the only reason Tauri isn't currently suitable for WASM yet and since there are so many needs for backend code (e.g. connecting to sqlite database, filesystem processing, secure communication) this becomes the determining factor against using wasm in Tauri.
...or can this be proven wrong?!