EvidenceChain answer
How do the new mailer, internationalization, and performance enhancements in Hanami 3.0 improve developer experience and
Hanami 3.0 brings several changes that make developers’ lives easier and apps zippier—especially when you compare it to older Hanami versions and even to Rails in some cases.
Mailer: from lost gem to first‑class citizen
Earlier Hanami users could reach for the standalone hanami‑mailer gem, but it didn't ship fully wired into the framework [14] [15]. Hanami 3.0 changes that completely. Mailers are now a built‑in, first‑class piece that sits naturally alongside actions, views, and operations [1] [13] [18].
Developers get a clean declarative DSL to describe delivery details [2], and mailers are injectable dependencies that hook into the view layer for rendering templates [3]. A generate mailer command scaffolds new mailers in a snap [6] [12], and a .decorate shorthand—just like in views—keeps things consistent [9]. Behind the scenes, mailer exposures act as the single source of prepared values, making data flow predictable [10].
On the delivery side, SMTP works out of the box by setting environment variables (the generated .env file even includes example SMTP vars) [4] [11]. During testing, the framework automatically switches to an in‑memory delivery method, so you never blast real emails by accident [4] [8]. Need something special? You can write custom delivery methods with hooks for provider‑specific features [5]. Plus, an attachment‑related fix ensures your attachments don’t fall into a black hole [7].
Compared to earlier Hanami, this tight integration removes all the manual wiring you once had to do [14] [15] [16]. While other Ruby frameworks (like Rails) also offer mailers, Hanami's design leans on dependency injection and explicit exposure handling, which leads to more modular and testable email code [3].
Internationalization: speak any language, out of the box
Previously, Hanami didn’t include internationalization support—you had to rig it up yourself [21]. Hanami 3.0 makes i18n a first‑class citizen [16] [24]. Just bundle the i18n gem and the framework automatically creates a self‑contained translation backend for your app and every slice [17] [22]. Translation and localization helpers are instantly available in actions and views without extra configuration [17] [20].
This is a big leap from earlier Hanami, where you had to cobble together your own i18n solution. Now you can build multilingual apps straight from the project template, which saves time and keeps your codebase clean.
Performance: zoom zoom
Hanami 3.0 speeds things up noticeably. The framework itself has been tuned so that apps are “faster by default” [19]. In one test app, the same request ran nearly 3× faster than on the previous version [23].
What does that mean in practice? A real‑world comparison shows that Hanami can deliver about 3× better average latency and handle roughly 3× more requests than a comparable Rails application [25]. For developers, this means a snappier development loop and less waiting around. For applications, it means you can serve more users with fewer server resources—a win all around.
These gains sit on top of the new mailer and i18n features, making Hanami 3.0 a solid upgrade whether you're maintaining an older Hanami app or eyeing it as a leaner, faster option in the Ruby world.
Discussion
Comments
Sign in to join the discussion
Comments are open to registered users so replies and notifications stay tied to a real account.
No comments yet. Be the first to add a useful angle.