Skip to content

Simplify bevy_reflect Features #19123

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bushrat011899
Copy link
Contributor

Objective

Now that bevy_platform::cfg is merged, we can start tidying up features. This PR starts with bevy_reflect.

Solution

  • Removed critical-section feature (it was just a re-export of bevy_platform anyway)
  • Removed std and web features, relying on bevy_platform::cfg to check for availability.
  • Made smol_str implicit feature explicit.
  • Refactored various parts of bevy_reflect to use the new cfg syntax where appropriate.

Testing

  • CI

Notes

  • Certain attribute-style feature gates can't easily be replaced with the newer macro_rules! style (e.g., enum variants, struct fields). This is blocked on rust/#54727. See macro_rules_attribute for the current state-of-the-art in stable Rust.
  • This PR isn't dependent on any others, but bevy_reflect: Split up the std module #18939 should be merged first and I will resolve the merge conflicts.

@bushrat011899 bushrat011899 added C-Code-Quality A section of code that is hard to understand or change A-Reflection Runtime information about types D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 7, 2025
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.

Looks great!!

I'll be honest, though, I did only skim the std changes 😅. I think you're right that it will be a lot easier to review once #18939 is merged

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 C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants