Skip to content

chore(gemspec): ship RBS signatures with a stdlib manifest - #731

Merged
route merged 1 commit into
mainfrom
chore/ship-rbs
Nov 25, 2026
Merged

route merged 1 commit into
mainfrom
chore/ship-rbs

Conversation

@route

@route route commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Ferrum's RBS signatures in sig/ weren't packaged, so projects type-checking against Ferrum had to keep their own stubs.

  • The gemspec now ships sig/**/*.rbs and sig/manifest.yaml, so RBS and Steep load Ferrum's types from the installed gem.
  • sig/forwardable.rbs is removed: it redefined RBS's stdlib Forwardable and would raise duplicate definition errors for gem users. sig/manifest.yaml declares the stdlib libraries the signatures depend on instead (forwardable, net-http, openssl, singleton, socket, strscan, uri).
  • Development gems in the Gemfile are marked require: false, which rbs collection skips, so the collection only holds the runtime dependencies' types (addressable, base64, concurrent-ruby, public_suffix). Nothing calls Bundler.require, so loading is unchanged. Before, the collection pulled every locked gem, and the rack 2.2 types' Rack::Session clashed with rack-session's under rack 3, failing rbs validate.

@route
route force-pushed the chore/ship-rbs branch 2 times, most recently from 7c7a84c to 688d87d Compare November 25, 2026 07:23
Package sig/ so type checkers load Ferrum's types from the installed gem instead of local stubs. Replace the Forwardable stub,
which clashes with RBS's stdlib forwardable for gem users, with sig/manifest.yaml declaring the stdlib libraries the signatures use.

Mark the development gems require: false so the RBS collection only pulls the gemspec's runtime dependencies. The test app's
rack 3 stack made rbs validate fail: the collection only has rack 2.2 types, whose Rack::Session clashes with rack-session's.
@route
route merged commit 2302dd0 into main Nov 25, 2026
7 checks passed
@route
route deleted the chore/ship-rbs branch November 25, 2026 07:32
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.

1 participant