[Merged by Bors] - Add a change detection bypass and manual control over change ticks#5635
Closed
alice-i-cecile wants to merge 5 commits intobevyengine:mainfrom
Closed
[Merged by Bors] - Add a change detection bypass and manual control over change ticks#5635alice-i-cecile wants to merge 5 commits intobevyengine:mainfrom
alice-i-cecile wants to merge 5 commits intobevyengine:mainfrom
Conversation
9dca3d1 to
f8b565a
Compare
alice-i-cecile
commented
Aug 9, 2022
alice-i-cecile
commented
Aug 9, 2022
Member
Author
|
CI failure appears to be due to the |
Member
Author
|
#5838 added similar functionality to systems themselves. |
jakobhellermann
approved these changes
Sep 8, 2022
Contributor
jakobhellermann
left a comment
There was a problem hiding this comment.
This is a useful feature for rare cases, and the docs correctly warn against potential footguns and suggests better alternatives for common cases.
Since this cannot be worked around in third-party crates I am very much in favor of adding these methods.
Co-authored-by: Jakob Hellermann <jakob.hellermann@protonmail.com>
TheRawMeatball
approved these changes
Sep 9, 2022
Member
Author
|
Removing the controversial label as this flavor of escape hatch was approved in #5838. |
Member
Author
|
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Sep 9, 2022
…5635) # Objective - Our existing change detection API is not flexible enough for advanced users: particularly those attempting to do rollback networking. - This is an important use case, and with adequate warnings we can make mucking about with change ticks scary enough that users generally won't do it. - Fixes #5633. - Closes #2363. ## Changelog - added `ChangeDetection::set_last_changed` to manually mutate the `last_change_ticks` field" - the `ChangeDetection` trait now requires an `Inner` associated type, which contains the value being wrapped. - added `ChangeDetection::bypass_change_detection`, which hands out a raw `&mut Inner` ## Migration Guide Add the `Inner` associated type and new methods to any type that you've implemented `DetectChanges` for.
Contributor
|
Pull request successfully merged into main. Build succeeded: |
nicopap
pushed a commit
to nicopap/bevy
that referenced
this pull request
Sep 12, 2022
…evyengine#5635) # Objective - Our existing change detection API is not flexible enough for advanced users: particularly those attempting to do rollback networking. - This is an important use case, and with adequate warnings we can make mucking about with change ticks scary enough that users generally won't do it. - Fixes bevyengine#5633. - Closes bevyengine#2363. ## Changelog - added `ChangeDetection::set_last_changed` to manually mutate the `last_change_ticks` field" - the `ChangeDetection` trait now requires an `Inner` associated type, which contains the value being wrapped. - added `ChangeDetection::bypass_change_detection`, which hands out a raw `&mut Inner` ## Migration Guide Add the `Inner` associated type and new methods to any type that you've implemented `DetectChanges` for.
james7132
pushed a commit
to james7132/bevy
that referenced
this pull request
Oct 28, 2022
…evyengine#5635) # Objective - Our existing change detection API is not flexible enough for advanced users: particularly those attempting to do rollback networking. - This is an important use case, and with adequate warnings we can make mucking about with change ticks scary enough that users generally won't do it. - Fixes bevyengine#5633. - Closes bevyengine#2363. ## Changelog - added `ChangeDetection::set_last_changed` to manually mutate the `last_change_ticks` field" - the `ChangeDetection` trait now requires an `Inner` associated type, which contains the value being wrapped. - added `ChangeDetection::bypass_change_detection`, which hands out a raw `&mut Inner` ## Migration Guide Add the `Inner` associated type and new methods to any type that you've implemented `DetectChanges` for.
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this pull request
Feb 1, 2023
…evyengine#5635) # Objective - Our existing change detection API is not flexible enough for advanced users: particularly those attempting to do rollback networking. - This is an important use case, and with adequate warnings we can make mucking about with change ticks scary enough that users generally won't do it. - Fixes bevyengine#5633. - Closes bevyengine#2363. ## Changelog - added `ChangeDetection::set_last_changed` to manually mutate the `last_change_ticks` field" - the `ChangeDetection` trait now requires an `Inner` associated type, which contains the value being wrapped. - added `ChangeDetection::bypass_change_detection`, which hands out a raw `&mut Inner` ## Migration Guide Add the `Inner` associated type and new methods to any type that you've implemented `DetectChanges` for.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Changelog
ChangeDetection::set_last_changedto manually mutate thelast_change_ticksfield"ChangeDetectiontrait now requires anInnerassociated type, which contains the value being wrapped.ChangeDetection::bypass_change_detection, which hands out a raw&mut InnerMigration Guide
Add the
Innerassociated type and new methods to any type that you've implementedDetectChangesfor.