bevy/crates
Nicola Papale 0294bb191d
Move AppTypeRegistry to bevy_ecs (#8901)
# Objective

- Use `AppTypeRegistry` on API defined in `bevy_ecs`
(https://github.com/bevyengine/bevy/pull/8895#discussion_r1234748418)

A lot of the API on `Reflect` depends on a registry. When it comes to
the ECS. We should use `AppTypeRegistry` in the general case.

This is however impossible in `bevy_ecs`, since `AppTypeRegistry` is
defined in `bevy_app`.

## Solution

- Move `AppTypeRegistry` resource definition from `bevy_app` to
`bevy_ecs`
- Still add the resource in the `App` plugin, since bevy_ecs itself
doesn't know of plugins

Note that `bevy_ecs` is a dependency of `bevy_app`, so nothing
revolutionary happens.

## Alternative

- Define the API as a trait in `bevy_app` over `bevy_ecs`. (though this
prevents us from using bevy_ecs internals)
- Do not rely on `AppTypeRegistry` for the API in question, requring
users to extract themselves the resource and pass it to the API methods.

---

## Changelog

- Moved `AppTypeRegistry` resource definition from `bevy_app` to
`bevy_ecs`

## Migration Guide

- If you were **not** using a `prelude::*` to import `AppTypeRegistry`,
you should update your imports:

```diff
- use bevy::app::AppTypeRegistry;
+ use bevy::ecs::reflect::AppTypeRegistry
```
2023-06-21 17:25:01 +00:00
..
bevy_a11y Require #[derive(Event)] on all Events (#7086) 2023-06-06 14:44:32 +00:00
bevy_animation Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_app Move AppTypeRegistry to bevy_ecs (#8901) 2023-06-21 17:25:01 +00:00
bevy_asset Move AppTypeRegistry to bevy_ecs (#8901) 2023-06-21 17:25:01 +00:00
bevy_audio reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_core Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_core_pipeline Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_derive bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_diagnostic Initialize DiagnosticStore on register_diagnostic if it does not exist (#8819) 2023-06-12 19:40:09 +00:00
bevy_dylib Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dynamic_plugin Remove stray boilerplate line in bevy_dynamic_plugin/Cargo.toml (#8830) 2023-06-12 19:10:48 +00:00
bevy_ecs Move AppTypeRegistry to bevy_ecs (#8901) 2023-06-21 17:25:01 +00:00
bevy_ecs_compile_fail_tests Resolve clippy issues for rust 1.70.0 (#8738) 2023-06-01 21:05:05 +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 Instanced line rendering for gizmos based on bevy_polyline (#8427) 2023-06-13 06:49:47 +00:00
bevy_gltf Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_hierarchy Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_input Add get_unclamped to Axis (#8871) 2023-06-19 23:06:11 +00:00
bevy_internal Instanced line rendering for gizmos based on bevy_polyline (#8427) 2023-06-13 06:49:47 +00:00
bevy_log log to stderr instead of stdout (#8886) 2023-06-19 23:36:02 +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 integer equivalents for Rect (#7984) 2023-06-12 19:10:48 +00:00
bevy_mikktspace update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_pbr Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_ptr Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_reflect Reflect UUID (#8905) 2023-06-21 17:24:32 +00:00
bevy_reflect_compile_fail_tests reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_render Providing a better example for Mesh-building in docs. (#8885) 2023-06-21 14:32:21 +00:00
bevy_scene Move AppTypeRegistry to bevy_ecs (#8901) 2023-06-21 17:25:01 +00:00
bevy_sprite Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_tasks remove some use of once_cell that can be replace with new std (#8739) 2023-06-01 21:55:18 +00:00
bevy_text Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +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 Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_ui Remove "bevy_text" feature attributes on imports used by non-text systems (#8907) 2023-06-21 17:24:52 +00:00
bevy_utils Bump hashbrown to 0.14 (#8904) 2023-06-21 13:04:44 +00:00
bevy_window Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_winit Fix windows not being centered properly when system interface is scaled (#8903) 2023-06-21 14:00:35 +00:00