-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Add reflection for resources #5175
Conversation
Can you credit @Davier as a co-author in the PR description to make sure this gets into the release notes properly? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like in the previous PR, I'm very happy that this exists and content with the underlying code.
Only thing I think this needs is basic docs on ReflectResource
.
I won't block on this, but if you want to put more work into this PR:
- Docs on
ReflectResource
methods. - Consider enabling reflection for more resource types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Looks very useful. I have some docstring suggestions for the functions; feel free to modify them, especially if the doclinks don't work. They should, but sometimes doclinks are wonky.
Thanks for the tips. Updated the documentation. Please, take a look. |
Some thoughts for the future PRs:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one little nitpick, but otherwise LGTM!
One final round of doc nits. I'll merge this on Monday during my weekly round :) |
Co-authored-by: Alice Cecile <[email protected]>
Can this be included here for consistency with the added |
No strong feelings. Feel free to include it if you'd like; reflection is getting basically a full rewrite in this release anyways. If you do, note it in the migration guide. |
Okay, thanks, done! |
bors r+ |
# Objective We don't have reflection for resources. ## Solution Introduce reflection for resources. Continues #3580 (by @Davier), related to #3576. --- ## Changelog ### Added * Reflection on a resource type (by adding `ReflectResource`): ```rust #[derive(Reflect)] #[reflect(Resource)] struct MyResourse; ``` ### Changed * Rename `ReflectComponent::add_component` into `ReflectComponent::insert_component` for consistency. ## Migration Guide * Rename `ReflectComponent::add_component` into `ReflectComponent::insert_component`.
Forgot to push it :D |
# Objective We don't have reflection for resources. ## Solution Introduce reflection for resources. Continues bevyengine#3580 (by @Davier), related to bevyengine#3576. --- ## Changelog ### Added * Reflection on a resource type (by adding `ReflectResource`): ```rust #[derive(Reflect)] #[reflect(Resource)] struct MyResourse; ``` ### Changed * Rename `ReflectComponent::add_component` into `ReflectComponent::insert_component` for consistency. ## Migration Guide * Rename `ReflectComponent::add_component` into `ReflectComponent::insert_component`.
# Objective We don't have reflection for resources. ## Solution Introduce reflection for resources. Continues bevyengine#3580 (by @Davier), related to bevyengine#3576. --- ## Changelog ### Added * Reflection on a resource type (by adding `ReflectResource`): ```rust #[derive(Reflect)] #[reflect(Resource)] struct MyResourse; ``` ### Changed * Rename `ReflectComponent::add_component` into `ReflectComponent::insert_component` for consistency. ## Migration Guide * Rename `ReflectComponent::add_component` into `ReflectComponent::insert_component`.
# Objective We don't have reflection for resources. ## Solution Introduce reflection for resources. Continues bevyengine#3580 (by @Davier), related to bevyengine#3576. --- ## Changelog ### Added * Reflection on a resource type (by adding `ReflectResource`): ```rust #[derive(Reflect)] #[reflect(Resource)] struct MyResourse; ``` ### Changed * Rename `ReflectComponent::add_component` into `ReflectComponent::insert_component` for consistency. ## Migration Guide * Rename `ReflectComponent::add_component` into `ReflectComponent::insert_component`.
Objective
We don't have reflection for resources.
Solution
Introduce reflection for resources.
Continues #3580 (by @Davier), related to #3576.
Changelog
Added
ReflectResource
):