rksm / hot-lib-reloader-rs

Reload Rust code without app restarts. For faster feedback cycles.
MIT License
614 stars 20 forks source link

Hot-reloading Bevy systems that use Bevy Resources do not work #39

Open kaphula opened 1 month ago

kaphula commented 1 month ago

While hot-reloading simple systems work, when you add Bevy resources the hot-reloading breaks. Here is a repo/branch to demonstrate this issue, see the main.rs file.

It was suggested to me that since Bevy is a dependency on the crate that will be hot-reloaded, there is another dependency of Bevy, crossbeam, which will force recompilation of all crates of the project due to its buildscripts even though you would only want to recompile the hot-reload crate that contains the mangled systems. This is apparantly messes up the TypeIds and the program crashes or ends up with undefined behavior.