You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TimJentzsch opened this issue
Dec 3, 2024
· 0 comments
Labels
A-RunRelated to the bevy run commandA-WebBuilding or running Bevy apps targeting the browserC-FeatureMake something new possibleD-ComplexQuite challenging from either a design or technical perspective. Ask for help!
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
Simple: Hot-reloading should work without additional configuration, or (if impossible) with very simple adjustments (e.g. adding one additional plugin to their app). They shouldn't have to make fundamental changes to their app.
Optional: If the user would have to make changes to their app in order to get hot reloading, they don't have to! Everything else should still work without adjustments. If we can make hot reloading work by default, the user should probably have a way to opt out.
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:
Client-authoritive: The Bevy app regularly makes API calls to the server, asking which changes happened since the last call.
Server-authoritive: Whenever a change happens, the server directly sends them over to the client (perhaps using web-sockets?).
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:
TimJentzsch
added
C-Feature
Make something new possible
A-Build
Related to the bevy build command
A-Web
Building or running Bevy apps targeting the browser
D-Complex
Quite challenging from either a design or technical perspective. Ask for help!
labels
Dec 3, 2024
A-RunRelated to the bevy run commandA-WebBuilding or running Bevy apps targeting the browserC-FeatureMake something new possibleD-ComplexQuite challenging from either a design or technical perspective. Ask for help!
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: