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

Rename init_component & friends #15454

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

hooded-shrimp
Copy link
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.

Copy link
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
Member

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

@alice-i-cecile alice-i-cecile added the C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide label Sep 26, 2024
Copy link
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

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

All the breaking changes should be recorded now.

@13ros27
Copy link
Contributor

13ros27 commented Sep 26, 2024

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

@hooded-shrimp
Copy link
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

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
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
26 checks passed
@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-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Usability A targeted quality-of-life change that makes Bevy easier to use 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