Tested on PinePhone Manjaro Phosh. Instructions modified from https://github.com/stevepryde/tauri-yew-demo
SSH to PinePhone and run these steps...
Install wasm-bindgen-cli
...
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli
Install tauri-cli
...
cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch next
(See tauri-apps/tauri#3050)
cargo install trunk
fails (out of RAM?), so we build trunk
ourselves...
cd ~
git clone --recursive https://github.com/thedodd/trunk
cd trunk
cargo build
sudo cp target/debug/trunk /usr/local/bin
cd ..
rm -rf trunk
Download the demo source files and build them...
cd ~
git clone --recursive https://github.com/stevepryde/tauri-yew-demo
cd tauri-yew-demo
cargo tauri build
(Warning: Building on PinePhone the first time takes 72 mins)
Run the executable at...
src-tauri/target/release/tauri-yew-demo
The Debian Installer is at...
src-tauri/target/release/bundle/deb
The "Hello World" message is defined here...
https://github.com/stevepryde/tauri-yew-demo/blob/main/frontend/src/main.rs#L19
pub fn app() -> Html {
let welcome = use_state_eq(|| "".to_string());
let name = use_state_eq(|| "Your_Name_Without_Spaces".to_string());
The name should NOT have any spaces because of this check...
https://github.com/stevepryde/tauri-yew-demo/blob/main/src-tauri/src/main.rs#L17-L18
fn hello(name: &str) -> Result<String, String> {
if name.contains(' ') {
Err("Name should not contain spaces".to_string())
Watch the process and result on Twitter...
https://twitter.com/MisterTechBlog/status/1483471147320500227
https://twitter.com/MisterTechBlog/status/1483300055171756032
(Yep building the Tauri + WebAssembly App on PinePhone is really slow, wish we could cross-compile on another computer and copy to PinePhone 🤔)