Skip to content

Conversation

@justin808
Copy link
Member

@justin808 justin808 commented Nov 16, 2025

Summary

Add RBS type signatures for all error-related classes to complete type coverage for the gem.

Changes Made

  • Added RBS signatures for ReactOnRails::Error base class
  • Added RBS signatures for ReactOnRails::JsonParseError with error context methods
  • Added RBS signatures for ReactOnRails::PrerenderError with detailed rendering info
  • Added RBS signatures for ReactOnRails::SmartError with actionable suggestions
  • Removed duplicate definitions from main sig/react_on_rails.rbs file

Classes Added

  1. Error (sig/react_on_rails/error.rbs): Base error class inheriting from StandardError
  2. JsonParseError (sig/react_on_rails/json_parse_error.rbs): JSON parsing error with context
  3. PrerenderError (sig/react_on_rails/prerender_error.rbs): Server rendering error with detailed info
  4. SmartError (sig/react_on_rails/smart_error.rbs): Enhanced error with actionable suggestions

Testing

  • ✅ RBS validation passes (bundle exec rake rbs:validate)
  • ✅ RuboCop passes with no offenses
  • ✅ No duplicate definitions

Impact

These signatures provide type information for error handling, helping developers catch type-related issues during development. This is purely additive and doesn't affect runtime behavior.

Fixes #1954

🤖 Generated with Claude Code


This change is Reviewable

justin808 and others added 2 commits November 12, 2025 11:40
This commit adds RBS type signatures for all error-related classes to
complete type coverage for the gem.

Classes added:
- ReactOnRails::Error - Base error class
- ReactOnRails::JsonParseError - JSON parsing error with context
- ReactOnRails::PrerenderError - Server rendering error with detailed info
- ReactOnRails::SmartError - Enhanced error with actionable suggestions

These signatures provide type information for error handling, helping
developers catch type-related issues during development.

Fixes #1954

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Remove duplicate error class definitions from sig/react_on_rails.rbs
that were causing RBS validation failures. These classes now have their
own dedicated RBS files:

- sig/react_on_rails/error.rbs
- sig/react_on_rails/json_parse_error.rbs
- sig/react_on_rails/prerender_error.rbs
- sig/react_on_rails/smart_error.rbs

This fixes the RBS::DuplicatedMethodDefinitionError that was preventing
validation from passing.

Fixes #1954

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Warning

Rate limit exceeded

@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between cbee429 and e0302ea.

📒 Files selected for processing (5)
  • sig/react_on_rails.rbs (0 hunks)
  • sig/react_on_rails/error.rbs (1 hunks)
  • sig/react_on_rails/json_parse_error.rbs (1 hunks)
  • sig/react_on_rails/prerender_error.rbs (1 hunks)
  • sig/react_on_rails/smart_error.rbs (1 hunks)
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch justin808/rbs-error-classes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@justin808
Copy link
Member Author

Closing this PR as the work was already completed and merged in PR #2004. Issue #1954 has been resolved.

@justin808 justin808 closed this Nov 16, 2025
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.

RBS: Add type signatures for error classes

2 participants