Skip to content

Rename init_component & friends#15454

Merged
alice-i-cecile merged 6 commits intobevyengine:mainfrom
hooded-shrimp:rename-init-component
Sep 26, 2024
Merged

Rename init_component & friends#15454
alice-i-cecile merged 6 commits intobevyengine:mainfrom
hooded-shrimp:rename-init-component

Conversation

@hooded-shrimp
Copy link
Copy Markdown
Contributor

@hooded-shrimp hooded-shrimp commented Sep 26, 2024

Objective

Migration Guide

  • World::init_component has been renamed to register_component.
  • World::init_component_with_descriptor has been renamed to register_component_with_descriptor.
  • World::init_bundle has been renamed to register_bundle.
  • Components::init_component has been renamed to register_component.
  • Components::init_component_with_descriptor has been renamed to register_component_with_descriptor.
  • Components::init_resource has been renamed to register_resource.
  • Components::init_non_send had been renamed to register_non_send.

@github-actions
Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 26, 2024
@alice-i-cecile
Copy link
Copy Markdown
Member

@MichalGniadek can I get your review here? Do you like the rename?

@alice-i-cecile alice-i-cecile added the M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Sep 26, 2024
@github-actions
Copy link
Copy Markdown
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Could you add some context on what users should update when this change get released in a new version of Bevy?
It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.

Copy link
Copy Markdown
Contributor

@MichalGniadek MichalGniadek left a comment

Choose a reason for hiding this comment

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

Looks good!

@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 and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 26, 2024
@alice-i-cecile
Copy link
Copy Markdown
Member

Thanks @hooded-shrimp :D This change looks good, but needs a simple Migration Guide still. Let me know if you'd like a hand writing one :)

@hooded-shrimp
Copy link
Copy Markdown
Contributor Author

All the breaking changes should be recorded now.

@13ros27
Copy link
Copy Markdown
Contributor

13ros27 commented Sep 26, 2024

This should probably also rename World::init_bundle to World::register_bundle?

@hooded-shrimp
Copy link
Copy Markdown
Contributor Author

This should probably also rename World::init_bundle to World::register_bundle?

I could do that.

World::init_bundle calls Bundles::init_info should that be renamed as well? There are also comments that might need to be updated to say "register" instead of "initialize".

@MichalGniadek
Copy link
Copy Markdown
Contributor

Searched through init_ in the repo and:

  • Components::init_component_inner could also be renamed as it's only used in the now renamed register_component and register_component_with_descriptor
  • Components::init_resource, Components::init_non_send could also could be renamed (not the World methods though as these insert the resources automatically and not just register them)

Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Lovely, thank you both so much.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 26, 2024
Merged via the queue into bevyengine:main with commit 35d1086 Sep 26, 2024
@hooded-shrimp hooded-shrimp deleted the rename-init-component branch September 26, 2024 23:05
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 C-Usability A targeted quality-of-life change that makes Bevy easier to use 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename init_component and init_component_with_desciptor

4 participants