They seem to be the other two "micro frameworks" (with Rails obviously being the primary Ruby framework).
Hanami 2.0
21–30 of 50 posts
Re: Hanami 2.0
#22It looks clean because the developers are also the people behind dry-rb. However, I made one production service in Hanami and never again. They put clean syntax above all else. This results in a TON of metaprogramming with very weird results. There were times when a variable name I was using in my code was conflicting with a method called in one of the many `instance_evals` to achieve such "dryness" I really do like…
Re: Hanami 2.0
#23Framework-style libraries (i.e. Hanami) pulling in other framework-style libraries (i.e. dry-rb) which themselves pull in other framework-style libraries (i.e. Zeitwerk) is asking for a whole lot of trouble. If your app uses Hanami and Zeitwerk, for example, breaking changes in Zeitwerk may REQUIRE you to update Zeitwerk before you can upgrade Hanami. Or, if dry-rb hasn't adopted the new version of Zeitwerk, you may…
Re: Hanami 2.0
#24def call(name:, email_address:) email_client.deliver( to: email_address, subject: "Welcome!", text_body: welcome_email.render_text(name: name), html_body: welcome_email.render_html(name: name) ) SlackNotifier.notify("Welcome email sent to #{email_address}") end This code is bad. If you want Hanami to be an IoC framework, why still allow direct SlackNotifier to be injected to the action layer here ? I guess, lib/ fold…
Re: Hanami 2.0
#25Earlier quoted context omitted.
Hanami 2.0 doesn’t have any interactors
Oh, I saw an example with `app/operations` and assumed they were just renamed. Guess that changes everything for me. Will definitely give it a try.
Re: Hanami 2.0
#26Anyone 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).
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.
Re: Hanami 2.0
#27def call(name:, email_address:) email_client.deliver( to: email_address, subject: "Welcome!", text_body: welcome_email.render_text(name: name), html_body: welcome_email.render_html(name: name) ) SlackNotifier.notify("Welcome email sent to #{email_address}") end This code is bad. If you want Hanami to be an IoC framework, why still allow direct SlackNotifier to be injected to the action layer here ? I guess, lib/ fold…
You missed the context of this example - it's just there to show that IF you don't want to use constructor DI, you can put things in lib and they won't become part of the automatic DI system
No good production code allows such things to accidentially happen, so to me, it's the error from framework. What's the point of using a framework if it couldn't help me do silly things then ?
Re: Hanami 2.0
#28I wrote a wrapper that handles/maintains multiple hanami apps and makes plugin usage easy with multiple projects I use them in. Everything gets deployable with capistrano. I run a few sites with more or less complex features and quite happy with it.
Will see how the migration goes...
Grats to 2.0 and kudos to the hanami guys! Great software.
Re: Hanami 2.0
#29Re: Hanami 2.0
#30Framework-style libraries (i.e. Hanami) pulling in other framework-style libraries (i.e. dry-rb) which themselves pull in other framework-style libraries (i.e. Zeitwerk) is asking for a whole lot of trouble. If your app uses Hanami and Zeitwerk, for example, breaking changes in Zeitwerk may REQUIRE you to update Zeitwerk before you can upgrade Hanami. Or, if dry-rb hasn't adopted the new version of Zeitwerk, you may…
What would your successor prefer when they take over: Bob's ad-hoc framework built from the ground up where they don't know how anything works, or some app implemented on top of a framework they've used in 10 other jobs?
While I agree that using frameworks like rails/django/hanami/react has an upfront cost, it's so hard to justify doing your own thing if your usecase is fits within what they offer.