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

Make bevy_reflect feature of bevy_math non-default #16938

Merged
merged 2 commits into from
Dec 24, 2024

Conversation

mweatherley
Copy link
Contributor

Objective

bevy_reflect is a big part of bevy_math's dependency footprint, and is often not useful when using bevy_math standalone (as I often do). The goal with this PR is to avoid pulling in those dependencies by default without compromising the usability of bevy_math types within Bevy proper.

Solution

bevy_reflect has been removed from default features of bevy_math. However, the feature is enabled by bevy_internal, so that bevy_reflect is enabled when bevy_math is used through bevy.

Philosophically, if there were a feature flag toggling reflection on bevy globally, then whether bevy_math enabled bevy_reflect itself would depend on that, but that doesn't exist for the time being.

Testing

It compiles :)

Migration Guide

bevy_reflect has been made a non-default feature of bevy_math. (It is still enabled when bevy_math is used through bevy.) You may need to enable this feature if you are using bevy_math on its own and desire for the types it exports to implement Reflect and other reflection traits.

@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types A-Math Fundamental domain-agnostic mathematical operations D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 22, 2024
@Jondolf Jondolf 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 22, 2024
auto-merge was automatically disabled December 22, 2024 23:18

Head branch was pushed to by a user without write access

@alice-i-cecile alice-i-cecile added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Dec 24, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 24, 2024
Merged via the queue into bevyengine:main with commit 35e0b5b Dec 24, 2024
33 checks passed
@mweatherley mweatherley deleted the no-default-reflect branch December 24, 2024 12:19
pcwalton pushed a commit to pcwalton/bevy that referenced this pull request Dec 25, 2024
)

# Objective

bevy_reflect is a big part of bevy_math's dependency footprint, and is
often not useful when using bevy_math standalone (as I often do). The
goal with this PR is to avoid pulling in those dependencies by default
without compromising the usability of bevy_math types within Bevy
proper.

## Solution

`bevy_reflect` has been removed from default features of `bevy_math`.
However, the feature is enabled by `bevy_internal`, so that
`bevy_reflect` is enabled when `bevy_math` is used through `bevy`.

Philosophically, if there were a feature flag toggling reflection on
`bevy` globally, then whether `bevy_math` enabled `bevy_reflect` itself
would depend on that, but that doesn't exist for the time being.

## Testing

It compiles :)

## Migration Guide

`bevy_reflect` has been made a non-default feature of `bevy_math`. (It
is still enabled when `bevy_math` is used through `bevy`.) You may need
to enable this feature if you are using `bevy_math` on its own and
desire for the types it exports to implement `Reflect` and other
reflection traits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations A-Reflection Runtime information about types C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide 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.

4 participants