Browse Source

Rename `hot_reload` to `hot-reload`

YuKun Liu 3 năm trước cách đây
mục cha
commit
0af69f83f2

+ 1 - 1
Cargo.toml

@@ -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"]
 
 

+ 2 - 2
docs/reference/src/guide/hot_reloading.md

@@ -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

+ 1 - 1
packages/core-macro/Cargo.toml

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

+ 3 - 3
packages/core-macro/src/lib.rs

@@ -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()
         }
     }

+ 1 - 1
packages/desktop/Cargo.toml

@@ -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" }

+ 1 - 1
packages/desktop/src/controller.rs

@@ -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,

+ 1 - 1
packages/web/Cargo.toml

@@ -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" }

+ 1 - 1
packages/web/src/lib.rs

@@ -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};

+ 2 - 2
src/lib.rs

@@ -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,