Tauri, wasm and wasi #9521
-
Hi, I just started with rust and tauri. I also came across webassembly (wasm) and webassembly system interace (wasi) which is also new to me. From the tauri architecture I understood that WRY (os webview abstraction) and TAO is used to handle window creation and rendering (webview). I'm curious, is tauri using wasm/wasi to enable the communication between javascript and rust or is this not required? Can you point me to more details how the communication between javascript and rust is done? Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Almost. Tao is only the windowing library. Tao alone will only get you an empty white window. Wry is indeed the abstraction layer for the os webview, and the webviews themselves are what render your website into the Tao window.
There is no WASM involved anywhere in Tauri unless you chose a frontend framework that uses WASM (for example leptos or yew) but even then the IPC will still run over the javascript implementations. WASI is not involved and not supported. (unless you bundle a runtime yourself alongside your tauri app and run another app on that runtime, but let's not go there lol)
We don't have this throughly document (though would love to at some point) but in v1 we simply use the webview's postMessage apis to send json string messages (don't ask me how they work internally 😅 ) and in v2 we additionally use http request (caught with native webview apis and without a webserver before they actually reach the network) to be able to handle larger ipc payloads. |
Beta Was this translation helpful? Give feedback.
Almost. Tao is only the windowing library. Tao alone will only get you an empty white window. Wry is indeed the abstraction layer for the os webview, and the webviews themselves are what render your website into the Tao window.
There is no WASM involved anywhere in Tauri unless you chose a frontend framework that uses WASM (for example leptos or yew) but even then the IPC will still run over the javascript implementations.
WASI is not involv…