RBS for Rails: Is there any plan about it?

Ruby 3.0 has this RBS feature which can help us do static analytics and gain more code intelligence such as auto completion.

Wonder whether integrating RBS into Rails has been tracked?

1 Like

One attempt is GitHub - pocke/rbs_rails to add Rake task to generate RBS files.

1 Like

I’m the author of RBS Rails and a maintainer of RBS. Thanks for opening this topic, and mentioning my product.

RBS Rails is responsible for generating application-specific RBSs from the configuration. Currently it supports AR models and routing helpers. For example, it generates User#name method’s RBS from DB schema.

We have another project to integrate RBS and Rails. It is ruby/gem_rbs_collection. The repository stores gems’ RBSs. You can imagine DefinitelyTyped if you use TypeScript. Currently it has auto-generated Rails related gems’ RBSs. For example: gem_rbs_collection/activesupport-generated.rbs at 81ace2c598ec871572beee5792e2a2781b35e762 · ruby/gem_rbs_collection · GitHub

Currently they are under development. You can try to type check in your Rails app, but you will encounter bugs RBS Rails and incorrect type signatures. Feedbacks are really welcome :slight_smile: