tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

Feature Request: Output RBS files

Open pvcresin opened this issue 1 month ago • 3 comments

It would be beneficial if Tapioca could output RBS files, allowing for type inference with TypeProf and type checking with Steep.

Since shopify/rbi already has a feature to convert RBI to RBS, it doesn't seem entirely impossible.

  • https://github.com/Shopify/rbi/pull/367

Currently, there isn't a de facto standard for generating RBS in Rails, and various tools seem to be emerging.

  • https://github.com/pocke/rbs_rails
  • https://github.com/ksss/orthoses
  • https://github.com/tk0miya/rbs_activerecord
  • https://github.com/tk0miya/rbs_activesupport

I understand there are significant differences between the RBI and RBS ecosystems, and I thought Tapioca could bridge that gap, so I'd like to hear your thoughts.

pvcresin avatar Nov 26 '25 14:11 pvcresin

2 concerns:

  1. I don't know if automated surfacing of gem information is desired in the RBS ecosystem given handwritten signatures like https://github.com/ruby/gem_rbs_collection.
  2. Tapioca is closely associated with Sorbet, however, Sorbet does not support RBS files. Until that's implemented RBS feature would be for using with Steep only which will cause confusion among users. Maybe we can require the existence of a Steepfile.

cc @Morriar @soutaro

KaanOzkan avatar Nov 26 '25 15:11 KaanOzkan

@Morriar brought https://github.com/ruby/rbs?tab=readme-ov-file#cli to my attention, @pvcresin I wonder if rbs prototype runtime is what you're looking for. There also seems to be support for supplying a folder of ruby files which can be the locally installed gems you have.

KaanOzkan avatar Dec 01 '25 20:12 KaanOzkan

@KaanOzkan Certainly, there might be many parts that can be covered by rbs prototype runtime. I haven't really worked with runtime much, so I'll give it a try.

On the other hand, I especially feel the value in tapioca dsl and its rich DSL compilers, and I continue to hope that it can be brought into the RBS ecosystem as well.

Regarding this Issue, it's okay to close it.

pvcresin avatar Dec 02 '25 02:12 pvcresin