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

Cache systems by S instead of S::System #16694

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

Conversation

benfrankel
Copy link
Contributor

@benfrankel benfrankel commented Dec 6, 2024

Objective

Solution

  • Cache one-shot systems by S: IntoSystem (which is const-asserted to be a ZST) rather than S::System.

Testing

Not tested besides CI.


Migration Guide

The CachedSystemId resource has been changed:

// Before:
let cached_id = CachedSystemId::<S::System>(id);
assert!(id == cached_id.0);

// After:
let cached_id = CachedSystemId::<S>::new(id);
assert!(id == SystemId::from_entity(cached_id.entity));

@benfrankel benfrankel marked this pull request as draft December 6, 2024 20:37
@benfrankel benfrankel marked this pull request as ready for review December 6, 2024 21: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 M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Dec 7, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

I like this change, but it needs a test :)

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged C-Bug An unexpected or incorrect behavior and removed C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Dec 7, 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-Bug An unexpected or incorrect behavior M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants