-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Fix hot reloading for read_asset_bytes #6797
[Merged by Bors] - Fix hot reloading for read_asset_bytes #6797
Conversation
a46a80d
to
468f2f7
Compare
bors try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good comments and a nice fix.
tryBuild failed: |
c766d16
to
dce6a63
Compare
Had updated the wasm code but forgot about Android; fixed now. |
Awesome thank you |
crates/bevy_asset/src/io/mod.rs
Outdated
/// Otherwise, if `to_watch` gets modified, trigger a reload for `to_reload`. | ||
/// Note that multiple `to_reload` paths can map to the same `to_watch` and | ||
/// multiple `to_watch` paths can map to the same `to_reload`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add more details on why someone calling this method would want to provide two different paths?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
The paths differ when an asset found at `to_reload` depends on data found at `to_watch`.
suffice?
crates/bevy_asset/src/io/mod.rs
Outdated
to_watch: &Path, | ||
to_reload: PathBuf, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems they will often be the same path, could to_reload be an option in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
dce6a63
to
953440b
Compare
953440b
to
56ef85e
Compare
Example |
Managed to miss the change in the |
bors try |
bors r+ |
# Objective Fixes #6780 ## Solution - record the asset path of each watched file - call `AssetIo::watch_for_changes` in `LoadContext::read_asset_bytes` --- ## Changelog ### Fixed - fixed hot reloading for `LoadContext::read_asset_bytes` ### Changed - `AssetIo::watch_path_for_changes` allows watched path and path to reload to differ ## Migration Guide - for custom `AssetIo`s, differentiate paths to watch and asset paths to reload as a consequence Co-authored-by: Vincent Junge <specificprotagonist@posteo.org>
Pull request successfully merged into main. Build succeeded:
|
# Objective Fixes bevyengine#6780 ## Solution - record the asset path of each watched file - call `AssetIo::watch_for_changes` in `LoadContext::read_asset_bytes` --- ## Changelog ### Fixed - fixed hot reloading for `LoadContext::read_asset_bytes` ### Changed - `AssetIo::watch_path_for_changes` allows watched path and path to reload to differ ## Migration Guide - for custom `AssetIo`s, differentiate paths to watch and asset paths to reload as a consequence Co-authored-by: Vincent Junge <specificprotagonist@posteo.org>
Objective
Fixes #6780
Solution
AssetIo::watch_for_changes
inLoadContext::read_asset_bytes
Changelog
Fixed
LoadContext::read_asset_bytes
Changed
AssetIo::watch_path_for_changes
allows watched path and path to reload to differMigration Guide
AssetIo
s, differentiate paths to watch and asset paths to reload as a consequence