Paul Krill
Editor at Large

Hono web framework adds static site generation

news
Feb 9, 20242 mins

Fast and lightweight framework runs on Node, Deno, Bun, Cloudflare, Fastly, Vercel, and other JavaScript platforms.

Speed, fast, performance
Credit: Ollyy/Shutterstock

Hono 4.0.0, the latest release of the fast, lightweight web framework that runs on any JavaScript runtime, is now available. The update features static site generation, client components, and file-based routing.

Launched February 9, Hono 4.0.0 introduces the SSG Helper, which generates static pages of Hono applications. Developers use this by creating a separate file from the application, build.ts, and calling the toSSG() function in it. SSG Helper retrieves the contents of registered routes and saves them as static files. Adapters are available for the Bun toolkit and the Deno JavaScript runtime to speed development. A plug-in for Vite, @hono/vite-ssg, builds static sites with the vite command.

With client components, hono/jsx extends to run on the client and not just the server. Hooks such as useContext, useEffect, and Memo allow developers to create client components just like in React. File-based routing, called HonoX, is provided in a separate package. It enables development of large applications, supports fast rendering using Hono, and lets developers bring their own renderer. It works as Hono, so Hono middleware can be used.

Hono runs on JavaScript runtimes including Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Netlify, AWS Lambda, Lambda@Edge, and Node.js. The framework has five routers, each of which is optimized for speed or size or other use cases. One of these, the SmartRouter, selects the best among the registered routers based on routing requirements.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author