Update Dioxus template to 0.7 (#944)

Co-authored-by: Amr Bashir <github@amrbashir.me>
This commit is contained in:
Andrej Mihajlov
2026-01-06 18:03:12 +01:00
committed by GitHub
parent 0009ad8251
commit 22db43928e
4 changed files with 15 additions and 6 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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"

View File

@@ -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}" }
}
}
}
}