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:
To remove the typetag dependency (which came with some drawbacks along with its advantages)
To align with Bevy's (and the community's) direction of using reflection
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.
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!
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:
typetag
dependency (which came with some drawbacks along with its advantages)What changed?
This being a complete rewrite, pretty much everything changed.
Prototype
is pretty similar, butProtoComponent
received a complete overhaul (it's been replaced with the better-namedSchematic
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 withbevy_reflect
"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 calledbevy_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.