![]() |
|
![]() |
|
Recently, I've been looking for a suitable stack for another pet project. Personally my go-to stack is Remix. But I want to use a server other than the default provided by Remix, i.e minimal Express. So, I found Hono. It looks interesting because it can run on many runtimes, and this time I want to try using Bun. After researching Hono, it turns out it can render JSX directly from the server, which piqued my interest. Then I tried to make the JSX interactive, and finally, I used htmx. Lol. And just yesterday, after spending hours I found a way to use PDFKit with Hono (Bun runtime), so I created a gist for reference: https://gist.github.com/mansarip/eb11b66e7dc65cee988155275a1... Anyway I'm still cautious about putting this Hono + htmx stack into production use. |
![]() |
|
How often developers encounter performance issues coming from the slow framework, so they need to switch to a fast one? Which one is the slow?
|
![]() |
|
> It works on any JavaScript runtime: Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, AWS Lambda, Lambda@Edge, and Node.js. Does it work in the browser as well? |
![]() |
|
Yes it works in the browser also. I've been using it for routing and templating etc client side (main thread, and service worker), as well as in a cloudflare worker.
|
![]() |
|
Edge can win if data (as in realtime app data
not
just static stuff) is replicated there at least or possibly even better can allow writes using CRDTs so the edge is also a distributed DB node.
|
![]() |
|
It’s good but it’s not much of a framework. To me a backend framework is more like Rails or ASP.NET. Hono is more like an http router. |
![]() |
|
It's similar to the PHP micro-frameworks back in the day, like Silex and Lumen. Those often didn't contain more than a router, middleware, request/response objects, some type utils and a validator.
|
![]() |
|
Performance-wise, both are nearly identical - fast. Both frameworks support route groups, middleware, context, and mounting apps from other frameworks. Both are WinterCG compliant - deployment to platforms other than your own server or Docker, such as Cloudflare or Vercel Edge, should not be an issue. Hono appears to be very focused on serverless and edge runtimes like Fastly Compute, Lambda@Edge, Supabase Functions, etc. Both offer their own RPC implementations: - Hono: RPC in Hono: https://hono.dev/concepts/stacks#rpc - Elysia has Eden—its own end-to-end type safety RPC: https://elysiajs.com/eden/overview.html So, it's a matter of preference, I would say. I'm personally using ElysiaJS in production and have zero complaints. |
![]() |
|
That's very helpful. I'm also using Elysia in several small projects. Considering that the official stable 1.0 release was in March, it might be mature enough for production use.
|
![]() |
|
Please could a fellow HNer who has experience using this explain in simple terms what Hono on a Cloudflare Worker enables that one cannot already do with a vanilla worker? The docs[0] are not instructive on this point. [0] https://hono.dev |
![]() |
|
Hono still doesn’t support request cancellation well. So if you’re streaming tokens from an LLM and you cancel the request from the client you’ll be wasting money. |
![]() |
|
> Batteries Included - Hono has built-in middleware, custom middleware, and third-party middleware. Batteries included What does this mean? |
Hono's middlewares, especially zod-openapi[1] and @scalar/hono-api-reference[2], make it really easy to define your REST endpoints once and get full typesafe routes with request/response validation, an automatic OpenAPI spec, a beautiful OpenAPI browser and you can even reuse the typings in your frontend with Hono's RPC[3] middleware, essentially giving you end-to-end type-safety without any code-generation.
Its maintainer yusukebe is a really nice guy who is always being helpful and very active. I want Hono to become the modern successor of Express. :)
[1] https://hono.dev/snippets/zod-openapi
[2] https://www.npmjs.com/package/@scalar/hono-api-reference
[3] https://hono.dev/guides/rpc