Explore asset hot reloading for bevy run web
#189
Labels
A-Run
Related to the bevy run command
A-Web
Building or running Bevy apps targeting the browser
C-Feature
Make something new possible
D-Complex
Quite challenging from either a design or technical perspective. Ask for help!
S-Needs-Design
This issue requires design work to think about how it would best be accomplished
Asset hot reloading is a very important feature of Bevy.
Due to Rust's relatively slow compile times, it can really improve the speed of the development cycle.
Unfortunately, it's not available when targeting the browser.
The main reason is that web apps don't have direct access to the file system and we cannot assume a specific web server implementation, so no standard API to communicate file changes between the server and web client.
With the Bevy CLI, we have full control over the development web server!
So it's likely possible that we can make hot reloading work.
Requirements
Potential solutions
The Bevy CLI would create file watchers for the asset directory and then somehow communicate the changes to the Bevy app.
I can see two ways of communication:
Afterwards, the Bevy app has to process these events, likely forwarding them to the asset server / asset source. This source then performs the reload, same as for native hot-reloading.
Triggering the internal hot-reload likely requires changes to Bevy itself, so we can access the relevant functionality from "outside".
The text was updated successfully, but these errors were encountered: