From c4a307ac95e98e33da1161bc5d4d830a14e56b8e Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Fri, 24 Mar 2023 09:49:39 -0700 Subject: [PATCH] publish new version of cli note that we have to use a slightly outdated version of the hot reloading crate. --- Cargo.lock | 28 +++++++++++++++++----------- Cargo.toml | 16 ++++++---------- src/server/mod.rs | 17 +++++++---------- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e7be07a94..41d9f8eb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -677,10 +677,11 @@ dependencies = [ [[package]] name = "dioxus-autofmt" version = "0.3.0" -source = "git+https://github.com/dioxuslabs/dioxus#915406666dba6df7ae977cfc735823c9a95b7bd4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "935ac336dd077436505f2eda7b7b81515093e8a3fb352ac514cd6901dbd302e7" dependencies = [ "dioxus-rsx", - "prettyplease", + "prettier-please", "proc-macro2", "quote", "serde", @@ -689,7 +690,7 @@ dependencies = [ [[package]] name = "dioxus-cli" -version = "0.3.0" +version = "0.3.1" dependencies = [ "anyhow", "atty", @@ -743,7 +744,8 @@ dependencies = [ [[package]] name = "dioxus-core" version = "0.3.2" -source = "git+https://github.com/dioxuslabs/dioxus#915406666dba6df7ae977cfc735823c9a95b7bd4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc602f0ca7030f80fe4abc47cc43ffa75c6e7f48208c2b3f6ae24ec7bc6f6618" dependencies = [ "bumpalo", "bumpslab", @@ -761,7 +763,8 @@ dependencies = [ [[package]] name = "dioxus-html" version = "0.3.1" -source = "git+https://github.com/dioxuslabs/dioxus#915406666dba6df7ae977cfc735823c9a95b7bd4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7682a6615e4e5a460cd3293ce420451abffb719c84c4b54e297b17365f601fb4" dependencies = [ "async-trait", "dioxus-core", @@ -777,7 +780,8 @@ dependencies = [ [[package]] name = "dioxus-rsx" version = "0.0.3" -source = "git+https://github.com/dioxuslabs/dioxus#915406666dba6df7ae977cfc735823c9a95b7bd4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8544632e20f462a64f26502c91e7cf6ae3b30d82956e70543644d2c16b6659d" dependencies = [ "dioxus-core", "internment", @@ -2101,9 +2105,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "prettyplease" -version = "0.1.15" -source = "git+https://github.com/DioxusLabs/prettyplease-macro-fmt.git#de734495e2ca267afb7b20f7cd4fff88c7cb885c" +name = "prettier-please" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be31b7957122175fcf33c6d8f54489a5262176020bf096026a86b308b7fa5b23" dependencies = [ "proc-macro2", "syn", @@ -2313,8 +2318,9 @@ dependencies = [ [[package]] name = "rsx-rosetta" -version = "0.0.0" -source = "git+https://github.com/dioxuslabs/dioxus#915406666dba6df7ae977cfc735823c9a95b7bd4" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "593810f58a97e3a45e23b84437d5323c2420b46f73cf38fe49133eb59a7524bb" dependencies = [ "convert_case", "dioxus-autofmt", diff --git a/Cargo.toml b/Cargo.toml index 54beea7ba..45539252c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-cli" -version = "0.3.0" +version = "0.3.1" authors = ["Jonathan Kelley"] edition = "2021" description = "CLI tool for developing, testing, and publishing Dioxus apps" @@ -77,15 +77,11 @@ ctrlc = "3.2.3" # dioxus-rsx = "0.0.1" gitignore = "1.0.7" -dioxus-rsx = { git = "https://github.com/DioxusLabs/dioxus" } -dioxus-html = { git = "https://github.com/DioxusLabs/dioxus", features = [ - "hot-reload-context", -] } -dioxus-core = { git = "https://github.com/DioxusLabs/dioxus", features = [ - "serialize", -] } -dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus" } -rsx-rosetta = { git = "https://github.com/dioxuslabs/dioxus" } +dioxus-rsx = { version = "0.0.3" } +dioxus-html = { version = "0.3", features = ["hot-reload-context"] } +dioxus-core = { version = "0.3", features = ["serialize"] } +dioxus-autofmt = "0.3.0" +rsx-rosetta = { version = "0.3" } [[bin]] path = "src/main.rs" diff --git a/src/server/mod.rs b/src/server/mod.rs index 7a8325d6e..e78a8fb84 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -138,10 +138,10 @@ pub async fn startup_hot_reload(ip: String, port: u16, config: CrateConfig) -> R let dist_path = config.out_dir.clone(); let (reload_tx, _) = broadcast::channel(100); - let FileMapBuildResult { map, errors } = FileMap::::create(config.crate_dir.clone())?; - for err in errors { - log::error!("{}", err); - } + let map = FileMap::::new(config.crate_dir.clone()); + // for err in errors { + // log::error!("{}", err); + // } let file_map = Arc::new(Mutex::new(map)); let build_manager = Arc::new(BuildManager { config: config.clone(), @@ -207,10 +207,10 @@ pub async fn startup_hot_reload(ip: String, port: u16, config: CrateConfig) -> R let mut map = file_map.lock().unwrap(); match map.update_rsx(&path, &crate_dir) { - Ok(UpdateResult::UpdatedRsx(msgs)) => { + UpdateResult::UpdatedRsx(msgs) => { messages.extend(msgs); } - Ok(UpdateResult::NeedsRebuild) => { + UpdateResult::NeedsRebuild => { match build_manager.rebuild() { Ok(res) => { print_console_info( @@ -230,9 +230,6 @@ pub async fn startup_hot_reload(ip: String, port: u16, config: CrateConfig) -> R } return; } - Err(err) => { - log::error!("{}", err); - } } } for msg in messages { @@ -306,7 +303,7 @@ pub async fn startup_hot_reload(ip: String, port: u16, config: CrateConfig) -> R let mut router = Router::new().route("/_dioxus/ws", get(ws_handler)); for proxy_config in config.dioxus_config.web.proxy.unwrap_or_default() { - router = proxy::add_proxy(router, &proxy_config )?; + router = proxy::add_proxy(router, &proxy_config)?; } router = router.fallback(get_service(file_service).handle_error( |error: std::io::Error| async move {