fix the macro export and WIP hot reloading docs

This commit is contained in:
Evan Almloff committed 2023-01-12 08:47:33 -06:00
1 parent 19aaa0ee5b
commit 82048737f4
5 files changed
+51 -11

No files matched your search

+3 -1
View File
@@ -17,12 +17,14 @@ dioxus-html = { path = "../html", version = "^0.3.0", optional = true }
dioxus-core-macro = { path = "../core-macro", version = "^0.3.0", optional = true }
dioxus-hooks = { path = "../hooks", version = "^0.3.0", optional = true }
dioxus-rsx = { path = "../rsx", version = "0.0.2", optional = true }
dioxus-hot-reload = { path = "../hot-reload", version = "0.1.0", optional = true }
[features]
default = ["macro", "hooks", "html"]
default = ["macro", "hooks", "html", "hot-reload"]
macro = ["dioxus-core-macro", "dioxus-rsx"]
html = ["dioxus-html"]
hooks = ["dioxus-hooks"]
hot-reload = ["dioxus-hot-reload"]
[dev-dependencies]
+3
View File
@@ -31,4 +31,7 @@ pub mod prelude {
#[cfg(feature = "html")]
pub use dioxus_elements::{prelude::*, GlobalAttributes, SvgAttributes};
#[cfg(feature = "hot-reload")]
pub use dioxus_hot_reload::hot_reload_init;
}
+3 -1
View File
@@ -152,7 +152,7 @@ pub fn connect(mut f: impl FnMut(Template<'static>) + Send + 'static) {
/// Pass any number of paths to listen for changes on relative to the crate root as strings.
/// If no paths are passed, it will listen on the src and examples folders.
#[macro_export]
macro_rules! hot_reload {
macro_rules! hot_reload_init_inner {
() => {
dioxus_hot_reload::init(core::env!("CARGO_MANIFEST_DIR"), &["src", "examples"])
};
@@ -161,3 +161,5 @@ macro_rules! hot_reload {
dioxus_hot_reload::init(core::env!("CARGO_MANIFEST_DIR"), &[$($paths),*])
};
}
pub use hot_reload_init_inner as hot_reload_init;