DEV Community

loading...

Discussion on: Which framework to choose for Ruby API

Collapse
janko profile image
Janko Marohnić

For me Roda's routing is much easier to understand than Grape's. While Grape provides a class-level DSL, Roda uses instance-level method calls that are evaluated only at the time of the request.

By the way, Roda offers many plugins for customizing the developer experience. If you don't like r.on, r.is, r.get etc, you can load the delegate plugin. If you don't like the route block, you can load the class_level_routing plugin.

The thing that I mind most in Grape are its dependencies:

  • ActiveSupport – I would like to be able to choose that I don't want any monkey patches. I've become especially sensitive about that when I stopped using Rails.
  • Virtus – It's been discontinued, the dry-rb ecosystem is the successor (I'm much more interested in dry-validation and dry-schema now). I know I can simply choose to do my own params validation, but it's still not ideal that Virtus is loaded.

But it's just me, I like to choose my own dependencies. That's one of the reasons why I moved away from Rails, I strongly disagreed on Active Record being the default ORM. But I understand that others would rather just rely on web framework defaults.