Skip to content

Migrate bevy_transform to required components#14964

Merged
alice-i-cecile merged 35 commits intobevyengine:mainfrom
ecoskey:migrate_transform
Sep 27, 2024
Merged

Migrate bevy_transform to required components#14964
alice-i-cecile merged 35 commits intobevyengine:mainfrom
ecoskey:migrate_transform

Conversation

@ecoskey
Copy link
Copy Markdown
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
Copy Markdown
Contributor

JMS55 commented Aug 28, 2024

Missed MaterialMeshletMeshBundle

@ecoskey
Copy link
Copy Markdown
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-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide M-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-Needs-SME This type of work requires an SME to approve it. 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@alice-i-cecile alice-i-cecile added S-Waiting-on-SME This is currently waiting for an SME to resolve something controversial and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 8, 2024
@alice-i-cecile
Copy link
Copy Markdown
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-Waiting-on-SME This is currently waiting for an SME to resolve something controversial X-Needs-SME This type of work requires an SME to approve it. labels Sep 27, 2024
@alice-i-cecile
Copy link
Copy Markdown
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
@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>
@alice-i-cecile
Copy link
Copy Markdown
Member

Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1699 if you'd like to help out.

@alice-i-cecile alice-i-cecile removed the M-Release-Note Work that should be called out in the blog due to impact label Oct 20, 2024
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-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 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