bevy/crates
James Liu dc40cd134f
Remove ComponentStorage and associated types (#12311)
# Objective
When doing a final pass for #3362, it appeared that `ComponentStorage`
as a trait, the two types implementing it, and the associated type on
`Component` aren't really necessary anymore. This likely was due to an
earlier constraint on the use of consts in traits, but that definitely
doesn't seem to be a problem in Rust 1.76.

## Solution
Remove them.

---

## Changelog
Changed: `Component::Storage` has been replaced with
`Component::STORAGE_TYPE` as a const.
Removed: `bevy::ecs::component::ComponentStorage` trait
Removed: `bevy::ecs::component::TableStorage` struct
Removed: `bevy::ecs::component::SparseSetStorage` struct

## Migration Guide
If you were manually implementing `Component` instead of using the
derive macro, replace the associated `Storage` associated type with the
`STORAGE_TYPE` const:

```rust
// in Bevy 0.13
impl Component for MyComponent {
    type Storage = TableStorage;
}
// in Bevy 0.14
impl Component for MyComponent {
    const STORAGE_TYPE: StorageType = StorageType::Table;
}
```

Component is no longer object safe. If you were relying on `&dyn
Component`, `Box<dyn Component>`, etc. please [file an issue
](https://github.com/bevyengine/bevy/issues) to get [this
change](https://github.com/bevyengine/bevy/pull/12311) reverted.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-03-05 15:54:52 +00:00
..
bevy_a11y Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_animation Replace bevy_log's tracing reexport with bevy_utils' (#12254) 2024-03-02 18:38:04 +00:00
bevy_app Use immutable key for HashMap and HashSet (#12086) 2024-02-26 16:27:40 +00:00
bevy_asset bevy_utils: Add BuildHasher parameter to bevy_utils::Entry type alias (#12308) 2024-03-05 02:45:05 +00:00
bevy_audio Fix duplicate dependencies on raw-window-handle (#12309) 2024-03-05 08:24:37 +00:00
bevy_color fix example lightmaps after color migration (#12265) 2024-03-03 21:36:11 +00:00
bevy_core Check cfg during CI and fix feature typos (#12103) 2024-02-25 15:19:27 +00:00
bevy_core_pipeline Replace bevy_log's tracing reexport with bevy_utils' (#12254) 2024-03-02 18:38:04 +00:00
bevy_derive Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_diagnostic Replace bevy_log's tracing reexport with bevy_utils' (#12254) 2024-03-02 18:38:04 +00:00
bevy_dylib Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_dynamic_plugin Document all members of bevy_dynamic_plugin (#12029) 2024-02-22 13:28:52 +00:00
bevy_ecs Remove ComponentStorage and associated types (#12311) 2024-03-05 15:54:52 +00:00
bevy_ecs_compile_fail_tests Remove APIs deprecated in 0.13 (#11974) 2024-02-19 19:04:47 +00:00
bevy_encase_derive Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_gilrs Replace bevy_log's tracing reexport with bevy_utils' (#12254) 2024-03-02 18:38:04 +00:00
bevy_gizmos Add basic light gizmos (#12228) 2024-03-03 18:50:46 +00:00
bevy_gltf Replace bevy_log's tracing reexport with bevy_utils' (#12254) 2024-03-02 18:38:04 +00:00
bevy_hierarchy Move commands module into bevy::ecs::world (#12234) 2024-03-02 23:13:45 +00:00
bevy_input Update Input to ButtonInput in a couple places at keyboard input docs (#12284) 2024-03-04 00:52:47 +00:00
bevy_internal Fix failures of typos and check-cfg (#12293) 2024-03-04 07:48:09 +00:00
bevy_log Add access to App within LogPlugin::update_subscriber (#12045) 2024-03-04 00:01:05 +00:00
bevy_macro_utils fix some typos (#12038) 2024-02-22 18:55:22 +00:00
bevy_macros_compile_fail_tests Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_math Support transforming bounding volumes (#11681) 2024-03-05 00:48:45 +00:00
bevy_mikktspace fix some typos (#12038) 2024-02-22 18:55:22 +00:00
bevy_pbr PBR: use attenuation instead of base_color for attenuation (#12266) 2024-03-02 22:20:44 +00:00
bevy_ptr Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_reflect bevy_utils: Add BuildHasher parameter to bevy_utils::Entry type alias (#12308) 2024-03-05 02:45:05 +00:00
bevy_reflect_compile_fail_tests bevy_reflect: Recursive registration (#5781) 2024-03-04 19:04:10 +00:00
bevy_render bevy_reflect: Recursive registration (#5781) 2024-03-04 19:04:10 +00:00
bevy_scene Move commands module into bevy::ecs::world (#12234) 2024-03-02 23:13:45 +00:00
bevy_sprite #[reflect(Default)] for Handle/Mesh2dHandle (#12264) 2024-03-04 04:18:02 +00:00
bevy_tasks remove repetitive code (#12270) 2024-03-03 07:58:22 +00:00
bevy_text Migrate from LegacyColor to bevy_color::Color (#12163) 2024-02-29 19:35:12 +00:00
bevy_time Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_transform Move commands module into bevy::ecs::world (#12234) 2024-03-02 23:13:45 +00:00
bevy_ui Fix #12255 Updating TargetCamera on multi camera scenes not allowing layout to be calculated (#12268) 2024-03-04 19:19:25 +00:00
bevy_utils bevy_utils: Add BuildHasher parameter to bevy_utils::Entry type alias (#12308) 2024-03-05 02:45:05 +00:00
bevy_window Fix fit_canvas_to_parent (#11278) 2024-03-03 14:33:30 +00:00
bevy_winit Fix winit control flow when re-focusing game (#12239) 2024-03-04 19:15:05 +00:00