Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hotreloading issues, clean up the CLI a bit #2055

Merged
merged 14 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"[toml]": {
"editor.formatOnSave": false
},
"rust-analyzer.check.workspace": false,
// "rust-analyzer.check.workspace": true,
"rust-analyzer.check.workspace": false,
"rust-analyzer.check.features": "all",
"rust-analyzer.cargo.features": "all",
"rust-analyzer.check.allTargets": true
Expand Down
89 changes: 45 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 38 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ members = [
"packages/playwright-tests/web",
"packages/playwright-tests/fullstack",
]
exclude = ["examples/mobile_demo", "examples/openid_connect_demo",]
exclude = ["examples/mobile_demo", "examples/openid_connect_demo"]

[workspace.package]
version = "0.5.0-alpha.0"
Expand All @@ -56,27 +56,27 @@ dioxus-lib = { path = "packages/dioxus-lib", version = "0.5.0-alpha.0" }
dioxus-core = { path = "packages/core", version = "0.5.0-alpha.0" }
dioxus-core-macro = { path = "packages/core-macro", version = "0.5.0-alpha.0" }
dioxus-config-macro = { path = "packages/config-macro", version = "0.5.0-alpha.0" }
dioxus-router = { path = "packages/router", version = "0.5.0-alpha.0" }
dioxus-router = { path = "packages/router", version = "0.5.0-alpha.0" }
dioxus-router-macro = { path = "packages/router-macro", version = "0.5.0-alpha.0" }
dioxus-html = { path = "packages/html", version = "0.5.0-alpha.0" }
dioxus-html-internal-macro = { path = "packages/html-internal-macro", version = "0.5.0-alpha.0" }
dioxus-html = { path = "packages/html", version = "0.5.0-alpha.0" }
dioxus-html-internal-macro = { path = "packages/html-internal-macro", version = "0.5.0-alpha.0" }
dioxus-hooks = { path = "packages/hooks", version = "0.5.0-alpha.0" }
dioxus-web = { path = "packages/web", version = "0.5.0-alpha.0" }
dioxus-ssr = { path = "packages/ssr", version = "0.5.0-alpha.0", default-features = false }
dioxus-desktop = { path = "packages/desktop", version = "0.5.0-alpha.0" }
dioxus-mobile = { path = "packages/mobile", version = "0.5.0-alpha.0" }
dioxus-mobile = { path = "packages/mobile", version = "0.5.0-alpha.0" }
dioxus-interpreter-js = { path = "packages/interpreter", version = "0.5.0-alpha.0" }
dioxus-liveview = { path = "packages/liveview", version = "0.5.0-alpha.0" }
dioxus-autofmt = { path = "packages/autofmt", version = "0.5.0-alpha.0" }
dioxus-check = { path = "packages/check", version = "0.5.0-alpha.0" }
dioxus-rsx = { path = "packages/rsx", version = "0.5.0-alpha.0" }
dioxus-liveview = { path = "packages/liveview", version = "0.5.0-alpha.0" }
dioxus-autofmt = { path = "packages/autofmt", version = "0.5.0-alpha.0" }
dioxus-check = { path = "packages/check", version = "0.5.0-alpha.0" }
dioxus-rsx = { path = "packages/rsx", version = "0.5.0-alpha.0" }
rsx-rosetta = { path = "packages/rsx-rosetta", version = "0.5.0-alpha.0" }
dioxus-signals = { path = "packages/signals", version = "0.5.0-alpha.0" }
dioxus-cli-config = { path = "packages/cli-config", version = "0.5.0-alpha.0" }
generational-box = { path = "packages/generational-box", version = "0.5.0-alpha.0" }
dioxus-hot-reload = { path = "packages/hot-reload", version = "0.5.0-alpha.0" }
dioxus-fullstack = { path = "packages/fullstack", version = "0.5.0-alpha.0" }
dioxus_server_macro = { path = "packages/server-macro", version = "0.5.0-alpha.0", default-features = false}
dioxus_server_macro = { path = "packages/server-macro", version = "0.5.0-alpha.0", default-features = false }
dioxus-ext = { path = "packages/extension", version = "0.4.0" }
tracing = "0.1.37"
tracing-futures = "0.2.5"
Expand All @@ -97,21 +97,38 @@ manganis-cli-support = { version = "0.2.1", features = [
] }
manganis = { version = "0.2.1" }

interprocess = { version = "1.2.1" }
# interprocess = { git = "https://github.com/kotauskas/interprocess" }

lru = "0.12.2"
async-trait = "0.1.77"
axum = "0.7.0"
axum-server = {version = "0.6.0", default-features = false}
axum-server = { version = "0.6.0", default-features = false }
tower = "0.4.13"
http = "1.0.0"
tower-http = "0.5.1"
hyper = "1.0.0"
hyper-rustls = "0.26.0"
serde_json = "1.0.61"
serde = "1.0.61"
syn = "2.0"
quote = "1.0"
proc-macro2 = "1.0"
axum_session = "0.12.1"
axum_session_auth = "0.12.1"
axum-extra = "0.9.2"
reqwest = "0.11.24"
owo-colors = "4.0.0"

# Enable a small amount of optimization in debug mode
[profile.cli-dev]
inherits = "dev"
opt-level = 1

# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.cli-dev.package."*"]
opt-level = 3


# This is a "virtual package"
# It is not meant to be published, but is used so "cargo run --example XYZ" works properly
Expand All @@ -130,9 +147,9 @@ rust-version = "1.60.0"
publish = false

[dependencies]
manganis = { workspace = true, optional = true}
reqwest = { version = "0.11.9", features = ["json"], optional = true}
http-range = {version = "0.1.5", optional = true }
manganis = { workspace = true, optional = true }
reqwest = { version = "0.11.9", features = ["json"], optional = true }
http-range = { version = "0.1.5", optional = true }

[dev-dependencies]
dioxus = { workspace = true, features = ["router"] }
Expand All @@ -146,7 +163,13 @@ form_urlencoded = "1.2.0"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
getrandom = { version = "0.2.12", features = ["js"] }
tokio = { version = "1.16.1", default-features = false, features = ["sync", "macros", "io-util", "rt", "time"] }
tokio = { version = "1.16.1", default-features = false, features = [
"sync",
"macros",
"io-util",
"rt",
"time",
] }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
tokio = { version = "1.16.1", features = ["full"] }
Expand Down
4 changes: 2 additions & 2 deletions packages/autofmt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ keywords = ["dom", "ui", "gui", "react"]
[dependencies]
dioxus-rsx = { workspace = true }
proc-macro2 = { version = "1.0.6", features = ["span-locations"] }
quote = "1.0"
syn = { version = "2.0", features = ["full", "extra-traits", "visit"] }
quote = { workspace = true }
syn = { workspace = true, features = ["full", "extra-traits", "visit"] }
serde = { version = "1.0.136", features = ["derive"] }
prettyplease = { workspace = true }

Expand Down
8 changes: 4 additions & 4 deletions packages/check/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ keywords = ["dom", "ui", "gui", "react"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
proc-macro2 = { version = "1.0.6", features = ["span-locations"] }
quote = "1.0"
syn = { version = "1.0.11", features = ["full", "extra-traits", "visit"] }
owo-colors = { version = "3.5.0", features = ["supports-colors"] }
proc-macro2 = { workspace = true, features = ["span-locations"] }
quote = {workspace = true }
syn = { workspace = true, features = ["full", "extra-traits", "visit"] }
owo-colors = { workspace = true, features = ["supports-colors"] }

[dev-dependencies]
indoc = "2.0.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/check/src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ fn is_component_fn(item_fn: &syn::ItemFn) -> bool {
fn get_closure_hook_body(local: &syn::Local) -> Option<&syn::Expr> {
if let Pat::Ident(ident) = &local.pat {
if is_hook_ident(&ident.ident) {
if let Some((_, expr)) = &local.init {
if let syn::Expr::Closure(closure) = &**expr {
if let Some(init) = &local.init {
if let syn::Expr::Closure(closure) = init.expr.as_ref() {
return Some(&closure.body);
}
}
Expand Down
Loading
Loading