rfcs
rfcs copied to clipboard
bevy_reflect: Unique `Reflect`
- create a new trait:
PartialReflect -
Reflect: PartialReflect - All methods on
Reflectthat does not depend on the uniqueness of the underlying type are moved toPartialReflect - Most things should now accept a
dyn PartialReflectrather thandyn Reflect. - It is possible to convert a
PartialReflectinto aReflectusing ainto_fullmethod. -
FromReflectbecomesFromPartialReflect.
Unresolved questions
- [X]
CanonReflectname? ⇒ Went withReflectandPartialReflect - [X]
CanonReflectorReflectProxy? Remove all underlying-dependent methods fromReflectand adding them to a new trait, or keep the underlying-dependent methods but moved all the non-dependent methods to a new trait. Which one to go with? ⇒ Went with a bit of both. - [X] Implementation (partial: https://github.com/bevyengine/bevy/pull/7207)
- [ ] Consider making more things
Reflect. - [X] Is a
TypeRegistryentry forFromPartialReflectnecessary? (no, as per partial implementation)
palliate
@nicopap could you clarify this by using a simpler word than “palliate”?
Next revision:
-
CanonReflect,Reflect⇒Reflect,PartialReflect - add
into_canontoPartialReflect - Remove
FromReflectchange (though it will be renamedFromPartialReflect)
Nice! Just wanted to note that another advantage of using PartialReflect is that it will be possible to optimize the serde format by not serializing default values.
This will be very useful for scenes and networking