Rename hot_reload to hot-reload

This commit is contained in:
YuKun Liu 2022-06-26 14:23:19 +08:00
parent 1c31fd0e22
commit 0af69f83f2
9 changed files with 13 additions and 13 deletions

View file

@ -49,7 +49,7 @@ desktop = ["dioxus-desktop"]
router = ["dioxus-router"]
tui = ["dioxus-tui"]
liveview = ["dioxus-liveview"]
hot-reload = ["dioxus-core-macro/hot_reload", "dioxus-rsx-interpreter", "dioxus-desktop?/hot_reload", "dioxus-web?/hot_reload"]
hot-reload = ["dioxus-core-macro/hot-reload", "dioxus-rsx-interpreter", "dioxus-desktop?/hot-reload", "dioxus-web?/hot-reload"]
native-core = ["dioxus-native-core", "dioxus-native-core-macro"]

View file

@ -5,9 +5,9 @@
# Setup
Install [dioxus-cli](https://github.com/DioxusLabs/cli).
Enable the hot_reload feature on dioxus:
Enable the hot-reload feature on dioxus:
```toml
dioxus = { version = "*", features = ["web", "hot_reload"] }
dioxus = { version = "*", features = ["web", "hot-reload"] }
```
# Usage

View file

@ -28,4 +28,4 @@ trybuild = "1.0"
[features]
default = []
hot_reload = ["dioxus-rsx-interpreter"]
hot-reload = ["dioxus-rsx-interpreter"]

View file

@ -34,12 +34,12 @@ pub fn derive_typed_builder(input: proc_macro::TokenStream) -> proc_macro::Token
/// ```
#[proc_macro]
pub fn rsx(s: TokenStream) -> TokenStream {
#[cfg(feature = "hot_reload")]
#[cfg(feature = "hot-reload")]
let rsx_text = s.to_string();
match syn::parse::<rsx::CallBody>(s) {
Err(err) => err.to_compile_error().into(),
Ok(body) => {
#[cfg(feature = "hot_reload")]
#[cfg(feature = "hot-reload")]
{
use dioxus_rsx_interpreter::captuered_context::CapturedContextBuilder;
@ -66,7 +66,7 @@ pub fn rsx(s: TokenStream) -> TokenStream {
Err(err) => err.into_compile_error().into(),
}
}
#[cfg(not(feature = "hot_reload"))]
#[cfg(not(feature = "hot-reload"))]
body.to_token_stream().into()
}
}

View file

@ -44,7 +44,7 @@ tokio_runtime = ["tokio"]
fullscreen = ["wry/fullscreen"]
transparent = ["wry/transparent"]
tray = ["wry/tray"]
hot_reload = ["dioxus-rsx-interpreter", "interprocess"]
hot-reload = ["dioxus-rsx-interpreter", "interprocess"]
[dev-dependencies]
dioxus-core-macro = { path = "../core-macro" }

View file

@ -51,7 +51,7 @@ impl DesktopController {
dom.base_scope().provide_context(window_context);
// allow other proccesses to send the new rsx text to the @dioxusin ipc channel and recieve erros on the @dioxusout channel
#[cfg(feature = "hot_reload")]
#[cfg(feature = "hot-reload")]
{
use dioxus_rsx_interpreter::{
error::Error, ErrorHandler, SetManyRsxMessage, RSX_CONTEXT,

View file

@ -77,7 +77,7 @@ features = [
[features]
default = ["panic_hook"]
panic_hook = ["console_error_panic_hook"]
hot_reload = ["dioxus-rsx-interpreter", "web-sys/WebSocket", "web-sys/Location", "web-sys/MessageEvent", "web-sys/console", "serde_json"]
hot-reload = ["dioxus-rsx-interpreter", "web-sys/WebSocket", "web-sys/Location", "web-sys/MessageEvent", "web-sys/console", "serde_json"]
[dev-dependencies]
dioxus-core-macro = { path = "../core-macro" }

View file

@ -217,7 +217,7 @@ pub async fn run_with_props<T: 'static + Send>(root: Component<T>, root_props: T
let mut work_loop = ric_raf::RafLoop::new();
#[cfg(feature = "hot_reload")]
#[cfg(feature = "hot-reload")]
{
use dioxus_rsx_interpreter::error::Error;
use dioxus_rsx_interpreter::{ErrorHandler, SetManyRsxMessage, RSX_CONTEXT};

View file

@ -46,7 +46,7 @@ pub mod events {
pub use dioxus_rsx as rsx;
#[cfg(feature = "hot_reload")]
#[cfg(feature = "hot-reload")]
pub use dioxus_rsx_interpreter as rsx_interpreter;
pub mod prelude {
@ -62,7 +62,7 @@ pub mod prelude {
#[cfg(feature = "fermi")]
pub use fermi::{use_atom_ref, use_init_atom_root, use_read, use_set, Atom, AtomRef};
#[cfg(feature = "hot_reload")]
#[cfg(feature = "hot-reload")]
pub use dioxus_rsx_interpreter::{
captuered_context::{CapturedContext, FormattedArg, IfmtArgs},
get_line_num, resolve_scope, CodeLocation, RsxContext,