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

Migrate bevy_transform to required components #14964

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

Conversation

ecoskey
Copy link

@ecoskey ecoskey commented Aug 28, 2024

The first step in the migration to required components! This PR removes GlobalTransform from all user-facing code, since it's now added automatically wherever Transform is used.

Testing

  • None of the examples I tested were broken, and I assume breaking transforms in any way would be visible everywhere

Changelog

  • Make Transform require GlobalTransform
    - Remove GlobalTransform from all engine bundles
  • Remove in-engine insertions of GlobalTransform and TransformBundle
  • Deprecate TransformBundle
  • update docs to reflect changes

Migration Guide

Replace all insertions of GlobalTransform and/or TransformBundle with Transform alone.

@JMS55
Copy link
Contributor

JMS55 commented Aug 28, 2024

Missed MaterialMeshletMeshBundle

@ecoskey
Copy link
Author

ecoskey commented Aug 28, 2024

oops

@IQuick143 IQuick143 added A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use A-Transform Translations, rotations and scales C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Needs-Release-Note Work that should be called out in the blog due to impact S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 28, 2024
@alice-i-cecile alice-i-cecile added the X-Controversial There is active debate or serious implications around merging this PR label Aug 29, 2024
@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Aug 29, 2024
@alice-i-cecile
Copy link
Member

I'm in favor of this. The opposite direction (GlobalTransform -> Transform) is much more intrusive and interferes with our plans to split apart Transform (#1275), but I think that this is nearly universally desirable.

Copy link
Member

@TrialDragon TrialDragon left a comment

Choose a reason for hiding this comment

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

The file /errors/B0004.md contains rust doc which uses Transform bundles and should be updated to use this change. (It's why CI is failing). Otherwise, looks good.

@TrialDragon TrialDragon added the S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged label Aug 29, 2024
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
@ecoskey
Copy link
Author

ecoskey commented Aug 29, 2024

The file /errors/B0004.md contains rust doc which uses Transform bundles and should be updated to use this change. (It's why CI is failing). Otherwise, looks good.

It seems [the guidance to fix] this error would be obsolete or inconsistent with the required components workflow. Should we block this PR on updating things like this or leave that to a later documentation pass?

@TrialDragon
Copy link
Member

It seems [the guidance to fix] this error would be obsolete or inconsistent with the required components workflow. Should we block this PR on updating things like this or leave that to a later documentation pass?

I'm not entirely sure it would be? I don't think required components add components to the parent entities, do they? Either way, this can be a follow-up if it is actually redundant in a post required components world.

(Also, the bundle docs seem to be having an issue with GlobalTransform no longer being in scope).

@ecoskey
Copy link
Author

ecoskey commented Aug 30, 2024

I don't think I expressed that clearly lol. What I meant was that we're going to need to update a lot of docs anyway for the new workflow, so I was wondering if it might make more sense to do a later pass rather than make a lot of changes to that page just because it referenced TransformBundle. But doctests need to pass, so I can fix it in the morning :)

@ecoskey
Copy link
Author

ecoskey commented Sep 2, 2024

Fixed the docs. They're (specifically errors/B0004.md) in a bit of a weird half-way state since we're intending to nuke SpatialBundle also, but they do accurately reflect the state of things in between PRs.

@ecoskey
Copy link
Author

ecoskey commented Sep 5, 2024

CI should be fixed, I was a little bit dumb and had GlobalTransform require GlobalTransform while doing some git shenanigans

Copy link
Contributor

github-actions bot commented Sep 5, 2024

Your PR increases Bevy Minimum Supported Rust Version. Please update the rust-version field in the root Cargo.toml file.

Copy link
Member

@TrialDragon TrialDragon left a comment

Choose a reason for hiding this comment

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

This LGTM, now that the CI is passing. I'm happy to see the nicer code this is already producing compared to bundles.

@TrialDragon TrialDragon added D-Straightforward Simple bug fixes and API improvements, docs, test and examples and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Sep 6, 2024
@alice-i-cecile alice-i-cecile added S-Needs-SME Decision or review from an SME is required and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 8, 2024
@alice-i-cecile
Copy link
Member

This LGTM, but I'm not going to merge until we have consensus from @cart :) Thanks for tackling this!

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-Transform Translations, rotations and scales C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Needs-Release-Note Work that should be called out in the blog due to impact C-Usability A simple quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-SME Decision or review from an SME is required X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants