bevyengine / bevyengine/bevy

Remove or shrink bevy_utils

Open
#11,478 44 comments 1 reaction 0 assignees View on GitHub
A-Utils C-Code-Quality D-Modest S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

`bevy_utils` is a collection of unrelated utilities for Bevy. Utility modules/classes/libraries are generally frowned upon in the programming community since they are most likely a sign of poor organization.

## What solution would you like?

Move `bevy_utils`'s contents into existing bevy crates or into separate crates.

### Long list of what to do with each item in `bevy_utils`

- [ ] `BoxedFuture` could probably be removed since async in traits were added in Rust 1.75
- [ ] all `HashMap` related stuff: no idea where to put that.
- [x] https://github.com/bevyengine/bevy/pull/11498
- [ ] `OnDrop` could be its own crate
- [ ] `tracing` related stuff: put in `bevy_log`
- [ ] `once` related stuff: I would put it in `bevy_log`, but this could cause some issues (see https://github.com/bevyengine/bevy/pull/11419)
- [ ] `get_short_name`: put in `bevy_reflect`
- [ ] `SyncCell`: use `std::sync::Exclusive` when stabilized (https://github.com/rust-lang/rust/issues/98407)
- [ ] `SyncUnsafeCell`: use `std::cell::SyncUnsafeCell` when stablized (https://github.com/rust-lang/rust/issues/95439)
- [x] `generate_composite_uuid`: Maybe contribute this to the `uuid` crate?
- [x] `label` module: Sounds like a `bevy_reflect` thing but isn't actually used anywhere there so idk
- [x] `Interned`: put in `bevy_ecs`
- [ ] `futures` module: only used in `bevy_render`, so put it there.
- [x] `FloatOrd`: could be its own crate
- [ ] `default`: Could be its own crate (The [`default` crate](https://crates.io/crates/default) already exists, so maybe we should use that)
- [ ] `CowArc`: Could be its own crate

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.