-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add serialize feature to bevy_color
#12527
Comments
We should add a serde flag for both crates, but there's no need to block. We can add it to bevy_color first, and just enable it during import initially. |
I may give it a try. Please let me know. |
Feel free to solve this :D |
So to summarize my understaning:
Actually I am java pogrammer by experience and have just started learning Rust, so want to ensure things are clear to me. |
Yep: you'll also want to make sure that the |
You can, too, have a look on prior work with similar tasks if that help: #11188 #[cfg(feature = "serialize")]
struct StandardColor
where // . . .
{
// . . .
}
#[cfg(not(feature = "serialize"))]
struct StandardColor
where // . . .
{
// . . .
} Thats probably the gist of it. |
I think we should just remove the Serialize + Deserialize bounds from |
Build is failing due to some IO error. Is it down to code changes? |
# Objective - Add serialize feature to bevy_color - "Fixes #12527". ## Solution - Added feature for serialization --- ## Changelog - Serde serialization is now optional, with flag 'serialize' ## Migration Guide - If user wants color data structures to be serializable, then application needs to be build with flag 'serialize'
What problem does this solve or what need does it fill?
Make serde optional for users. If they don't want, they not require it
What solution would you like?
Create the feature
serialize
forbevy_color
and remove serde::Serialize and Deserialize bound from traitStandardColor
(or recreate if feature is enabled)What alternative(s) have you considered?
Leave it as it is
Additional context
Notice that bevy_render depends on bevy_color, and as bevy_render doesn't flag serde by now, bevy_color can't too (unless of course we add the feature by default in bevy_render importing of bevy_color).
The text was updated successfully, but these errors were encountered: