Hacker News new | ask | show | jobs
by sandstrom 1298 days ago
Anyone who knows how this is different from Sinatra and Roda?

They seem to be the other two "micro frameworks" (with Rails obviously being the primary Ruby framework).

2 comments

Hanami is not a micro-framework, it is composed of multiple gems though, so if you remove them all you're left with a core of the framework that doesn't do anything except providing an API for plugging in components, configuring them and managing their state.

When it comes to differences - Sinatra is not as feature rich and it's got a less powerful plugin system. Roda has a completely different router using so called Routing Tree, which Hanami doesn't have (it's got something more akin to what Rails has) but it's also highly extendible through plugins, so there is similarity there. A huge difference is that Hanami ships with a very powerful code loading system that supports automatic dependency injection mechanism.

Hanami aims to be a complete Ruby framework, allowing you to write web apps, but also gems, and non-web ruby applications. Hanami 2.0 only ships for API focus, but in next minor versions this is going to be extended. I see it as a direct alrernative to Rails for anyone who would like to try different style of programming while still using Ruby.
What benefits does it bring to writing gems?
Similar to what rodauth did, or active-admin - extracting mountable, shareable and reusable parts of your app to a separate thing.
Is this documented somewhere? Sounds interesting.