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

Clean up type registrations #12304

Closed
james7132 opened this issue Mar 4, 2024 · 2 comments · Fixed by #12314
Closed

Clean up type registrations #12304

james7132 opened this issue Mar 4, 2024 · 2 comments · Fixed by #12314
Labels
A-Reflection Runtime information about types C-Code-Quality A section of code that is hard to understand or change D-Trivial Nice and easy! A great choice to get started with Bevy
Milestone

Comments

@james7132
Copy link
Member

First party Bevy crates have accumulated a large number of type registrations as each type needed to be individually registered for it to work with scenes and reflection. With #4154 merged, we no longer need to manually register every type, just the top level ones that users are expecting to be registered (i.e. components and resources), as any any type dependencies will automatically be registered.

@james7132 james7132 added C-Code-Quality A section of code that is hard to understand or change A-Reflection Runtime information about types labels Mar 4, 2024
@james7132 james7132 added this to the 0.14 milestone Mar 4, 2024
@alice-i-cecile alice-i-cecile added the D-Trivial Nice and easy! A great choice to get started with Bevy label Mar 4, 2024
@alice-i-cecile
Copy link
Member

Do you think we should register whole Bundle types? That would certainly be a simple way to get most of these.

@MrGVSV
Copy link
Member

MrGVSV commented Mar 5, 2024

Do you think we should register whole Bundle types? That would certainly be a simple way to get most of these.

This would require deriving Reflect on the bundles. That's something I'm definitely not opposed to (I had to hack around that limitation a couple times before), but it might also be something we want to consider in terms of compile times and binary size.

But again, it'd be awesome if bundles were Reflect as well 😄

github-merge-queue bot pushed a commit that referenced this issue Mar 6, 2024
# Objective
Fix #12304. Remove unnecessary type registrations thanks to #4154.

## Solution
Conservatively remove type registrations. Keeping the top level
components, resources, and events, but dropping everything else that is
a type of a member of those types.
spectria-limina pushed a commit to spectria-limina/bevy that referenced this issue Mar 9, 2024
# Objective
Fix bevyengine#12304. Remove unnecessary type registrations thanks to bevyengine#4154.

## Solution
Conservatively remove type registrations. Keeping the top level
components, resources, and events, but dropping everything else that is
a type of a member of those types.
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-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants