-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Hotreloading of for/if/body
, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI
#2258
Hotreloading of for/if/body
, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI
#2258
Conversation
for
loopsfor
loops and if
chains
for
loops and if
chainsfor/if/body
I have since expanded the scope of this PR to include anything that seems feasibly hotreloadable. This includes literals anywhere we can find them in components and global signals. So you could in theory hotreload the majority of basic stuff: #[component]
fn comp() {
// Hot reload the value of x
let x = 0;
// Hot reload the value of 0
if x == 0 {
return rsx! {
div { "Hello" }
}
}
rsx! {
// Or hot reload the iterator start and end
for i in 0..10 {
div { "World" }
}
}
} My ultimate goal with all this work is to slap a little UI designer frontend on top that we can plug into devtools. This would let you do storybooks and UI construction without ever recompiling. Drag-and-drop UI builder, app route reloading, integration with gen AI etc. Eventually eventually, get cranelift JIT up and running and then hotreload components themselves. With the eventual cranelift work, we basically have Dart's hotreload engine and then can probably start to strip out the manual template-based hotreloading. I don't want to get too crazy with hotreloading now since that work will probably make most of this work moot, but the timelines there are much longer. |
for/if/body
for/if/body
, formatted strings, literals, and component props
for/if/body
, formatted strings, literals, and component propsfor/if/body
, formatted strings, literals, component props, nested rsx
Things to test:
|
Does it PR respect ❯ cat .cargo/config.toml
[build]
rustflags = ["--cfg", "tokio_unstable"] For some reason it didn't work -dioxus = { git = "https://github.com/DioxusLabs/dioxus.git", rev = "742721b", features = ["fullstack", "router"] }
+dioxus = { git = "https://github.com/DioxusLabs/dioxus.git", rev = "443b9a4", features = ["fullstack", "router"] } thread 'main' panicked at /home/chung/.cargo/registry/src/index.crates.io-6f17d22bba15001f/console-subscriber-0.3.0/src/lib.rs:265:9:
task tracing requires Tokio to be built with RUSTFLAGS="--cfg tokio_unstable"!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Of course if I run Ref: https://github.com/tokio-rs/console?tab=readme-ov-file#using-it |
Hotreload the contents of for loops, if chains, component bodies, props, attributes, and any literals discovered in rsx!
This is breaking since we need to open a bunch of APIs making this no longer compatible with all the support crates in 0.5. Anyways, plan is to ship by end of april so it's fine that we keep this PR out here for a while.
Also brings in binary patching for components for *nix targets under an experimental flag.
Specifics/todos:
Tests:
CLI Rewrite (prep for plugins):
Final todo:
..
syntax is not actually generating a spread for elements/componentskrates
from rsx?Demo:
hotreload_strings.mov
props_reloaded_too.mov