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

Construct Box<dyn Reflect> from world for ReflectComponent #7407

Merged
merged 2 commits into from
Mar 13, 2023

Conversation

SneakyBerry
Copy link
Contributor

Objective

  • For dynamic scene editing purposes need to create Component from defaults and insert it to entity.

Solution

  • Provide method from_world for ReflectComponent to create Box using FromWorld trait.

Changelog

Added:

  • Proxy method of FromWorld trait to ReflectComponent

@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types A-Scenes Serialized ECS data stored on the disk labels Jan 29, 2023
Copy link
Member

@MrGVSV MrGVSV left a comment

Choose a reason for hiding this comment

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

Nice and simple addition.

I know there was talk on Discord of possibly splitting up ReflectComponent into two separate types, but I think this is totally fine for now: it's not adding any new bounds or breaking any part of the existing API (we use FromWorld to construct the component internally anyways).

@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 27, 2023
@alice-i-cecile alice-i-cecile added the C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide label Mar 13, 2023
@github-actions
Copy link
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Could you add some context on what users should update when this change get released in a new version of Bevy?
It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Mar 13, 2023

This is breaking, as it adds a new field. Migration guide would be appreciated. I'd like to have a more tests and docs here, but that can be done later.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 13, 2023
Merged via the queue into bevyengine:main with commit 6bfc09f Mar 13, 2023
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
…e#7407)

Co-authored-by: SneakyBerry <kennedwyhokilled@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
…e#7407)

Co-authored-by: SneakyBerry <kennedwyhokilled@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types A-Scenes Serialized ECS data stored on the disk C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants