remove the hot-reload-macro crate

This commit is contained in:
= committed 2023-01-11 18:51:09 -06:00
1 parent 042b67b61b
commit 9e45cbe4a7
5 files changed
+12 -24

No files matched your search

+12 -2
View File
@@ -6,14 +6,13 @@ use std::{
};
use dioxus_core::Template;
pub use dioxus_hot_reload_macro::hot_reload;
use dioxus_html::HtmlCtx;
use dioxus_rsx::hot_reload::{FileMap, UpdateResult};
use interprocess::local_socket::{LocalSocketListener, LocalSocketStream};
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
/// Initialize the hot reloading listener on the given path
pub fn init(path: &'static str) {
pub fn init(path: &'static str, listening_paths: &'static [&'static str]) {
if let Ok(crate_dir) = PathBuf::from_str(path) {
let temp_file = std::env::temp_dir().join("@dioxusin");
let channels = Arc::new(Mutex::new(Vec::new()));
@@ -109,3 +108,14 @@ pub fn connect(mut f: impl FnMut(Template<'static>) + Send + 'static) {
}
});
}
#[macro_export]
macro_rules! hot_reload {
() => {
dioxus_hot_reload::init(core::env!("CARGO_MANIFEST_DIR"), &[])
};
($($paths: literal,)*,?) => {
dioxus_hot_reload::init(core::env!("CARGO_MANIFEST_DIR"), &[$($path,)*])
};
}