Skip to content

Deprecate default serde & add spl-collections#92

Merged
lorisleiva merged 3 commits intocodama-idl:mainfrom
grod220:spl-collections
Mar 10, 2026
Merged

Deprecate default serde & add spl-collections#92
lorisleiva merged 3 commits intocodama-idl:mainfrom
grod220:spl-collections

Conversation

@grod220
Copy link
Contributor

@grod220 grod220 commented Mar 9, 2026

This PR does two things:

Replace kaigan

Replaces it with spl-collections equivalents

  • RemainderStr → TrailingStr
  • RemainderVec → TrailingVec
  • U8PrefixString → U8PrefixedStr
  • U8PrefixVec → U8PrefixedVec

Deprecate serde

The previous kaigan-based serde support used plain #[derive(serde::Serialize, serde::Deserialize)] on wrapper types. This was misleading. The serde representation does not match the Borsh/Wincode wire format that these types exist to encode. In the worst case, this is a bug waiting to happen. Rather than continue support and false confidence, this PR just removes it entirely. I can't really see any practical use of serde in the context of a rust client given borsh/wincode anyway.

That said, for compatibility, the renderer still allows advanced users to opt into serde explicitly via traitOptions / feature flags, but serde is no longer part of the default or recommended path.

@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2026

🦋 Changeset detected

Latest commit: 13b6869

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@codama/renderers-rust Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@grod220 grod220 changed the title Deprecate serde & add spl-collections Deprecate default serde & add spl-collections Mar 9, 2026
@grod220 grod220 marked this pull request as ready for review March 9, 2026 17:42
@grod220
Copy link
Contributor Author

grod220 commented Mar 9, 2026

Ready for review when you have a chance @lorisleiva 🙏 (cc @febo)

Copy link
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

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

Thanks! Just a couple of documentation nits but looks good to me. Febo lmk if that's okay for you too.

@grod220 grod220 requested a review from lorisleiva March 10, 2026 07:52
Copy link
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the changes!

@grod220 grod220 requested a review from lorisleiva March 10, 2026 09:07
@grod220
Copy link
Contributor Author

grod220 commented Mar 10, 2026

Merge request 🙏

Copy link

@febo febo left a comment

Choose a reason for hiding this comment

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

Looks great!

@lorisleiva lorisleiva merged commit 4af6c06 into codama-idl:main Mar 10, 2026
4 checks passed
@github-actions github-actions bot mentioned this pull request Mar 10, 2026
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.

3 participants