ignacio-chiazzo / ruby_whatsapp_sdk

A lightweight, efficient Ruby gem for interacting with Whatsapp Cloud API.
https://ignacio-chiazzo.github.io/ruby_whatsapp_sdk/
MIT License
156 stars 33 forks source link

Use RBS type annotations instead of Sorbet #68

Open johnnyshields opened 1 year ago

johnnyshields commented 1 year ago

Sorbet is nice, but it's a pain to make everyone install it in production apps since it's not widely used and is not part of Ruby core.

Instead, Sorbet should be a development_dependency, and this gem should use *.rbs files to annotate types which are the Ruby-core way and can be read by Sorbet. The Ruby .rb files should be kept clean of Sorbet markup.

I think this is a best practice for gem maintainers.

Please let me know if you'd accept a PR for this.

ignacio-chiazzo commented 1 year ago

but it's a pain to make everyone install it in production apps

Update: Done ✅ I 100% agree it shouldn't be part of production apps. Instead, it should be development dependency only for this library.

Instead, Sorbet should be a development_dependency,

I'd be happy to merge a PR that makes it a development dependency.

this gem should use *.rbs files to annotate types which are the Ruby-core way and can be read by Sorbet. The Ruby .rb files should be kept clean of Sorbet markup.

I'd have to research how the RBs parser works for Sorbet. If it works well and both are compatible, we could give it a try. I'd happily accept a PR that changes a few files, and we can progressively change the others.