remove the hot-reload-macro crate
This commit is contained in:
1 parent
042b67b61b
commit
9e45cbe4a7
5 files changed
+12
-24
No files matched your search
@@ -21,7 +21,6 @@ members = [
|
|||||||
"packages/rsx-rosetta",
|
"packages/rsx-rosetta",
|
||||||
"packages/signals",
|
"packages/signals",
|
||||||
"packages/hot-reload",
|
"packages/hot-reload",
|
||||||
"packages/hot-reload-macro",
|
|
||||||
"docs/guide",
|
"docs/guide",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "dioxus-hot-reload-macro"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
syn = { version = "1.0.107", features = ["full"] }
|
|
||||||
proc-macro2 = { version = "1.0" }
|
|
||||||
|
|
||||||
[lib]
|
|
||||||
proc-macro = true
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
use proc_macro::TokenStream;
|
|
||||||
use syn::__private::quote::quote;
|
|
||||||
|
|
||||||
#[proc_macro]
|
|
||||||
pub fn hot_reload(_: TokenStream) -> TokenStream {
|
|
||||||
quote!(dioxus_hot_reload::init(core::env!("CARGO_MANIFEST_DIR"))).into()
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,6 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dioxus-hot-reload-macro = { path = "../hot-reload-macro" }
|
|
||||||
dioxus-rsx = { path = "../rsx" }
|
dioxus-rsx = { path = "../rsx" }
|
||||||
dioxus-core = { path = "../core", features = ["serialize"] }
|
dioxus-core = { path = "../core", features = ["serialize"] }
|
||||||
dioxus-html = { path = "../html", features = ["hot-reload-context"] }
|
dioxus-html = { path = "../html", features = ["hot-reload-context"] }
|
||||||
|
|||||||
@@ -6,14 +6,13 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use dioxus_core::Template;
|
use dioxus_core::Template;
|
||||||
pub use dioxus_hot_reload_macro::hot_reload;
|
|
||||||
use dioxus_html::HtmlCtx;
|
use dioxus_html::HtmlCtx;
|
||||||
use dioxus_rsx::hot_reload::{FileMap, UpdateResult};
|
use dioxus_rsx::hot_reload::{FileMap, UpdateResult};
|
||||||
use interprocess::local_socket::{LocalSocketListener, LocalSocketStream};
|
use interprocess::local_socket::{LocalSocketListener, LocalSocketStream};
|
||||||
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
|
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
|
||||||
|
|
||||||
/// Initialize the hot reloading listener on the given path
|
/// 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) {
|
if let Ok(crate_dir) = PathBuf::from_str(path) {
|
||||||
let temp_file = std::env::temp_dir().join("@dioxusin");
|
let temp_file = std::env::temp_dir().join("@dioxusin");
|
||||||
let channels = Arc::new(Mutex::new(Vec::new()));
|
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,)*])
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in new issue
Block a user