Skip to content

feat: replace scale-info with sails-type-registry#1248

Open
m62624 wants to merge 13 commits intomasterfrom
feat/sails-type-registry
Open

feat: replace scale-info with sails-type-registry#1248
m62624 wants to merge 13 commits intomasterfrom
feat/sails-type-registry

Conversation

@m62624
Copy link
Copy Markdown
Member

@m62624 m62624 commented Mar 20, 2026

No description provided.

m62624 added 3 commits March 19, 2026 15:34
* feat(type-registry): implement native alias expansion and fix IDL generics
* refactor(idl-meta): replace scale-info with sails-type-registry
* refactor(idl-gen): migrate from scale-info to sails-type-registry
* refactor(macros): update generated code attributes to use type_info
* refactor(core): update TypeInfo exports and dependencies
* feat(type-registry): add metadata hints for generics and constants
* feat: implement MetaType for runtime type registration and introspection
* feat: separate core primitives and gprimitives with TypeDef::GPrimitive
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 undertakes a significant refactoring effort to replace the existing scale-info type information system with a newly developed sails-type-registry. The change impacts dependency management, attribute usage, and core type resolution logic across various components, aiming to streamline type metadata handling within the project.

Highlights

  • Type Registry Migration: Replaced the scale-info crate with a new custom sails-type-registry crate across the entire codebase.
  • Attribute Macro Update: Updated all instances of the #[scale_info(crate = ...)] attribute macro to #[type_info(crate = ...)] to reflect the new type registry.
  • IDL Generation Logic Refactoring: Refactored the internal logic of the IDL generation (rs/idl-gen) and client generation (rs/client-gen) to integrate with the new sails-type-registry API, including changes from PortableRegistry to Registry and u32 type IDs to TypeRef.
  • New Type Registry Implementation: Introduced the new sails-type-registry and sails-type-registry-derive crates, providing a custom solution for type information and its derivation.
  • Generic Type Resolution Simplification: Removed the rs/idl-gen/src/generic_resolver.rs module, indicating that generic type resolution is now handled more directly or differently within the new type registry.
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.

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 replaces scale-info with a new sails-type-registry crate. This is a significant refactoring that touches many files. The changes are mostly mechanical replacements of attributes and imports. The new sails-type-registry and sails-type-registry-derive crates are introduced. The logic for IDL generation in rs/idl-gen has been substantially updated to work with the new type registry.

I've found a couple of critical issues. One is a circular dependency in the root Cargo.lock file for the new sails-type-registry crate. The other is a logic bug in the type name resolution in rs/idl-gen/src/type_resolver.rs which could lead to name collisions.

@m62624
Copy link
Copy Markdown
Member Author

m62624 commented Mar 20, 2026

/gemini review

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 significant architectural change by replacing the scale-info dependency with a new, custom sails-type-registry crate. This refactoring is extensive, affecting dependency management, IDL generation, macros, and numerous examples and tests. The new sails-type-registry provides a more powerful and tailored type information system, which simplifies and improves the logic for handling complex types, especially generics and const generics. The changes appear to be well-executed and consistent across the codebase, resulting in a cleaner and more robust implementation. Overall, this is a solid improvement to the project's architecture.

@m62624 m62624 marked this pull request as ready for review March 27, 2026 10:02
@m62624 m62624 force-pushed the feat/sails-type-registry branch from bb7e0c6 to a07010f Compare March 27, 2026 10:31
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