-
Couldn't load subscription status.
- Fork 52
feat: Add bevy-reflect feature #439
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
base: main
Are you sure you want to change the base?
Conversation
|
Hey @TeamDman, thanks for the PR! Happy to add support for |
|
Bevy 0.17 is out, will try and get this updated soon |
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.
Pull Request Overview
This PR adds bevy-reflect feature support to CompactString, enabling integration with Bevy's reflection system. The implementation follows the pattern used by other Bevy string types and includes comprehensive test coverage.
- Adds bevy-reflect feature flag and implementation using
impl_reflect_opaque!macro - Creates example demonstrating CompactString usage with Bevy ECS components
- Includes comprehensive test suite covering reflection functionality
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| compact_str/Cargo.toml | Adds bevy-reflect feature flag and bevy_reflect dependency |
| compact_str/src/features/mod.rs | Conditionally includes the new bevy_reflect module |
| compact_str/src/features/bevy_reflect.rs | Implements Reflect trait for CompactString with comprehensive tests |
| examples/bevy-reflect/Cargo.toml | Example project configuration with bevy dependencies |
| examples/bevy-reflect/src/main.rs | Example demonstrating CompactString with Bevy ECS components |
| Cargo.toml | Adds example to workspace members |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Exploring this for personal use and figured I'd upstream.
Potential caveat is that I'm targeting bevy 0.17.0-rc.1
Mainly copying
https://github.com/bevyengine/bevy/blob/8b36cca28c4ea00425e1414fd88c8b82297e2b96/crates/bevy_reflect/src/impls/smol_str.rs
haven't checked how it looks when paired with bevy world inspector plugin yet