bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Move `EntityHash` related types into `bevy_ecs`

Open doonv opened this issue 1 year ago • 1 comments

Objective

Reduce the size of bevy_utils (https://github.com/bevyengine/bevy/issues/11478)

Solution

Move EntityHash related types into bevy_ecs. This also allows us access to Entity, which means we no longer need EntityHashMap's first generic argument.


Changelog

  • Moved bevy::utils::{EntityHash, EntityHasher, EntityHashMap, EntityHashSet} into bevy::ecs::entity::hash .
  • Removed EntityHashMap's first generic argument. It is now hardcoded to always be Entity.

Migration Guide

  • Uses of bevy::utils::{EntityHash, EntityHasher, EntityHashMap, EntityHashSet} now have to be imported from bevy::ecs::entity::hash.
  • Uses of EntityHashMap no longer have to specify the first generic parameter. It is now hardcoded to always be Entity.

doonv avatar Jan 23 '24 17:01 doonv

The migration guide could be changed to mention what needs to be adapter for the new changes, rather than the new changes themself. For example:

Migration guide

  • Uses of bevy::utils::{EntityHash, EntityHasher, EntityHashMap, EntityHashSet} now have to import them from bevy::ecs::entity::hash.
  • Uses of EntityHashMap no longer have to specify its first generic parameter. It is now hardcoded to always be Entity.

SkiFire13 avatar Feb 09 '24 15:02 SkiFire13

CI failure is real: looks like you forgot to feature flag imports.

alice-i-cecile avatar Feb 12 '24 03:02 alice-i-cecile

It doesn't look like my problem. If it is, what am I doing wrong?

doonv avatar Feb 12 '24 08:02 doonv