Skip to content

Make the ObservedBy component useful to public consumers #19591

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
merged 3 commits into from
Jun 12, 2025

Conversation

alice-i-cecile
Copy link
Member

Objective

As raised by @Jondolf, this type is pub, and useful for various consumers to ensure cleanup or debugging.

However, it doesn't offer any way to actually view the data.

Solution

  • Add a read-only view of the data.
  • Don't add any (easy) way to mutate the data, as this presents a huge footgun.
  • Implement Reflect and register the component so you can see it in inspectors nicely.

@alice-i-cecile alice-i-cecile added this to the 0.16.2 milestone Jun 11, 2025
@alice-i-cecile alice-i-cecile requested a review from Jondolf June 11, 2025 22:17
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 11, 2025
@alice-i-cecile alice-i-cecile moved this to Observer overhaul in Alice's Work Planning Jun 11, 2025
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy 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 D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 11, 2025
@alice-i-cecile alice-i-cecile enabled auto-merge June 11, 2025 22:24
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 11, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 12, 2025
Merged via the queue into bevyengine:main with commit 58c276a Jun 12, 2025
31 of 32 checks passed
@alice-i-cecile alice-i-cecile moved this from Observer overhaul to Observers - Completed in Alice's Work Planning Jun 15, 2025
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-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy 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: Observers - Completed
Development

Successfully merging this pull request may close these issues.

2 participants