Skip to content

EntityRef/Mut get_components (immutable variants only)#15089

Merged
alice-i-cecile merged 9 commits intobevyengine:mainfrom
ItsDoot:get_components
Sep 9, 2024
Merged

EntityRef/Mut get_components (immutable variants only)#15089
alice-i-cecile merged 9 commits intobevyengine:mainfrom
ItsDoot:get_components

Conversation

@ItsDoot
Copy link
Copy Markdown
Contributor

@ItsDoot ItsDoot commented Sep 8, 2024

Objective

Smaller scoped version of #13375 without the _mut variants which currently have unsoundness issues.

Solution

Same as #13375, but without the _mut variants.

Testing


Migration Guide

  • Renamed FilteredEntityRef::components to FilteredEntityRef::accessed_components and FilteredEntityMut::components to FilteredEntityMut::accessed_components.

@ItsDoot ItsDoot added C-Feature A new feature, making something new possible A-ECS Entities, components, systems, and events M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 8, 2024
@ItsDoot ItsDoot added this to the 0.15 milestone Sep 8, 2024
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!

It seems like this should have needed a safety comment somewhere explaining how it relies on ReadOnlyQueryData. Maybe there should be a safety requirement on init_fetch that the access is consistent, and that is normally discharged by calling update_component_access and having it not panic? (That shouldn't block this PR, of course.)

@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 Sep 8, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 9, 2024
Merged via the queue into bevyengine:main with commit 79f6fcd Sep 9, 2024
@ItsDoot ItsDoot deleted the get_components branch September 9, 2024 17:40
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-Feature A new feature, making something new possible M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide 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