bevy/crates/bevy_reflect/src
radiish 6b26a41a9d reflect: treat proxy types correctly when serializing (#12024)
# Objective

- Fixes #12001.
- Note this PR doesn't change any feature flags, however flaky the issue
revealed they are.

## Solution

- Use `FromReflect` to convert proxy types to concrete ones in
`ReflectSerialize::get_serializable`.
- Use `get_represented_type_info() -> type_id()` to get the correct type
id to interact with the registry in
`bevy_reflect::serde::ser::get_serializable`.

---

## Changelog

- Registering `ReflectSerialize` now imposes additional `FromReflect`
and `TypePath` bounds.

## Migration Guide

- If `ReflectSerialize` is registered on a type, but `TypePath` or
`FromReflect` implementations are omitted (perhaps by
`#[reflect(type_path = false)` or `#[reflect(from_reflect = false)]`),
the traits must now be implemented.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
2024-02-27 17:12:51 +01:00
..
enums Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
impls Move EntityHash related types into bevy_ecs (#11498) 2024-02-12 15:02:24 +00:00
path Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
serde reflect: treat proxy types correctly when serializing (#12024) 2024-02-27 17:12:51 +01:00
array.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
fields.rs reflect: TypePath part 2 (#8768) 2023-10-09 19:33:03 +00:00
from_reflect.rs reflect: TypePath part 2 (#8768) 2023-10-09 19:33:03 +00:00
lib.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
list.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
map.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
reflect.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
std_traits.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
struct_trait.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
tuple_struct.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
tuple.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
type_info.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
type_path.rs Replace or document ignored doctests (#11040) 2024-01-01 16:50:56 +00:00
type_registry.rs reflect: treat proxy types correctly when serializing (#12024) 2024-02-27 17:12:51 +01:00
utility.rs Hash stability guarantees (#11690) 2024-02-05 17:05:15 +00:00