Hono 4.0.0, the most recent launch of the quick, light-weight internet framework that runs on any JavaScript runtime, is now accessible. The replace options static web site era, consumer elements, and file-based routing.
Launched February 9, Hono 4.0.0 introduces the SSG Helper, which generates static pages of Hono functions. Builders use this by making a separate file from the appliance, construct.ts
, and calling the toSSG()
perform in it. SSG Helper retrieves the contents of registered routes and saves them as static recordsdata. Adapters can be found for the Bun toolkit and the Deno JavaScript runtime to hurry growth. A plug-in for Vite, @hono/vite-ssg, builds static websites with the vite
command.
With consumer elements, hono/jsx
extends to run on the consumer and never simply the server. Hooks similar to useContext
, useEffect
, and Memo
enable builders to create consumer elements similar to in React. File-based routing, known as HonoX, is included in a separate bundle. It allows growth of enormous functions, quick rendering, and lets builders carry their very own renderer. It really works as Hono, so Hono middleware can be utilized.
Hono runs on JavaScript runtimes together with Cloudflare Staff, Fastly Compute, Deno, Bun, Vercel, Netlify, AWS Lambda, Lambda@Edge, and Node.js. The framework has 5 routers, every of which is optimized for pace or measurement or different use instances. Considered one of these, the SmartRouter, selects the very best among the many registered routers primarily based on routing necessities.
Copyright © 2024 IDG Communications, Inc.