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

Reflection Rewrite #29

Merged
merged 1 commit into from
Apr 16, 2023
Merged

Reflection Rewrite #29

merged 1 commit into from
Apr 16, 2023

Conversation

MrGVSV
Copy link
Owner

@MrGVSV MrGVSV commented Apr 16, 2023

What is this?

This is a rewrite of #18, which itself was a rewrite of the entire crate.

Why?

There are a number of reasons this was done:

  1. To remove the typetag dependency (which came with some drawbacks along with its advantages)
  2. To align with Bevy's (and the community's) direction of using reflection
  3. To just improve the crate overall (it was my first Rust project and had lots of tech debt)

What changed?

This being a complete rewrite, pretty much everything changed.

Prototype is pretty similar, but ProtoComponent received a complete overhaul (it's been replaced with the better-named Schematic trait as suggested by @B-Reif a long time ago).

I won't go into too many details here like in the last PR since most of the content is covered in the new examples. However, I will go over some of the highlights:

  • typetag has been replaced with bevy_reflect
    • This means types will need to be registered, but I think that's a fair tradeoff (and is the direction Bevy and the community are headed anyways)
  • Prototypes are now regular assets
    • This means we get hot-reloading for free
  • Support for child prototypes
    • This includes children defined by path to another prototype or inlined children (i.e. nested prototypes)
  • Drastically improved derive macro
    • Completely configure the serialized format of your schematic
    • Reference other assets to be loaded
    • Reference entities within the prototype tree
  • Added a new backend crate for users to create their own prototypes
  • Improved caching and dependency handling
  • No more trait object restrictions

"I liked using typetag!"

Not to worry! For those who prefer to use the old typetag system, then feel free to continue using it! I've relocated that code to its own crate called bevy_proto_typetag.

For users who want to continue supporting the typetag version, I will still accept PRs and probably bump Bevy versions here and there. However, my focus will be on this crate.

@MrGVSV MrGVSV self-assigned this Apr 16, 2023
@MrGVSV
Copy link
Owner Author

MrGVSV commented Apr 16, 2023

If anyone sees this, feel free to leave a review! I'm planning on releasing either today or tomorrow so I probably won't change anything for this version, but I'll keep comments in mind for the next one!

@MrGVSV MrGVSV merged commit f147228 into main Apr 16, 2023
@MrGVSV MrGVSV deleted the reflection-rewrite branch April 16, 2023 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant