Skip to content

Conversation

JaySpruce
Copy link
Member

Objective

change_detection.rs is a bit big at ~1900 lines and its contents are pretty varied, so it ought to be split up.

Solution

Split change_detection.rs into 4 files:

  • mod.rs: Re-exports, some constants, testing
  • params.rs: Change-detecting system/query parameters like Ref and Res
  • traits.rs: The DetectChanges and DetectChangesMut traits and the macros used internally to implement those traits (and some others) for the above parameters
  • maybe_location.rs: MaybeLocation and its impls

This shouldn't change anything publicly, since everything's still in the same module.

I'd also like to move component/tick.rs into this module, but that would break stuff, so that'll be its own PR.

@JaySpruce JaySpruce added A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 19, 2025
@JaySpruce JaySpruce changed the title Make change_detection its own module and split into multiple files Give change_detection its own folder and split into multiple files Oct 19, 2025
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not a fan of the name of this module, but that should be done later. Definitely think this is overdue for some reorganization though.

@JaySpruce
Copy link
Member Author

What are you thinking for the name?

@alice-i-cecile
Copy link
Member

What are you thinking for the name?

I'm not sure 🤔 It just feels really weird to have e.g. Mut inside of a module caused change_detection to me: it feels incidental.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 20, 2025
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 20, 2025
Merged via the queue into bevyengine:main with commit 39e7f50 Oct 20, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants