Skip to content

feat(codegen): filter generated clients by codec annotations#1305

Merged
vobradovich merged 5 commits into
masterfrom
vo/client-codec-filter
Apr 23, 2026
Merged

feat(codegen): filter generated clients by codec annotations#1305
vobradovich merged 5 commits into
masterfrom
vo/client-codec-filter

Conversation

@vobradovich
Copy link
Copy Markdown
Member

Summary:

  • @codec: <value> filtering is now applied in client-gen-js, client-gen-v2, and sol-gen.
  • sol-gen now skips scale-only methods and still includes dual and ethabi methods.
  • Shared codec logic remains centralized in sails-idl-meta.
  • Parser preservation test coverage exists for @codec.

@vobradovich vobradovich requested a review from m62624 April 17, 2026 11:45
@vobradovich vobradovich self-assigned this Apr 17, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mechanism to filter service functions in generated clients (JS, Rust, and Solidity) based on a new @codec annotation in the IDL. It adds a utility module in sails-idl-meta to parse these annotations and determine codec availability. Feedback focuses on optimizing the codec resolution logic to avoid unnecessary BTreeSet allocations in no_std environments and extending the filtering logic to include events in the JS generator.

Comment thread rs/idl-meta/src/codec.rs Outdated
Comment thread rs/idl-ast/src/codec.rs
Comment thread rs/client-gen-js/src/service_generator.rs
@vobradovich vobradovich merged commit e621c6c into master Apr 23, 2026
4 checks passed
@vobradovich vobradovich deleted the vo/client-codec-filter branch April 23, 2026 12:59
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.

2 participants