-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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] - Improve debugging tools for change detection #4160
[Merged by Bors] - Improve debugging tools for change detection #4160
Conversation
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.
LGTM, just some nits on the wording in the docs.
bors try |
/// - `last_change_tick` copies the previous value of `change_tick` | ||
/// - `change_tick` copies the current value of [`World::read_change_tick`] |
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.
As you're making those fields private, it may be a little confusing to read in docs.rs where they will be hidden
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.
So, my thought was that users should be able to piece together what's going on because we expose methods of the same name.
Co-authored-by: Joy <51241057+maniwani@users.noreply.github.com>
e640022
to
ce77cae
Compare
bors r+ |
# Objective 1. Previously, the `change_tick` and `last_change_tick` fields on `SystemChangeTick` [were `pub`](https://docs.rs/bevy/0.6.1/bevy/ecs/system/struct.SystemChangeTick.html). 1. This was actively misleading, as while this can be fetched as a `SystemParam`, a copy is returned instead 2. This information could be useful for debugging, but there was no way to investigate when data was changed. 3. There were no docs! ## Solution 1. Move these to a getter method. 2. Add `last_changed` method to the `DetectChanges` trait to enable inspection of when data was last changed. 3. Add docs. # Changelog `SystemChangeTick` now provides getter methods for the current and previous change tick, rather than public fields. This can be combined with `DetectChanges::last_changed()` to debug the timing of changes. # Migration guide The `change_tick` and `last_change_tick` fields on `SystemChangeTick` are now private, use the corresponding getter method instead.
This PR was included in a batch that timed out, it will be automatically retried |
# Objective 1. Previously, the `change_tick` and `last_change_tick` fields on `SystemChangeTick` [were `pub`](https://docs.rs/bevy/0.6.1/bevy/ecs/system/struct.SystemChangeTick.html). 1. This was actively misleading, as while this can be fetched as a `SystemParam`, a copy is returned instead 2. This information could be useful for debugging, but there was no way to investigate when data was changed. 3. There were no docs! ## Solution 1. Move these to a getter method. 2. Add `last_changed` method to the `DetectChanges` trait to enable inspection of when data was last changed. 3. Add docs. # Changelog `SystemChangeTick` now provides getter methods for the current and previous change tick, rather than public fields. This can be combined with `DetectChanges::last_changed()` to debug the timing of changes. # Migration guide The `change_tick` and `last_change_tick` fields on `SystemChangeTick` are now private, use the corresponding getter method instead.
# Objective 1. Previously, the `change_tick` and `last_change_tick` fields on `SystemChangeTick` [were `pub`](https://docs.rs/bevy/0.6.1/bevy/ecs/system/struct.SystemChangeTick.html). 1. This was actively misleading, as while this can be fetched as a `SystemParam`, a copy is returned instead 2. This information could be useful for debugging, but there was no way to investigate when data was changed. 3. There were no docs! ## Solution 1. Move these to a getter method. 2. Add `last_changed` method to the `DetectChanges` trait to enable inspection of when data was last changed. 3. Add docs. # Changelog `SystemChangeTick` now provides getter methods for the current and previous change tick, rather than public fields. This can be combined with `DetectChanges::last_changed()` to debug the timing of changes. # Migration guide The `change_tick` and `last_change_tick` fields on `SystemChangeTick` are now private, use the corresponding getter method instead.
# Objective 1. Previously, the `change_tick` and `last_change_tick` fields on `SystemChangeTick` [were `pub`](https://docs.rs/bevy/0.6.1/bevy/ecs/system/struct.SystemChangeTick.html). 1. This was actively misleading, as while this can be fetched as a `SystemParam`, a copy is returned instead 2. This information could be useful for debugging, but there was no way to investigate when data was changed. 3. There were no docs! ## Solution 1. Move these to a getter method. 2. Add `last_changed` method to the `DetectChanges` trait to enable inspection of when data was last changed. 3. Add docs. # Changelog `SystemChangeTick` now provides getter methods for the current and previous change tick, rather than public fields. This can be combined with `DetectChanges::last_changed()` to debug the timing of changes. # Migration guide The `change_tick` and `last_change_tick` fields on `SystemChangeTick` are now private, use the corresponding getter method instead.
Objective
change_tick
andlast_change_tick
fields onSystemChangeTick
werepub
.SystemParam
, a copy is returned insteadSolution
last_changed
method to theDetectChanges
trait to enable inspection of when data was last changed.Changelog
SystemChangeTick
now provides getter methods for the current and previous change tick, rather than public fields.This can be combined with
DetectChanges::last_changed()
to debug the timing of changes.Migration guide
The
change_tick
andlast_change_tick
fields onSystemChangeTick
are now private, use the corresponding getter method instead.