Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975)

* simplify cli-config crate
* clean up configs
* add devtools crate, update cargo imports
* fix serve addr, fix websocket proxy issue
* add comment about opt profiles
* rename hot-reload to devtools
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-09-17 17:18:23 -07:00
1 parent 8203ee571f
commit 3fb1f739d1
58 files changed
+1131 -1654

No files matched your search

+4 -7
View File
@@ -61,25 +61,24 @@ tower-layer = { version = "0.3.2", optional = true }
parking_lot = { version = "0.12.1", features = ["send_guard"], optional = true }
web-sys = { version = "0.3.61", optional = true, features = ["Window", "Document", "Element", "HtmlDocument", "Storage", "console"] }
dioxus-cli-config = { workspace = true, features = ["read-config"], optional = true }
clap = { version = "4.5.7", optional = true, features = ["derive"] }
dioxus-cli-config = { workspace = true, optional = true }
dioxus-devtools = { workspace = true, optional = true }
aws-lc-rs = { version = "1.8.1", optional = true }
[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { workspace = true, features = ["rt", "sync"], optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
dioxus-hot-reload = { workspace = true, features = ["serve"] }
tokio = { workspace = true, features = ["rt", "sync", "rt-multi-thread"], optional = true }
[dev-dependencies]
dioxus = { workspace = true, features = ["fullstack"] }
[features]
default = ["hot-reload", "panic_hook", "document", "file_engine", "mounted"]
default = ["devtools", "panic_hook", "document", "file_engine", "mounted"]
panic_hook = ["dioxus-web?/panic_hook"]
hot-reload = ["dioxus-web?/hot_reload", "dioxus-hot-reload/serve"]
devtools = ["dioxus-web?/devtools", "dep:dioxus-devtools"]
mounted = ["dioxus-web?/mounted"]
file_engine = ["dioxus-web?/file_engine"]
document = ["dioxus-web?/document"]
@@ -108,8 +107,6 @@ server = [
"dep:async-trait",
"dep:parking_lot",
"dioxus-interpreter-js",
"dep:clap",
"dioxus-cli-config/read-from-args",
]
aws-lc-rs = ["dep:aws-lc-rs"]
+1 -8
View File
@@ -126,16 +126,9 @@ async fn launch_server(
build_virtual_dom: impl Fn() -> VirtualDom + Send + Sync + 'static,
context_providers: ContextProviders,
) {
use clap::Parser;
// Get the address the server should run on. If the CLI is running, the CLI proxies fullstack into the main address
// and we use the generated address the CLI gives us
let cli_args = dioxus_cli_config::RuntimeCLIArguments::from_cli();
let address = cli_args
.as_ref()
.map(|args| args.fullstack_address())
.unwrap_or_else(dioxus_cli_config::AddressArguments::parse)
.address();
let address = dioxus_cli_config::fullstack_address_or_localhost();
#[cfg(feature = "axum")]
{