Skip to content

serde feature added#745

Merged
michalkucharczyk merged 9 commits into
masterfrom
mku-serde-support
May 8, 2023
Merged

serde feature added#745
michalkucharczyk merged 9 commits into
masterfrom
mku-serde-support

Conversation

@michalkucharczyk
Copy link
Copy Markdown
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
@michalkucharczyk michalkucharczyk requested a review from bkchr April 28, 2023 12:12
@michalkucharczyk michalkucharczyk requested review from ggwpez and mrcnski May 5, 2023 08:39
@mrcnski
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 thread bounded-collections/CHANGELOG.md Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread bounded-collections/Cargo.toml Outdated
Co-authored-by: Bastian Köcher <git@kchr.de>
Comment thread bounded-collections/CHANGELOG.md
@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