Merge pull request #458 from mrxiaozhuox/patch-3

change the hot_reload feature to hot-reload
This commit is contained in:
Demonthos authored and GitHub committed 2022-06-26 07:16:01 -05:00
commit d8f2174755
9 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ desktop = ["dioxus-desktop"]
router = ["dioxus-router"] router = ["dioxus-router"]
tui = ["dioxus-tui"] tui = ["dioxus-tui"]
liveview = ["dioxus-liveview"] 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"] native-core = ["dioxus-native-core", "dioxus-native-core-macro"]
+2 -2
View File
@@ -5,9 +5,9 @@
# Setup # Setup
Install [dioxus-cli](https://github.com/DioxusLabs/cli). Install [dioxus-cli](https://github.com/DioxusLabs/cli).
Enable the hot_reload feature on dioxus: Enable the hot-reload feature on dioxus:
```toml ```toml
dioxus = { version = "*", features = ["web", "hot_reload"] } dioxus = { version = "*", features = ["web", "hot-reload"] }
``` ```
# Usage # Usage
+1 -1
View File
@@ -28,4 +28,4 @@ trybuild = "1.0"
[features] [features]
default = [] default = []
hot_reload = ["dioxus-rsx-interpreter"] hot-reload = ["dioxus-rsx-interpreter"]
+3 -3
View File
@@ -34,12 +34,12 @@ pub fn derive_typed_builder(input: proc_macro::TokenStream) -> proc_macro::Token
/// ``` /// ```
#[proc_macro] #[proc_macro]
pub fn rsx(s: TokenStream) -> TokenStream { pub fn rsx(s: TokenStream) -> TokenStream {
#[cfg(feature = "hot_reload")] #[cfg(feature = "hot-reload")]
let rsx_text = s.to_string(); let rsx_text = s.to_string();
match syn::parse::<rsx::CallBody>(s) { match syn::parse::<rsx::CallBody>(s) {
Err(err) => err.to_compile_error().into(), Err(err) => err.to_compile_error().into(),
Ok(body) => { Ok(body) => {
#[cfg(feature = "hot_reload")] #[cfg(feature = "hot-reload")]
{ {
use dioxus_rsx_interpreter::captuered_context::CapturedContextBuilder; use dioxus_rsx_interpreter::captuered_context::CapturedContextBuilder;
@@ -66,7 +66,7 @@ pub fn rsx(s: TokenStream) -> TokenStream {
Err(err) => err.into_compile_error().into(), Err(err) => err.into_compile_error().into(),
} }
} }
#[cfg(not(feature = "hot_reload"))] #[cfg(not(feature = "hot-reload"))]
body.to_token_stream().into() body.to_token_stream().into()
} }
} }
+1 -1
View File
@@ -44,7 +44,7 @@ tokio_runtime = ["tokio"]
fullscreen = ["wry/fullscreen"] fullscreen = ["wry/fullscreen"]
transparent = ["wry/transparent"] transparent = ["wry/transparent"]
tray = ["wry/tray"] tray = ["wry/tray"]
hot_reload = ["dioxus-rsx-interpreter", "interprocess"] hot-reload = ["dioxus-rsx-interpreter", "interprocess"]
[dev-dependencies] [dev-dependencies]
dioxus-core-macro = { path = "../core-macro" } dioxus-core-macro = { path = "../core-macro" }
+1 -1
View File
@@ -51,7 +51,7 @@ impl DesktopController {
dom.base_scope().provide_context(window_context); 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 // 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::{ use dioxus_rsx_interpreter::{
error::Error, ErrorHandler, SetManyRsxMessage, RSX_CONTEXT, error::Error, ErrorHandler, SetManyRsxMessage, RSX_CONTEXT,
+1 -1
View File
@@ -77,7 +77,7 @@ features = [
[features] [features]
default = ["panic_hook"] default = ["panic_hook"]
panic_hook = ["console_error_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] [dev-dependencies]
dioxus-core-macro = { path = "../core-macro" } dioxus-core-macro = { path = "../core-macro" }
+1 -1
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(); 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::error::Error;
use dioxus_rsx_interpreter::{ErrorHandler, SetManyRsxMessage, RSX_CONTEXT}; use dioxus_rsx_interpreter::{ErrorHandler, SetManyRsxMessage, RSX_CONTEXT};
+2 -2
View File
@@ -46,7 +46,7 @@ pub mod events {
pub use dioxus_rsx as rsx; pub use dioxus_rsx as rsx;
#[cfg(feature = "hot_reload")] #[cfg(feature = "hot-reload")]
pub use dioxus_rsx_interpreter as rsx_interpreter; pub use dioxus_rsx_interpreter as rsx_interpreter;
pub mod prelude { pub mod prelude {
@@ -62,7 +62,7 @@ pub mod prelude {
#[cfg(feature = "fermi")] #[cfg(feature = "fermi")]
pub use fermi::{use_atom_ref, use_init_atom_root, use_read, use_set, Atom, AtomRef}; 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::{ pub use dioxus_rsx_interpreter::{
captuered_context::{CapturedContext, FormattedArg, IfmtArgs}, captuered_context::{CapturedContext, FormattedArg, IfmtArgs},
get_line_num, resolve_scope, CodeLocation, RsxContext, get_line_num, resolve_scope, CodeLocation, RsxContext,