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

serde feature added #745

Merged
merged 9 commits into from
May 8, 2023
Merged

serde feature added #745

merged 9 commits into from
May 8, 2023

Conversation

michalkucharczyk
Copy link
Contributor

Support for serde derivations in no_std.

Part of: paritytech/substrate#12994,
Required for: paritytech/polkadot-sdk#25

Support for serde derivations in no_std.

Part of: paritytech/substrate#12994
@mrcnski
Copy link
Contributor

mrcnski commented May 5, 2023

Looks like there is already a serde_no_std feature we could reuse here: #385

Also, can you add a CI jobs with this feature for bounded-collections?

@michalkucharczyk
Copy link
Contributor Author

michalkucharczyk commented May 5, 2023

Looks like there is already a serde_no_std feature we could reuse here: paritytech/substrate#385

Can you please elaborate more, how can we reuse it?
Do you mean renaming serde to serde_no_std?

Also, can you add a CI jobs with this feature for bounded-collections?

Good point, will do.

@mrcnski
Copy link
Contributor

mrcnski commented May 5, 2023

Can you please elaborate more, how can we reuse it?
Do you mean renaming serde to serde_no_std?

Sorry, yeah I just meant reusing the same name for the feature.

@michalkucharczyk
Copy link
Contributor Author

My personal feeling is that serde is just a good name for enabling this feature. It is just about adding serde deps with proper features.

Naming was also discussed in paritytech/substrate#12994:
serde will be used in across substrate.

However I do understand your point to have consistent naming in parity-common. Let me know what do you think?

@mrcnski
Copy link
Contributor

mrcnski commented May 5, 2023

Oh, I see. Yeah, I didn't like serde_no_std, but changing it would be breaking and thought we should be consistent.

Is it possible to have them alias to each other? That way people using serde_no_std can keep using it, but we move to serde in substrate.

@michalkucharczyk
Copy link
Contributor Author

Nothing better than serde = [ "serde_no_std"] comes to my mind.
I don't know how to deprecate feature.
Found this: rust-lang/cargo#7130, https://stackoverflow.com/questions/56917787/how-to-correctly-deprecate-a-crate-feature.

@michalkucharczyk michalkucharczyk requested a review from a team as a code owner May 5, 2023 10:18
Copy link
Contributor

@mrcnski mrcnski left a comment

Choose a reason for hiding this comment

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

Looks good, not blocking on the feature name. Maybe it's fine without further changes, will let you decide.

Comment on lines 7 to 8
## [0.1.6] - 2023-05-05
- Added `serde` feature, which can be enabled for no `std` deployments.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: If we are following semver here, should this technically be a minor version bump? Since we are adding functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, looks like we weren't very strict about semver in the past, but good to start now. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, since we're still at 0.y.z we might have been following the common scheme where y is reserved for breaking changes.

The spec recommends always bumping y on new releases when x=0, but probably we shouldn't change the strategy we were already following. Maybe we should revert? 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both are fine for me. But following previous strategy makes sense. I'll revert.

bounded-collections/CHANGELOG.md Show resolved Hide resolved
@michalkucharczyk michalkucharczyk merged commit 3401582 into master May 8, 2023
@michalkucharczyk michalkucharczyk deleted the mku-serde-support branch May 8, 2023 10:46
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.

4 participants