Packages

hono

4.13.19 · 16 Nov 2026MIT113.6M / weekRepositoryHomepagenpmAtom feed

Your version

3.10.0

13 Nov 2023Where it was published

3.12.12 is the newest release of 3.x.

In short

8 new1 faster7 fixed2 changed1 internal

Security

45 advisories affect 3.10.0; 4.13.16 fixes them

40 more

Release note

Hono v3.10.0 is now available! Let's explore the new features.

Support for Async Components in JSX

Hono's JSX now supports Async Components. You can use async/await in your components.

const fetchData = async () => {
  const res = await fetch('https://jsonplaceholder.typicode.com/todos/1')
  return res.json<{ title: string }>()
}

const Component = async () => {
  const data = await fetchData()
  return <div>{data.title}</div>
}

app.get('/', (c) => {
  return c.html(
    <html>
      <body>
        <h1>Hono v3.10.0</h1>
        <Component />
      </body>
    </html>
  )
})

Thanks, @usualoma!

Introduction of Suspense and renderToReadableStream()

With the Async Component, as shown above, it will await until fetch is completed. But now, if you want to render HTML before that, you can use Suspense.

When you use Suspense with renderToReadableStream(), it initially renders the content in fallback. After the Promise in Suspense is resolved, the real content is rendered.

import { renderToReadableStream, Suspense } from 'hono/jsx/streaming'

// ...

app.get('/', (c) => {
  const stream = renderToReadableStream(
    <html>
      <body>
        <h1>Hono v3.10.0</h1>
        <Suspense fallback={<div>loading...</div>}>
          <Component />
        </Suspense>
      </body>
    </html>
  )
  return c.body(stream, {
    headers: {
      'Content-Type': 'text/html; charset=UTF-8',
      'Transfer-Encoding': 'chunked'
    }
  })
})

If you make Component sleep for 2 seconds, the result will be as follows:

github.com/honojs/hono/assets/10682/5a02f18e-13…

Thanks, @usualoma!

JSX Renderer Middleware Now Supports stream

The JSX Renderer Middleware now supports stream, allowing you to use Suspense with it. You can return streaming responses without renderToReadableStream() and without writing header values such as Transfer-Encoding: chunked.

import { jsxRenderer } from 'hono/jsx-renderer'

// ...

app.get(
  '*',
  jsxRenderer(
    ({ children }) => {
      return (
        <html>
          <body>
            <h1>Hono v3.10.0</h1>
            {children}
          </body>
        </html>
      )
    },
    {
      stream: true
    }
  )
)

app.get('/', (c) => {
  return c.render(
    <Suspense fallback={<div>loading...</div>}>
      <Component />
    </Suspense>
  )
})

Thanks, @usualoma!

AWS Lambda Adapter Now Supports Streaming Response

The streamHandle is now available in the AWS Lambda adapter. With this, AWS Lambda can handle streaming responses.

import { Hono } from 'hono'
import { streamHandle } from 'hono/aws-lambda'

const app = new Hono()

app.get('/stream', async (c) => {
  return c.streamText(async (stream) => {
    for (let i = 0; i < 3; i++) {
      await stream.writeln(`${i}`)
      await stream.sleep(1)
    }
  })
})

const handler = streamHandle(app)

Thanks, @watany-dev!

Support @jsx precompile for Deno

Now, Hono's JSX supports the precompile feature for Deno. To enable it, write deno.json as follows.

{
  "compilerOptions": {
    "jsx": "precompile",
    "jsxImportSource": "hono/jsx"
  },
  "imports": {
    "hono/jsx/jsx-runtime": "https://deno.land/x/hono@v3.10.0/jsx/jsx-runtime.ts"
  }
}

Thanks, @usualoma!

Ecosystem

The ecosystem is evolving. Today, we introduce one framework using Hono.

  • Ree.js ree.js.org - Ree.js is a library that makes web development faster and easier by providing features such as URL Imports, JSX support, and server-side rendering.

All Updates

  • adaptor: Support AWS Function URL Streaming

  • Introduce streaming API with Suspense and use.

  • helper/factory: Remove @experimental from createMiddleware()

  • jsx/streaming: Fixed a bug that caused async components to be evaluated multiple times inside Suspense.

  • helper: Stream SSE Helper Non-Closure

  • jsx: Define jsxTemplate/jsxAttr/jsxEscape for "@jsx precompile" of Deno 1.38

  • jsx/streaming: Support nested Suspense.

  • jsx/streaming: In multiple Suspense, go ahead in the order of resolved.

  • jsx-renderer: Support "stream" option in jsxRenderer.

  • jsx/streaming: Fixed a problem when multiple children are added directly under Suspense.

  • types: Infer env types with chaining handlers

  • hono: Remove experimental flag from app.mount()

  • Adaptor: Lambda Response Streaming With Content Type

  • types: Allow arbitrary values as environment values

  • context: Implement ContextVariableMap for c.var

  • app: Use console.error() for default errorHandler

  • Next

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.