bevy/crates
JoJoJet 5472ea4a14
Improve encapsulation for commands and add docs (#8725)
# Objective

Several of our built-in `Command` types are too public:
- `GetOrSpawn` is public, even though it only makes sense to call it
from within `Commands::get_or_spawn`.
- `Remove` and `RemoveResource` contain public `PhantomData` marker
fields.

## Solution

Remove `GetOrSpawn` and use an anonymous command. Make the marker fields
private.

---

## Migration Guide

The `Command` types `Remove` and `RemoveResource` may no longer be
constructed manually.

```rust
// Before:
commands.add(Remove::<T> {
    entity: id,
    phantom: PhantomData,
});

// After:
commands.add(Remove::<T>::new(id));

// Before:
commands.add(RemoveResource::<T> { phantom: PhantomData });

// After:
commands.add(RemoveResource::<T>::new());
```

The command type `GetOrSpawn` has been removed. It was not possible to
use this type outside of `bevy_ecs`.
2023-05-31 16:45:46 +00:00
..
bevy_a11y Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_animation Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_app fix warning: variable does not need to be mutable (#8688) 2023-05-27 20:50:40 +00:00
bevy_asset update ahash and hashbrown (#8623) 2023-05-23 02:17:07 +00:00
bevy_audio Ability to set a Global Volume (#7706) 2023-04-10 14:08:43 +00:00
bevy_core Add Reflect and FromReflect for AssetPath (#8531) 2023-05-08 19:19:19 +00:00
bevy_core_pipeline Apply codebase changes in preparation for StandardMaterial transmission (#8704) 2023-05-30 14:21:53 +00:00
bevy_derive bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_diagnostic Update sysinfo requirement from 0.28.1 to 0.29.0 (#8650) 2023-05-22 18:11:33 +00:00
bevy_dylib Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dynamic_plugin Update libloading requirement from 0.7 to 0.8 (#8649) 2023-05-22 20:04:15 +00:00
bevy_ecs Improve encapsulation for commands and add docs (#8725) 2023-05-31 16:45:46 +00:00
bevy_ecs_compile_fail_tests Fix 1.69 CI clippy lints (#8450) 2023-04-20 16:51:21 +00:00
bevy_encase_derive update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_gilrs Add gamepad rumble support to bevy_input (#8398) 2023-04-24 15:28:53 +00:00
bevy_gizmos Webgpu support (#8336) 2023-05-04 22:07:57 +00:00
bevy_gltf Add support for custom glTF vertex attributes. (#5370) 2023-04-24 14:20:13 +00:00
bevy_hierarchy Expose sorting methods in Children (#8522) 2023-05-01 15:57:25 +00:00
bevy_input Fix typos in gamepad AxisSettings (#8542) 2023-05-04 23:23:45 +00:00
bevy_internal Add support for pnm textures (#8601) 2023-05-16 23:51:47 +00:00
bevy_log Hide naga info logs & Derive PartialEq on Timer and Stopwatch (#8664) 2023-05-24 15:16:15 +00:00
bevy_macro_utils update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_macros_compile_fail_tests bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_math Add CubicCurve::segment_count + iter_samples adjustment (#8711) 2023-05-31 14:57:37 +00:00
bevy_mikktspace update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_pbr Apply codebase changes in preparation for StandardMaterial transmission (#8704) 2023-05-30 14:21:53 +00:00
bevy_ptr Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_reflect bevy_reflect: Allow #[reflect(default)] on enum variant fields (#8514) 2023-05-29 15:29:29 +00:00
bevy_reflect_compile_fail_tests Fix 1.69 CI clippy lints (#8450) 2023-04-20 16:51:21 +00:00
bevy_render Apply codebase changes in preparation for StandardMaterial transmission (#8704) 2023-05-30 14:21:53 +00:00
bevy_scene Rename map_entities and map_specific_entities (#7570) 2023-05-01 21:40:19 +00:00
bevy_sprite Make Material2d pipeline systems public (#8642) 2023-05-23 02:16:39 +00:00
bevy_tasks Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_text Remove unused field in FontAtlasSet (#8639) 2023-05-19 18:55:12 +00:00
bevy_time Hide naga info logs & Derive PartialEq on Timer and Stopwatch (#8664) 2023-05-24 15:16:15 +00:00
bevy_transform Fix look_to variable naming (#8627) 2023-05-23 02:17:33 +00:00
bevy_ui Move bevy_ui accessibility systems to PostUpdate. (#8653) 2023-05-23 23:50:48 +00:00
bevy_utils Allow missing docs on wasm implementation of BoxedFuture (#8674) 2023-05-26 00:29:26 +00:00
bevy_window Correct RequestRedraw documentation (#8640) 2023-05-23 02:16:56 +00:00
bevy_winit Move bevy_ui accessibility systems to PostUpdate. (#8653) 2023-05-23 23:50:48 +00:00