From 22db43928e31af579b29b58a8bef8a2b78b9e851 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Tue, 6 Jan 2026 18:03:12 +0100 Subject: [PATCH] Update Dioxus template to 0.7 (#944) Co-authored-by: Amr Bashir --- .changes/dioxus-update-v0.7.md | 7 +++++++ templates/template-dioxus/.manifest | 2 +- templates/template-dioxus/Cargo.toml.lte | 6 +++--- templates/template-dioxus/src/app.rs.lte | 6 ++++-- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 .changes/dioxus-update-v0.7.md diff --git a/.changes/dioxus-update-v0.7.md b/.changes/dioxus-update-v0.7.md new file mode 100644 index 00000000..2c80782d --- /dev/null +++ b/.changes/dioxus-update-v0.7.md @@ -0,0 +1,7 @@ +--- +"create-tauri-app": "minor" +"create-tauri-app-js": "minor" +--- + +- Update `dioxus` to `0.7` with minor changes to the template. +- Disable interactive mode for `dx serve`. Fixes broken terminal when developing. diff --git a/templates/template-dioxus/.manifest b/templates/template-dioxus/.manifest index 5fa3d08c..e7e4af9e 100644 --- a/templates/template-dioxus/.manifest +++ b/templates/template-dioxus/.manifest @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: MIT -beforeDevCommand = dx serve --port 1420 +beforeDevCommand = dx serve --port 1420 --interactive false beforeBuildCommand = dx bundle --release devUrl = http://localhost:1420 frontendDist = ../dist/public diff --git a/templates/template-dioxus/Cargo.toml.lte b/templates/template-dioxus/Cargo.toml.lte index 4ee88ce6..e25a7f3d 100644 --- a/templates/template-dioxus/Cargo.toml.lte +++ b/templates/template-dioxus/Cargo.toml.lte @@ -1,12 +1,12 @@ [package] name = "{% package_name %}-ui" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus = { version = "0.6", features = ["web"] } -dioxus-logger = "0.6" +dioxus = { version = "0.7", features = ["web"] } +dioxus-logger = "0.7" wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = "0.3" diff --git a/templates/template-dioxus/src/app.rs.lte b/templates/template-dioxus/src/app.rs.lte index 9381aa41..c4b0ac89 100644 --- a/templates/template-dioxus/src/app.rs.lte +++ b/templates/template-dioxus/src/app.rs.lte @@ -23,7 +23,9 @@ pub fn App() -> Element { let mut name = use_signal(|| String::new()); let mut greet_msg = use_signal(|| String::new()); - let greet = move |_: FormEvent| async move { + let greet = move |event: FormEvent| async move { + event.prevent_default(); + if name.read().is_empty() { return; } @@ -78,4 +80,4 @@ pub fn App() -> Element { p { "{greet_msg}" } } } -} \ No newline at end of file +}