upgrade to dioxus 0.7.1
Build dioxus container / BuildContainer (push) Successful in 3m10s

This commit is contained in:
2025-11-27 17:31:55 -07:00
parent 128791bccd
commit 40bb8e18ef
7 changed files with 743 additions and 1044 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install dioxus-cli - name: Install dioxus-cli
run: cargo binstall dioxus-cli --version 0.6.3 run: cargo binstall dioxus-cli --version 0.7.1
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
Generated
+732 -1014
View File
File diff suppressed because it is too large Load Diff
+6 -4
View File
@@ -6,7 +6,7 @@ edition = "2021"
[dependencies] [dependencies]
# Web Dependencies # Web Dependencies
# ================ # ================
dioxus-web = { version = "0.6.3", optional = true } dioxus-web = { version = "0.7.1", optional = true }
wasm-bindgen = { version = "^0.2.92", optional = true } wasm-bindgen = { version = "^0.2.92", optional = true }
wasm-bindgen-futures = { version = "^0.4.42", optional = true } wasm-bindgen-futures = { version = "^0.4.42", optional = true }
wasm-streams = { version = "^0.4.0", optional = true } wasm-streams = { version = "^0.4.0", optional = true }
@@ -59,7 +59,6 @@ tracing-web = { version = "^0.1.3", optional = true }
# Desktop Dependecies # Desktop Dependecies
# =================== # ===================
dioxus-desktop = { version = "0.6.3", optional = true }
tokio = { version = "^1.41.1", features = ["net", "rt"], optional = true } tokio = { version = "^1.41.1", features = ["net", "rt"], optional = true }
tokio-rustls = { version = "^0.26.0", optional = true } tokio-rustls = { version = "^0.26.0", optional = true }
opus = { version = "0.3.0", optional = true } opus = { version = "0.3.0", optional = true }
@@ -68,7 +67,7 @@ dasp_ring_buffer = { version = "0.11.0", optional = true }
# Base Dependencies # Base Dependencies
# ================ # ================
dioxus = { version = "0.6.3" } dioxus = { version = "0.7.1" }
once_cell = "1.19.0" once_cell = "1.19.0"
asynchronous-codec = { workspace = true } asynchronous-codec = { workspace = true }
futures = "^0.3.30" futures = "^0.3.30"
@@ -89,11 +88,12 @@ tracing = "^0.1.40"
color-eyre = "^0.6.3" color-eyre = "^0.6.3"
crossbeam-queue = "^0.3.11" crossbeam-queue = "^0.3.11"
lol_html = "^2.2.0" lol_html = "^2.2.0"
rfd = "^0.15.2" rfd = { git = "https://github.com/samsartor/rfd.git", version = "^0.16.0", default-features = false }
base64 = "^0.22" base64 = "^0.22"
mime_guess = "^2.0.5" mime_guess = "^2.0.5"
async_cell = "^0.2.3" async_cell = "^0.2.3"
reqwest = { version = "^0.12.22", features = ["json"] } reqwest = { version = "^0.12.22", features = ["json"] }
dioxus-asset-resolver = "0.7.1"
# Denoising # Denoising
# ========= # =========
@@ -128,4 +128,6 @@ desktop = [
"opus", "opus",
"cpal", "cpal",
"dasp_ring_buffer", "dasp_ring_buffer",
"rfd/xdg-portal",
"rfd/tokio",
] ]
+2 -1
View File
@@ -2,6 +2,7 @@ use crossbeam::atomic::AtomicCell;
use df::tract::{mut_slice_as_arrayviewmut, slice_as_arrayview}; use df::tract::{mut_slice_as_arrayviewmut, slice_as_arrayview};
use df::tract::{DfParams, DfTract, RuntimeParams}; use df::tract::{DfParams, DfTract, RuntimeParams};
use dioxus::prelude::{asset, manganis, Asset}; use dioxus::prelude::{asset, manganis, Asset};
use dioxus_asset_resolver::read_asset_bytes;
use std::cell::RefCell; use std::cell::RefCell;
use std::sync::Arc; use std::sync::Arc;
use tracing::{error, info}; use tracing::{error, info};
@@ -32,7 +33,7 @@ fn with_denoising_model<O>(
let cell_task = cell.clone(); let cell_task = cell.clone();
*state = DenoisingModelState::Downloading(cell); *state = DenoisingModelState::Downloading(cell);
spawn.spawn(async move { spawn.spawn(async move {
let model_bytes = match imp::read_asset_bytes(&DF_MODEL).await { let model_bytes = match read_asset_bytes(&DF_MODEL).await {
Ok(b) => b, Ok(b) => b,
Err(e) => { Err(e) => {
error!("could not read denoising model from \"{DF_MODEL}\": {e:?}"); error!("could not read denoising model from \"{DF_MODEL}\": {e:?}");
-10
View File
@@ -311,13 +311,3 @@ pub fn init_logging() {
.with_env_filter(env_filter) .with_env_filter(env_filter)
.init(); .init();
} }
// TODO: once we update to dioxus 0.7, swap this out with the dioxus-asset-resolver crate
pub async fn read_asset_bytes(asset: &dioxus::prelude::Asset) -> color_eyre::Result<Vec<u8>> {
let cur_exe = std::env::current_exe().unwrap();
let path = cur_exe
.parent()
.unwrap()
.join(asset.to_string().trim_matches('/'));
Ok(std::fs::read(&path).with_context(|| format!("native path \"{}\"", path.display()))?)
}
-6
View File
@@ -448,12 +448,6 @@ pub fn init_logging() {
info!("logging initiated"); info!("logging initiated");
} }
// TODO: once we update to dioxus 0.7, swap this out with the dioxus-asset-resolver crate
pub async fn read_asset_bytes(asset: &dioxus::prelude::Asset) -> color_eyre::Result<Vec<u8>> {
let url = absolute_url(asset.to_string().trim_matches('/'))?;
Ok(reqwest::get(url).await?.bytes().await?.to_vec())
}
pub struct SpawnHandle; pub struct SpawnHandle;
impl SpawnHandle { impl SpawnHandle {
+2 -8
View File
@@ -1,12 +1,6 @@
use mumble_web2_gui::{app, imp::init_logging}; use mumble_web2_gui::{app, imp};
pub fn main() { pub fn main() {
#[cfg(feature = "desktop")] imp::init_logging();
let _guard = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap()
.enter();
init_logging();
dioxus::launch(app::app); dioxus::launch(app::app);
} }