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

Merged
merged 35 commits into from
Sep 27, 2024

Conversation

ecoskey
Copy link
Contributor

@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
Contributor Author

ecoskey commented Aug 28, 2024

oops

@IQuick143 IQuick143 added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Transform Translations, rotations and scales M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide M-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
Contributor 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
Contributor 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
Contributor 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.

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!

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers and removed S-Needs-SME Decision or review from an SME is required X-Controversial There is active debate or serious implications around merging this PR labels Sep 27, 2024
@alice-i-cecile
Copy link
Member

@ecoskey once CI is passing, please ping me. We're ready to proceed with this work :) See this message from Cart on Discord.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 27, 2024
Merged via the queue into bevyengine:main with commit b04947d Sep 27, 2024
26 checks passed
@ecoskey ecoskey deleted the migrate_transform branch September 27, 2024 20:18
robtfm pushed a commit to robtfm/bevy that referenced this pull request Oct 4, 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.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Tim <JustTheCoolDude@gmail.com>
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-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 M-Needs-Release-Note Work that should be called out in the blog due to impact S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants