bevy/crates/bevy_hierarchy/src
CatThingy 89cbc78d3d
Require #[derive(Event)] on all Events (#7086)
# Objective

Be consistent with `Resource`s and `Components` and have `Event` types
be more self-documenting.
Although not susceptible to accidentally using a function instead of a
value due to `Event`s only being initialized by their type, much of the
same reasoning for removing the blanket impl on `Resource` also applies
here.

* Not immediately obvious if a type is intended to be an event
* Prevent invisible conflicts if the same third-party or primitive types
are used as events
* Allows for further extensions (e.g. opt-in warning for missed events)

## Solution

Remove the blanket impl for the `Event` trait. Add a derive macro for
it.

---

## Changelog

- `Event` is no longer implemented for all applicable types. Add the
`#[derive(Event)]` macro for events.

## Migration Guide

* Add the `#[derive(Event)]` macro for events. Third-party types used as
events should be wrapped in a newtype.
2023-06-06 14:44:32 +00:00
..
components Expose sorting methods in Children (#8522) 2023-05-01 15:57:25 +00:00
child_builder.rs ChildBuilder docs improvement (#8371) 2023-04-22 20:43:13 +00:00
events.rs Require #[derive(Event)] on all Events (#7086) 2023-06-06 14:44:32 +00:00
hierarchy.rs Remove Children component when calling despawn_descendants (#8476) 2023-04-24 14:14:52 +00:00
lib.rs Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
query_extension.rs Replace WorldQueryGats trait with actual gats (#6319) 2022-11-03 16:33:05 +00:00
valid_parent_check_plugin.rs Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00