Skip to content

Replace Handle<M: UiMaterial> component with UiMaterialHandle wrapper #15740

Merged
alice-i-cecile merged 3 commits intobevyengine:mainfrom
tim-blackbird:yeet-handles-ui-material
Oct 8, 2024
Merged

Replace Handle<M: UiMaterial> component with UiMaterialHandle wrapper #15740
alice-i-cecile merged 3 commits intobevyengine:mainfrom
tim-blackbird:yeet-handles-ui-material

Conversation

@tim-blackbird
Copy link
Contributor

@tim-blackbird tim-blackbird commented Oct 8, 2024

Objective

Solution

Wrap the handle in a new wrapper component: UiMaterialHandle
It's not possible to match the naming convention of MeshMaterial3d/2d here with the trait already being called UiMaterial

Should we consider renaming to Material3d/2dHandle and Mesh3d/2d to Mesh3d/2dHandle?

Testing

Tested the ui_material example

Migration Guide

Let's defer the migration guide to the required component port. I just want to yeet the Component impl on Handle in the meantime :)

@tim-blackbird tim-blackbird added A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Oct 8, 2024
Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

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

Naming is hard 🙃 . I don't want to rename the Material2d/3d stuff, but yeah this isn't ideal.

@tim-blackbird
Copy link
Contributor Author

Oops, this component should have some docs
Actually, let's defer that to the required component port as well

@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 Oct 8, 2024
@alice-i-cecile
Copy link
Member

alice-i-cecile commented Oct 8, 2024

Yeah, I'm fine with merging this as is. Consistency would be nice but I really don't see a good path for that...

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 8, 2024
Merged via the queue into bevyengine:main with commit 9aef71b Oct 8, 2024
@tim-blackbird tim-blackbird deleted the yeet-handles-ui-material branch October 8, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples 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.

Stop using Handle<T: UiMaterial> as a component

3 participants