-
-
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
bevy_reflect: implement Reflect for SmolStr #8771
Conversation
Prompted by winit's update bevyengine#8745.
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.
Looking good! Just a few comments.
Co-authored-by: Gino Valente <[email protected]>
This is a good idea, and the use of a feature flag is wise. Generally looks good, although I agree with the nits raised :) |
Co-authored-by: Gino Valente <[email protected]>
Co-authored-by: Gino Valente <[email protected]>
Co-authored-by: Gino Valente <[email protected]>
…n bevy_input and needs Refrlect derives.
We can revisit that when need be.
I thought too, but as current implementation of #8745, I changed the exposed character key to contain a SmolStr, effectively adding a dependency to the bevy_input. So I aggregated the features within bevy rather than fragmenting too much the features: 012bd90. (Now that I think about it, maybe we shouldn't add this into the bevy feature just yet, but include it in the winit PR?) We could also add more granular features but I think that's not the goal of this PR. I'm setting this out of draft mode. |
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.
Now that I think about it, maybe we shouldn't add this into the bevy feature just yet, but include it in the winit PR?
Yeah the changes are small enough that you probably could. Approving this PR anyways in case it makes more sense to merge beforehand.
We could also add more granular features but I think that's not the goal of this PR.
Yeah I think it would be good to have a feature for any bevy-crate dependency (i.e. a bevy_math
feature to add glam
, etc.). But yeah we can focus on that another time.
This is useful in its own right, and much easier to review like this than as part of the mega upgrade PR. Merging now. |
Objective
To upgrade winit's dependency, it's useful to reuse SmolStr, which replaces/improves the too restrictive Key letter enums.
As Input is a resource it should implement Reflect through all its fields.
Solution
Add smol_str to bevy_reflect supported types, behind a feature flag.
This PR blocks winit's upgrade PR: #8745.
Current state