Skip to content
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

Remove flush_and_reserve_invalid_assuming_no_entities #16460

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SpecificProtagonist
Copy link
Contributor

@SpecificProtagonist SpecificProtagonist commented Nov 21, 2024

Objective

flush_and_reserve_invalid_assuming_no_entities was made for the old rendering world (which was reset every frame) and is usused since the 0.15 retained rendering world, but wasn't removed yet. It is pub, but is undocumented apart from the safety comment.

Solution

Remove flush_and_reserve_invalid_assuming_no_entities and the safety invariants this method required for EntityMeta, EntityLocation, TableId and TableRow. This reduces the amount of unsafe code & safety invariants and makes #16047 easier.

Alternatives

  • Document flush_and_reserve_invalid_assuming_no_entities and keep it unchanged
  • Document flush_and_reserve_invalid_assuming_no_entities and change it to be based on EntityMeta::INVALID

Migration Guide

  • exchange Entities::flush_and_reserve_invalid_assuming_no_entities for reserve and flush_as_invalid and notify us if that's insufficient

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Nov 21, 2024
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Nov 21, 2024
@alice-i-cecile alice-i-cecile added the C-Code-Quality A section of code that is hard to understand or change label Nov 21, 2024
@alice-i-cecile
Copy link
Member

I feel quite strongly that we should get rid of this. Keeping around unsafe backdoors with no users is just asking for surprising problems. For the migration guide, I mostly want them to tell us why they were using this!

@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Nov 21, 2024
Co-authored-by: Benjamin Brienen <[email protected]>
@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 Nov 22, 2024
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 M-Needs-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.

3 participants