Skip to content

Add constraints to AppLabel#23377

Open
Zeophlite wants to merge 6 commits intobevyengine:mainfrom
Zeophlite:app-label2
Open

Add constraints to AppLabel#23377
Zeophlite wants to merge 6 commits intobevyengine:mainfrom
Zeophlite:app-label2

Conversation

@Zeophlite
Copy link
Contributor

@Zeophlite Zeophlite commented Mar 16, 2026

Objective

  • While working on Extract extract to bevy_extract #22852 , I found AppLabel needed multiple additional bounds ( the largest being L: AppLabel + Default + Clone + Eq + Copy , in total 44 times) - this greatly reduces the readability of that PR
  • I tried adding this to AppLabel directly, but AppLabel is really just a label, and the versatility of labels means we can't just add all the above constraints

Solution

  • Use AppLabelBase as a derived label, that have a super trait AppLabel with the additional constraints.

Testing

  • CI

@Zeophlite Zeophlite added A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Mar 16, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Mar 16, 2026
@Zeophlite Zeophlite changed the title Refactor AppLabel Add constraints to AppLabel Mar 16, 2026
@Zeophlite Zeophlite marked this pull request as ready for review March 16, 2026 09:29
@Zeophlite Zeophlite added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Mar 16, 2026
@mockersf
Copy link
Member

I don't understand the need to add an intermediate AppLabelBase trait.

If we need it, we should find a better name for it

@Zeophlite
Copy link
Contributor Author

I don't understand the need to add an intermediate AppLabelBase trait.

The original AppLabel uses the bevy_ecs::define_label! macro to create that type. I'm unable to add Default to that (might be a skill issue)

If we need it, we should find a better name for it

Yeah I don't love it

@alice-i-cecile alice-i-cecile added X-Contentious There are nontrivial implications that should be thought through S-Needs-Help The author needs help finishing this PR. and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Help The author needs help finishing this PR. X-Contentious There are nontrivial implications that should be thought through

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

3 participants