Clean up reloader

This commit is contained in:
Jonathan Kelley 2024-03-13 14:36:56 -07:00
parent 1bdc9d132e
commit 8d8e7edb82
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
3 changed files with 6 additions and 19 deletions

View file

@ -6,7 +6,7 @@ use crate::{
}, },
BuildResult, Result, BuildResult, Result,
}; };
use dioxus_cli_config::{CrateConfig, ExecutableType}; use dioxus_cli_config::CrateConfig;
use dioxus_hot_reload::HotReloadMsg; use dioxus_hot_reload::HotReloadMsg;
use dioxus_html::HtmlCtx; use dioxus_html::HtmlCtx;
use dioxus_rsx::hot_reload::*; use dioxus_rsx::hot_reload::*;

View file

@ -207,8 +207,6 @@ fn hotreload_files(
return; return;
} }
println!("Hot reloading: {:?}", messages);
for msg in messages { for msg in messages {
let _ = hot_reload.messages.send(msg); let _ = hot_reload.messages.send(msg);
} }
@ -237,7 +235,7 @@ fn hotreload_file(
// If the extension is a backup file, or a hidden file, ignore it completely (no rebuilds) // If the extension is a backup file, or a hidden file, ignore it completely (no rebuilds)
if is_backup_file(path) { if is_backup_file(path) {
println!("Ignoring backup file: {:?}", path); log::trace!("Ignoring backup file: {:?}", path);
return None; return None;
} }

View file

@ -1,16 +1,5 @@
use std::{fs, io, process::Command, sync::Arc}; use super::{hot_reload::*, WsReloadState};
use crate::{server::HotReloadState, Result};
use crate::{
builder,
serve::Serve,
server::{
output::{print_console_info, PrettierOptions, WebServerInfo},
setup_file_watcher, HotReloadState,
},
BuildResult, Result,
};
use tower::ServiceBuilder;
use axum::{ use axum::{
body::Body, body::Body,
extract::{ extract::{
@ -28,8 +17,8 @@ use axum::{
}; };
use axum_server::tls_rustls::RustlsConfig; use axum_server::tls_rustls::RustlsConfig;
use dioxus_cli_config::{CrateConfig, WebHttpsConfig}; use dioxus_cli_config::{CrateConfig, WebHttpsConfig};
use std::{fs, io, process::Command, sync::Arc};
use super::{hot_reload::*, WsReloadState}; use tower::ServiceBuilder;
use tower_http::{ use tower_http::{
cors::{Any, CorsLayer}, cors::{Any, CorsLayer},
services::fs::{ServeDir, ServeFileSystemResponseBody}, services::fs::{ServeDir, ServeFileSystemResponseBody},