bevy/crates
Alice Cecile 61a5a37584
Improve module structure of observers code (#19779)
# Objective

While working on #17607, I found myself confused and frustrated by the
tangled web woven by the various modules inside of our observers code.

Rather than tackle that as part of a big rewrite PR, I've decided to do
the mature (if frustrating) thing where you split out your trivial but
noisy refactoring first.

There are a large number of moving parts, especially in terms of
storage, and these are strewn willy-nilly across the module with no
apparent ordering. To make matters worse, this was almost all just
dumped into a multi-thousand LOC mod.rs at the root.

## Solution

I've reshuffled the modules, attempting to:
- reduce the size of the mod.rs file
- organize structs so that smaller structs are found after the larger
structs that contain them
- group related functionality together
- document why modules exist, and their broad organization

No functional changes have been made here, although I've had to increase
the visibility of a few fields from private to pub(crate) or pub(super)
to keep things compiling.

During these changes, I've opted for the lazy private module, public
re-export strategy, to avoid causing any breakages, both within and
outside of `bevy` itself. I think we can do better, but I want to leave
that for a proper cleanup pass at the end. There's no sense maintaining
migration guides and forcing multiple breaking changes throughout the
cycle.

## Testing

No functional changes; relying on existing test suite and the Rust
compiler.
2025-06-22 23:25:25 +00:00
..
bevy_a11y Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_animation Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_anti_aliasing Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_app Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_asset Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_audio Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_color Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_core_pipeline Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_core_widgets Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_derive Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_dev_tools Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_diagnostic Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_dylib Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_ecs Improve module structure of observers code (#19779) 2025-06-22 23:25:25 +00:00
bevy_encase_derive Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_gilrs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_gizmos Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_gltf Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_image Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_input Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_input_focus Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_internal Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_log Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_macro_utils Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_math Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_mesh Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_mikktspace Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_pbr Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_picking Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_platform Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_ptr Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_reflect Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_remote Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_render Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_scene Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_solari Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_sprite Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_state Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_tasks Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_text Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_time Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_transform Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_ui Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_utils Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_window Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_winit Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00