-
-
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
Add FromReflect where Reflect is used #8776
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
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.
Thanks for doing this!
One thing I think needs to be added are ReflectFromReflect
registrations for all of these types. This is added the same way as ReflectComponent
and other type data:
#[derive(Reflect, FromReflect)]
#[reflect(FromReflect)]
struct MyType;
Now also added the ReflectFromReflect |
Now it seems to error, unclear why tho. |
Is this normal?
|
Ok, should be fixed now. |
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.
LGTM! Glad to see FromReflect
in more places 😄
How do we know that these are all the needed ones? A couple of ones also could not derive FromReflect, anything to do with those? |
Hm, I'm not sure. We should get a couple more reviews to make sure we're not being overzealous in certain places or possibly even breaking/missing something. |
Also, I should make it clear that this PR would be a temporary solution until #6056 is merged (which, honestly, could come before or after 0.11). |
Sure, all I need right now is that some components are not deriving FromReflect, not necessarily ReflectFromReflect, because it's blocking something I am writing. If that comes first I can still continue either way. |
# Objective Discovered that PointLight did not implement FromReflect. Adding FromReflect where Reflect is used. I overreached and applied this rule everywhere there was a Reflect without a FromReflect, except from where the compiler wouldn't allow me. Based from question: bevyengine#8774 ## Solution - Adding FromReflect where Reflect was already derived ## Notes First PR I do in this ecosystem, so not sure if this is the usual approach, that is, to touch many files at once. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Objective
Discovered that PointLight did not implement FromReflect. Adding FromReflect where Reflect is used. I overreached and applied this rule everywhere there was a Reflect without a FromReflect, except from where the compiler wouldn't allow me.
Based from question: #8774
Solution
Notes
First PR I do in this ecosystem, so not sure if this is the usual approach, that is, to touch many files at once.