Skip to content
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

Fix registering all reflection types that are components as reflection components #16800

Merged
merged 4 commits into from
Dec 16, 2024

Conversation

anlumo
Copy link
Contributor

@anlumo anlumo commented Dec 13, 2024

Objective

Fixes #16659

Solution

  • I just added all the #[reflect(Component)] attributes where necessary.

Testing

I wrote a small program that scans the bevy code for all structs and enums that derive Component and Reflect, but don't have the attribute #[reflect(Component)].

I don't know if this testing program should be part of the testing suite of bevy. It takes a bit of time to scan the whole codebase. In any case, I've published it here.

Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@BD103 BD103 added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events A-Reflection Runtime information about types S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Trivial Nice and easy! A great choice to get started with Bevy labels Dec 13, 2024
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.

That's a neat program! We'd love to do something similar for the Bevy linter if you’re ever interested in helping there :)

@MrGVSV MrGVSV added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 13, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Dec 15, 2024
@alice-i-cecile
Copy link
Member

Import merge conflict was a bit tricky; let's see if CI likes that.

@anlumo
Copy link
Contributor Author

anlumo commented Dec 16, 2024

My code scanner had a bug where it missed

#[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Debug))]

since it only scanned for top-level derives. I found only two instances of the problem this PR fixes, both in the gamepad code.

I also pushed the fix to my code scanner.

@alice-i-cecile
Copy link
Member

Thanks for cleaning this up <3 Merging.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 16, 2024
Merged via the queue into bevyengine:main with commit 56688b3 Dec 16, 2024
28 checks passed
@anlumo anlumo deleted the reflect-component branch December 17, 2024 13:51
ecoskey pushed a commit to ecoskey/bevy that referenced this pull request Jan 6, 2025
…n components (bevyengine#16800)

# Objective

Fixes bevyengine#16659

## Solution

- I just added all the `#[reflect(Component)]` attributes where
necessary.

## Testing

I wrote a small program that scans the bevy code for all structs and
enums that derive `Component` and `Reflect`, but don't have the
attribute `#[reflect(Component)]`.

I don't know if this testing program should be part of the testing suite
of bevy. It takes a bit of time to scan the whole codebase. In any case,
I've published it [here](https://github.com/anlumo/bevy-reflect-check).

---------

Co-authored-by: Alice Cecile <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events A-Reflection Runtime information about types C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The reflection of bevy_render::sync_world::TemporaryRenderEntity doesn't show up as a Component
4 participants