Skip to content

Move hashbrown and foldhash out of bevy_utils#17460

Merged
alice-i-cecile merged 7 commits intobevyengine:mainfrom
bushrat011899:HashingInPlatformSupport
Jan 23, 2025
Merged

Move hashbrown and foldhash out of bevy_utils#17460
alice-i-cecile merged 7 commits intobevyengine:mainfrom
bushrat011899:HashingInPlatformSupport

Conversation

@bushrat011899
Copy link
Copy Markdown
Contributor

@bushrat011899 bushrat011899 commented Jan 20, 2025

Objective

Solution

  • Moved hashbrown, foldhash, and related types out of bevy_utils and into bevy_platform_support
  • Refactored the above to match the layout of these types in std.
  • Updated crates as required.

Testing

  • CI

Migration Guide

  • The following items were moved out of bevy_utils and into bevy_platform_support::hash:
    • FixedState
    • DefaultHasher
    • RandomState
    • FixedHasher
    • Hashed
    • PassHash
    • PassHasher
    • NoOpHash
  • The following items were moved out of bevy_utils and into bevy_platform_support::collections:
    • HashMap
    • HashSet
  • bevy_utils::hashbrown has been removed. Instead, import from bevy_platform_support::collections or take a dependency on hashbrown directly.
  • bevy_utils::Entry has been removed. Instead, import from bevy_platform_support::collections::hash_map or bevy_platform_support::collections::hash_set as appropriate.
  • All of the above equally apply to bevy::utils and bevy::platform_support.

Notes

  • I left PreHashMap, PreHashMapExt, and TypeIdMap in bevy_utils as they might be candidates for micro-crating. They can always be moved into bevy_platform_support at a later date if desired.

@bushrat011899 bushrat011899 added C-Code-Quality A section of code that is hard to understand or change M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide A-Cross-Cutting Impacts the entire engine X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 20, 2025
@bushrat011899
Copy link
Copy Markdown
Contributor Author

Marking as X-Blessed for the same reasons outlined here.

@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Jan 21, 2025
@bushrat011899 bushrat011899 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 Jan 21, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 23, 2025
@bushrat011899
Copy link
Copy Markdown
Contributor Author

I'll get these conflicts fixed now...

@bushrat011899
Copy link
Copy Markdown
Contributor Author

Conflicts resolved @alice-i-cecile!

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 23, 2025
Merged via the queue into bevyengine:main with commit 9bc0ae3 Jan 23, 2025
mrchantey pushed a commit to mrchantey/bevy that referenced this pull request Feb 4, 2025
# Objective

- Contributes to bevyengine#16877

## Solution

- Moved `hashbrown`, `foldhash`, and related types out of `bevy_utils`
and into `bevy_platform_support`
- Refactored the above to match the layout of these types in `std`.
- Updated crates as required.

## Testing

- CI

---

## Migration Guide

- The following items were moved out of `bevy_utils` and into
`bevy_platform_support::hash`:
  - `FixedState`
  - `DefaultHasher`
  - `RandomState`
  - `FixedHasher`
  - `Hashed`
  - `PassHash`
  - `PassHasher`
  - `NoOpHash`
- The following items were moved out of `bevy_utils` and into
`bevy_platform_support::collections`:
  - `HashMap`
  - `HashSet`
- `bevy_utils::hashbrown` has been removed. Instead, import from
`bevy_platform_support::collections` _or_ take a dependency on
`hashbrown` directly.
- `bevy_utils::Entry` has been removed. Instead, import from
`bevy_platform_support::collections::hash_map` or
`bevy_platform_support::collections::hash_set` as appropriate.
- All of the above equally apply to `bevy::utils` and
`bevy::platform_support`.

## Notes

- I left `PreHashMap`, `PreHashMapExt`, and `TypeIdMap` in `bevy_utils`
as they might be candidates for micro-crating. They can always be moved
into `bevy_platform_support` at a later date if desired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Cross-Cutting Impacts the entire engine C-Code-Quality A section of code that is hard to understand or change 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.

4 participants