-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sozo-bindgen): add i8,i16,i32,i64 support #2934
Conversation
WalkthroughOhayo, sensei! This pull request introduces four new constants for signed integer types ( Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/dojo/bindgen/src/plugins/typescript/generator/mod.rs (1)
228-231
: Consider documenting default value choice.While the implementation is correct, it might be helpful to add a comment explaining why "0" was chosen as the default value for signed integers.
+ // Default value of 0 is chosen as it's a safe initial value for both positive and negative ranges CAIRO_I8 => JsPrimitiveDefaultValue("0".to_string()), CAIRO_I16 => JsPrimitiveDefaultValue("0".to_string()), CAIRO_I32 => JsPrimitiveDefaultValue("0".to_string()), CAIRO_I64 => JsPrimitiveDefaultValue("0".to_string()),
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
crates/dojo/bindgen/src/plugins/typescript/generator/constants.rs
(1 hunks)crates/dojo/bindgen/src/plugins/typescript/generator/mod.rs
(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: fmt
🔇 Additional comments (4)
crates/dojo/bindgen/src/plugins/typescript/generator/constants.rs (1)
11-14
: Ohayo! LGTM - Clean and consistent constant declarations.The new signed integer type constants follow the established naming pattern and are logically placed alongside other integer types.
crates/dojo/bindgen/src/plugins/typescript/generator/mod.rs (3)
76-79
: Clean implementation of signed integer type mappings, sensei!The mapping to
JS_BIGNUMBERISH
is appropriate for signed integers, maintaining consistency with unsigned integer handling.
158-161
: Consistent input type mapping implementation!The input type mappings mirror the JsPrimitiveType implementation, maintaining a coherent type system.
76-79
: Verify test coverage for new integer types.Please ensure that test cases exist for the new signed integer types in the test module, particularly for edge cases like minimum and maximum values.
Also applies to: 158-161, 228-231
Description
Related issue
Tests
Added to documentation?
Checklist
scripts/prettier.sh
,scripts/rust_fmt.sh
,scripts/cairo_fmt.sh
)scripts/clippy.sh
,scripts/docs.sh
)Summary by CodeRabbit