Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bevy_reflect: Rename UntypedReflectDeserializer to ReflectDeserializer #12721

Merged

Conversation

MrGVSV
Copy link
Member

@MrGVSV MrGVSV commented Mar 26, 2024

Objective

We have ReflectSerializer and TypedReflectSerializer. The former is the one users will most often use since the latter takes a bit more effort to deserialize.

However, our deserializers are named UntypedReflectDeserializer and TypedReflectDeserializer. There is no obvious indication that UntypedReflectDeserializer must be used with ReflectSerializer since the names don't quite match up.

Solution

Rename UntypedReflectDeserializer back to ReflectDeserializer (initially changed as part of #5723).

Also update the docs for both deserializers (as they were pretty out of date) and include doc examples.

I also updated the docs for the serializers, too, just so that everything is consistent.


Changelog

  • Renamed UntypedReflectDeserializer to ReflectDeserializer
  • Updated docs for ReflectDeserializer, TypedReflectDeserializer, ReflectSerializer, and TypedReflectSerializer

Migration Guide

UntypedReflectDeserializer has been renamed to ReflectDeserializer. Usages will need to be updated accordingly.

- let reflect_deserializer = UntypedReflectDeserializer::new(&registry);
+ let reflect_deserializer = ReflectDeserializer::new(&registry);

@MrGVSV MrGVSV added C-Docs An addition or correction to our documentation A-Reflection Runtime information about types C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide labels Mar 26, 2024
@MrGVSV MrGVSV force-pushed the mrgvsv/reflect/deserializer-rename branch from be746d2 to 4c22c87 Compare March 26, 2024 00:41
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much nicer naming :) The new docs are great too.

@MrGVSV MrGVSV force-pushed the mrgvsv/reflect/deserializer-rename branch from 4c22c87 to 86737de Compare March 26, 2024 19:25
Copy link
Contributor

@pablo-lua pablo-lua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much more clearer name to me, as can be strange naming this UntypedReflectDeserializer but not naming the Serializer UntypedReflectSerializer. This changes make much more sense.

@pablo-lua pablo-lua added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Mar 26, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 26, 2024
Merged via the queue into bevyengine:main with commit 0265436 Mar 26, 2024
28 checks passed
@MrGVSV MrGVSV deleted the mrgvsv/reflect/deserializer-rename branch March 26, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants