Skip to content

feat(sails-js): impl IDL v2 parser, AST types, SailsProgram, SailsService classes#1198

Merged
vobradovich merged 18 commits intomaster-idl-v2from
vo/idl-v2-js-parser
Feb 23, 2026
Merged

feat(sails-js): impl IDL v2 parser, AST types, SailsProgram, SailsService classes#1198
vobradovich merged 18 commits intomaster-idl-v2from
vo/idl-v2-js-parser

Conversation

@vobradovich
Copy link
Copy Markdown
Member

No description provided.

@vobradovich vobradovich self-assigned this Jan 29, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @vobradovich, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly advances the Sails framework's capabilities by introducing comprehensive support for IDL v2. It establishes a new parsing pipeline using WebAssembly, allowing for the interpretation of the updated IDL specification. The core sails-js library now includes dedicated classes that abstract the complexities of interacting with Gear blockchain programs, offering a more intuitive and type-safe way to manage program constructors, service functions, and events. This foundational work paves the way for richer and more expressive program definitions and client-side interactions.

Highlights

  • IDL v2 Parser Implementation: Introduced a new WebAssembly-based IDL v2 parser (sails-idl-parser-wasm and js/parser-v2) to handle the updated Sails IDL format, enabling more robust and efficient parsing.
  • New SailsProgram and SailsService Classes: Implemented SailsProgram and SailsService classes within the sails-js library, providing a structured API for interacting with IDL v2 programs, including constructors, functions (commands and queries), and events.
  • Enhanced Type Resolution and Transaction/Query Builders: Added new type resolution utilities (type-resolver-v2.ts) and dedicated TransactionBuilder and QueryBuilder classes for IDL v2, streamlining the process of building and executing interactions with Gear blockchain programs.
  • Updated Build System and Dependencies: Modified Cargo.lock, Cargo.toml, js/package.json, pnpm-workspace.yaml, and Rollup configurations to integrate the new Rust and JavaScript packages and manage dependencies for the IDL v2 ecosystem.
  • Refined IDL Header Matching Logic: Improved the SailsMessageHeader interface matching logic in rs/idl-meta to better handle cases with route_id == 0 and multiple interface instances, ensuring more accurate message routing.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 comprehensive implementation for Sails IDL v2, including a new WASM-based parser, AST types, and the SailsProgram and SailsService classes for interacting with v2 programs. The changes are extensive, adding new packages for parsing and types, along with updated transaction and query builders.

Overall, this is a significant and well-structured feature addition. My review focuses on a few critical bugs, areas for improvement in terms of code quality and maintainability, and some minor corrections. Key findings include a critical bug in gas calculation, outdated logic in message header matching, and opportunities to refactor duplicated code.

Comment thread js/src/transaction-builder-with-header.ts
Comment thread js/parser-v2/src/header.ts Outdated
Comment thread js/example/package.json
Comment thread js/package.json Outdated
Comment thread js/parser-v2/package.json Outdated
Comment thread js/parser-idl-v2/src/parser.ts
Comment thread js/parser-v2/src/parser.ts Outdated
Comment thread js/src/query-builder-v2.ts Outdated
Comment thread js/src/sails-idl-v2.ts
Comment thread js/types-v2/package.json Outdated
@vobradovich vobradovich marked this pull request as ready for review February 3, 2026 14:17
@vobradovich vobradovich requested a review from m62624 February 3, 2026 17:29
Comment thread js/parser-v2/src/header.ts Outdated
Comment thread js/parser-v2/test/fixture/demo.ts Outdated
Comment thread js/parser-v2/src/idl-v2-impls.ts Outdated
Comment thread js/parser-v2/src/idl-v2-impls.ts Outdated
Comment thread js/parser/rollup.config.js
Comment thread js/src/transaction-builder-v2.ts Outdated
Comment thread js/src/sails-v2.ts Outdated
Comment thread js/src/sails-v2.ts Outdated
Comment thread js/src/sails-v2.ts Outdated
@vobradovich vobradovich merged commit a3303d5 into master-idl-v2 Feb 23, 2026
4 checks passed
@vobradovich vobradovich deleted the vo/idl-v2-js-parser branch February 23, 2026 10:25
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