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

Support for serde #174

Closed
TehPers opened this issue Aug 13, 2020 · 4 comments
Closed

Support for serde #174

TehPers opened this issue Aug 13, 2020 · 4 comments
Labels
C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@TehPers
Copy link
Contributor

TehPers commented Aug 13, 2020

While trying to make a keybinding config, I came across the issue that bevy_input::KeyCode doesn't implement Serialize or Deserialize and there is no feature to do so. I think it would be nice to have support for serde (behind a feature) for types which users of bevy may want to serialize, such as KeyCode and MouseButton.

@cart cart added C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy labels Aug 13, 2020
@cart
Copy link
Member

cart commented Aug 13, 2020

Yeah this makes sense to me!

@erlend-sh
Copy link

Keep in mind there’s also https://github.com/not-fl3/nanoserde and https://github.com/dtolnay/miniserde.

@cart
Copy link
Member

cart commented Aug 14, 2020

I think its worth giving the "minimal serde" implementations a fair shake, given how much they improved macroquad compiles. But I dont think we'll see similar clean compile time improvements without fully removing syn + quote dependencies from the tree. They run pretty deep in many rust crates, so this will likely be very hard. In general, while serde does have a compile time cost, it is the ecosystem standard and it feels "worth it" to be aligned and have the additional flexibility it gives. We also heavily rely on erased_serde for bevy_property. But if they can yield significant compile time wins, then I'm definitely open to using them.

Short term, I don't see much harm in adding additional serde impls, given how prevalent it is in our codebase (and our dependencies' code bases).

@zicklag
Copy link
Member

zicklag commented Aug 22, 2020

For compile times you may want to investigate cargo watt as a way to pre-compile the proc macros to WASM, preventing the need to compile them when building bevy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

No branches or pull requests

4 participants