-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Use TypeIdMap whenever possible #11684
Use TypeIdMap whenever possible #11684
Conversation
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? |
Yeah, we should note the change. Non-blocking, but I think we should move this into bevy_utils for now: it definitely doesn't belong in bevy_ecs and moving it out might help us see other more natural groupings rather than a catch-all utility crate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very happy to see this moved into bevy_util
. Nice work.
Added a migration guide and resolved merge conflicts. Attempting merge, fingers crossed I formatted the import statement correctly 😅 |
Head branch was pushed to by a user without write access
Needs to be re-added to merge queue; I've just moved the corresponding test over to |
Head branch was pushed to by a user without write access
…and fixed the doc link. Sorry. |
No worries, this is why we have CI :) |
Use `TypeIdMap<T>` instead of `HashMap<TypeId, T>` - ~~`TypeIdMap` was in `bevy_ecs`. I've kept it there because of bevyengine#11478~~ - ~~I haven't swapped `bevy_reflect` over because it doesn't depend on `bevy_ecs`, but I'd also be happy with moving `TypeIdMap` to `bevy_utils` and then adding a dependency to that~~ - ~~this is a slight change in the public API of `DrawFunctionsInternal`, does this need to go in the changelog?~~ ## Changelog - moved `TypeIdMap` to `bevy_utils` - changed `DrawFunctionsInternal::indices` to `TypeIdMap` ## Migration Guide - `TypeIdMap` now lives in `bevy_utils` - `DrawFunctionsInternal::indices` now uses a `TypeIdMap`. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Use
TypeIdMap<T>
instead ofHashMap<TypeId, T>
TypeIdMap
was inbevy_ecs
. I've kept it there because of Remove or shrink bevy_utils #11478I haven't swappedbevy_reflect
over because it doesn't depend onbevy_ecs
, but I'd also be happy with movingTypeIdMap
tobevy_utils
and then adding a dependency to thatthis is a slight change in the public API ofDrawFunctionsInternal
, does this need to go in the changelog?Changelog
TypeIdMap
tobevy_utils
DrawFunctionsInternal::indices
toTypeIdMap
Migration Guide
TypeIdMap
now lives inbevy_utils
DrawFunctionsInternal::indices
now uses aTypeIdMap
.