Skip to content

can reflect observers#23797

Merged
alice-i-cecile merged 6 commits intobevyengine:mainfrom
mockersf:can-reflect-observer
Apr 16, 2026
Merged

can reflect observers#23797
alice-i-cecile merged 6 commits intobevyengine:mainfrom
mockersf:can-reflect-observer

Conversation

@mockersf
Copy link
Copy Markdown
Member

Objective

  • Reflect observers so that I can observe my reflection

Solution

  • Reflect observers

Testing

  • CI (and followup PR)

@mockersf mockersf added A-ECS Entities, components, systems, and events A-Reflection Runtime information about types labels Apr 14, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Reflection Apr 14, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in ECS Apr 14, 2026
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 14, 2026
@alice-i-cecile alice-i-cecile added X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples and removed D-Trivial Nice and easy! A great choice to get started with Bevy labels Apr 14, 2026
Comment thread crates/bevy_ecs/src/reflect/event.rs Outdated
Copy link
Copy Markdown
Contributor

@chescock chescock left a comment

Choose a reason for hiding this comment

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

Looks good! I left a few more thoughts on how we might generalize things more, but none of them should be blocking.

Comment thread crates/bevy_ecs/src/reflect/event.rs Outdated
@@ -37,6 +45,15 @@ pub struct ReflectEvent(ReflectEventFns);
pub struct ReflectEventFns {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not for this PR, but will we also want a fn register_event_key(&self, &mut World) -> EventKey, similar to ReflectComponent::register_component?

I think that would make it just possible to construct a completely dynamic observer using Observer::with_dynamic_runner, Observer::with_event_key, and ReflectFromPtr::from_ptr. And the fact that everything would be possible might discourage certain reviewers from trying to overgeneralize the convenience methods :).

Comment thread crates/bevy_ecs/src/reflect/event.rs Outdated
@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 Apr 15, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 16, 2026
Merged via the queue into bevyengine:main with commit cb3cba9 Apr 16, 2026
38 checks passed
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in ECS Apr 16, 2026
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in Reflection Apr 16, 2026
mockersf added a commit to mockersf/bevy that referenced this pull request Apr 16, 2026
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 A-Reflection Runtime information about types D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants