bevy/crates
Nathan Stocks faeccd7a09 Reflection cleanup (#1536)
This is an effort to provide the correct `#[reflect_value(...)]` attributes where they are needed.  

Supersedes #1533 and resolves #1528.

---

I am working under the following assumptions (thanks to @bjorn3 and @Davier for advice here):

- Any `enum` that derives `Reflect` and one or more of { `Serialize`, `Deserialize`, `PartialEq`, `Hash` } needs a `#[reflect_value(...)]` attribute containing the same subset of { `Serialize`, `Deserialize`, `PartialEq`, `Hash` } that is present on the derive.
- Same as above for `struct` and `#[reflect(...)]`, respectively.
- If a `struct` is used as a component, it should also have `#[reflect(Component)]`
- All reflected types should be registered in their plugins

I treated the following as components (added `#[reflect(Component)]` if necessary):
- `bevy_render`
  - `struct RenderLayers`
- `bevy_transform`
  - `struct GlobalTransform`
  - `struct Parent`
  - `struct Transform`
- `bevy_ui`
  - `struct Style`

Not treated as components:
- `bevy_math`
  - `struct Size<T>`
  - `struct Rect<T>`
  - Note: The updates for `Size<T>` and `Rect<T>` in `bevy::math::geometry` required using @Davier's suggestion to add `+ PartialEq` to the trait bound. I then registered the specific types used over in `bevy_ui` such as `Size<Val>`, etc. in `bevy_ui`'s plugin, since `bevy::math` does not contain a plugin.
- `bevy_render`
  - `struct Color`
  - `struct PipelineSpecialization`
  - `struct ShaderSpecialization`
  - `enum PrimitiveTopology`
  - `enum IndexFormat`

Not Addressed:
- I am not searching for components in Bevy that are _not_ reflected. So if there are components that are not reflected that should be reflected, that will need to be figured out in another PR.
- I only added `#[reflect(...)]` or `#[reflect_value(...)]` entries for the set of four traits { `Serialize`, `Deserialize`, `PartialEq`, `Hash` } _if they were derived via `#[derive(...)]`_. I did not look for manual trait implementations of the same set of four, nor did I consider any traits outside the four.  Are those other possibilities something that needs to be looked into?
2021-03-09 23:39:41 +00:00
..
bevy_app Add EventWriter (#1575) 2021-03-07 20:42:04 +00:00
bevy_asset Add EventWriter (#1575) 2021-03-07 20:42:04 +00:00
bevy_audio Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_core Reflection cleanup (#1536) 2021-03-09 23:39:41 +00:00
bevy_derive Modify Derive to allow unit structs for RenderResources. (#1089) 2020-12-23 17:21:10 -06:00
bevy_diagnostic ♻️ Timer refactor to duration. Add Stopwatch struct. (#1151) 2021-03-05 19:59:14 +00:00
bevy_dylib release 0.4.0 (#1093) 2020-12-19 13:28:00 -06:00
bevy_dynamic_plugin update libloading (#1543) 2021-03-03 03:11:12 +00:00
bevy_ecs Many-to-many system labels (#1576) 2021-03-09 23:08:34 +00:00
bevy_gilrs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_gltf Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_input Add EventWriter (#1575) 2021-03-07 20:42:04 +00:00
bevy_internal Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_log Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_math Reflection cleanup (#1536) 2021-03-09 23:39:41 +00:00
bevy_pbr Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_reflect Reflection cleanup (#1536) 2021-03-09 23:39:41 +00:00
bevy_render Reflection cleanup (#1536) 2021-03-09 23:39:41 +00:00
bevy_scene Add EventWriter (#1575) 2021-03-07 20:42:04 +00:00
bevy_sprite Reflection cleanup (#1536) 2021-03-09 23:39:41 +00:00
bevy_tasks Xtask CI (#1387) 2021-02-22 08:42:19 +00:00
bevy_text Update glam to 0.13.0. (#1550) 2021-03-06 19:39:16 +00:00
bevy_transform Reflection cleanup (#1536) 2021-03-09 23:39:41 +00:00
bevy_ui Reflection cleanup (#1536) 2021-03-09 23:39:41 +00:00
bevy_utils Update ahash requirement from 0.6.1 to 0.7.0 (#1370) 2021-02-01 13:29:54 -08:00
bevy_wgpu Add EventWriter (#1575) 2021-03-07 20:42:04 +00:00
bevy_window Add EventWriter (#1575) 2021-03-07 20:42:04 +00:00
bevy_winit Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00