Hot Reloading
- Hot reloading allows much faster iteration times inside of rsx calls by interperting them and streaming the edits.
- It is useful when changing the styling/layout of a program, but will not help with changing the logic of a program.
- Currently the cli only implements hot reloading for the web renderer.
Setup
Install dioxus-cli.
Enable the hot-reload feature on dioxus:
dioxus = { version = "*", features = ["web", "hot-reload"] }
Usage
run:
dioxus serve --hot-reload
change some code within a rsx macro
open your localhost in a browser
save and watch the style change without recompiling
Limitations
- The interperter can only use expressions that existed on the last full recompile. If you introduce a new variable or expression to the rsx call, it will trigger a full recompile to capture the expression.
- Components and Iterators can contain abritary rust code, and will trigger a full recompile when changed.