Open jiker-burce opened 2 weeks ago
include_str
is a macro that copies the contents of the file to a string literal. The git version of Dioxus has limited for hot reloading assets that are read at runtime, but it cannot hot reload arbitrary macros. That would likely need deeper integration with cargo itself. To hot reloading the arbitrary code that macros expand to, you would need to recompile and patch part of your running code which is much more complicated than what dioxus currently supports
If you change your code to link to the stylesheet instead of embed the stylesheet within the code, it may hot reload in the latest git version of dioxus and the dioxus CLI
@ealmloff I updated the version to 0.5.1 and use the link style, but it could not hot reload, too.
rsx! {
div {
link { href:"https://fonts.googleapis.com/icon?family=Material+Icons", rel:"stylesheet" },
link { href:"../../statics/client_style.css", rel:"stylesheet"},
the command line showed like this:
Rebuild needed... shutting down hot reloading.
Manually rebuild the application to view further changes.
Problem
It just notices me the following messages when I am modifying the css file of
style { include_str!("../../statics/client_style.css") }
:Steps To Reproduce
Steps to reproduce the behavior:
Client.rs render!(div { link { href:"https://fonts.googleapis.com/icon?family=Material+Icons", rel:"stylesheet" } style { include_str!("../../statics/client_style.css") } main {