File watcher should be more selective
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
Research direction
Read the discussion in #26407 and trace Bevy’s asset server file-watching path. The issue suggests filtering reloads by asset type or file path, or skipping reloads caused by the app itself, but does not name files or tests. Done means an editor can opt out of watching selected assets; first clarify which approach and behavior the project wants.
Written by the indexing model from the issue text.
Description
What problem does this solve or what need does it fill?
When writing an editor in Bevy, file watching can sometimes hurt more than it helps.
As a general rule, apps which are the sole source of truth for a file don't need the file system to tell them when something changed, they already know it. Worse, having to respond to a reload request for a file that they just themselves saved requires complex logic, since (to avoid flicker) they have to diff the incoming file with their own in-memory copy - since a full reload of the asset would require rebuilding derived data and restart animations.
This logic does not apply to assets that are coming from another app, e.g. models exported from blender where hot reloading is a clear win.
The question is what counts as a "sole source". Any asset might be replaced by a git sync; some asset types might also be editable in a text editor. However, not every editor will want to support this workflow: they would rather advise the user to quit the editor when pulling down new content from git rather than deal with the complexity of having to filter out it's own save events, or suffer the visual glitchiness of not doing so.
Currently Bevy's file watcher is all or nothing, so an editor has no choice about which files they want to watch.
What solution would you like?
There are a couple of potential solutions. The ideal would be for the asset server to skip reloads coming from the app itself; but this might be hard to arrange.
An easier approach would be the ability to opt-out of file watching on the basis of asset type or file path.
Additional context
See also #26407
@alice-i-cecile @andriyDev @jbuehler23
- Dominant language
- Rust
- Stars
- 49.8k
- Forks
- 5.1k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 136
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bevyengine/bevy
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26642 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26641 ·
Maintainers usually reply within 2 days
-
A-Animation AI-Assisted C-Bug D-Trivial S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy#26637 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy#26635 ·
Maintainers usually reply within 2 days
-
Feathers checkbox outline should have flex_shrink: 0Possibly taken @Tatsuya0330 claimed this today. OpenC-Bug S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bevyengine/bevy#26630 ·
Maintainers usually reply within 2 days
Similar issues
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
bug triaged tui ux wontfix
Difficulty 2/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day