Skip to content

Hono acceptance: @hono/perry-server adapter (4th acceptance bullet of #421) #487

Description

@proggeramlug

Scope

Closes the fourth bullet of #421's acceptance list:

  • A `@hono/perry-server`-shaped adapter exists, either inside `perry-stdlib` or as a separate package, and is documented.

Plan

Hono uses runtime-specific adapters (`@hono/node-server`, Bun adapter, Deno adapter, Workers adapter). Perry needs one that hands the listening socket / request stream to Hono's `app.fetch`.

Two viable paths:

1. Inside perry-stdlib (or perry-ext-fastify-style external crate) — re-use the hyper accept loop that perry-ext-fastify already runs. Wraps it with a Hono-shaped `serve({ port, fetch })` API. Bundled by default, no `bun add` needed. Minimal code; same shape as Bun's built-in adapter.

2. Separate `@perryts/hono-perry-server` npm package — pure-TS, uses perry's `net.createServer` directly. Independently versioned, npm-installable.

Lean toward (1) since perry-ext-fastify already has the hyper plumbing — `@hono/perry-server` becomes a thin shim. Path-of-least-surprise is option (1).

Blocked on

#485 must land first (class-field inheritance). Without the dispatch chain firing, the adapter has nothing to dispatch into.

Acceptance

  • `import { serve } from '@hono/perry-server'` (or wherever it lands) works
  • `serve({ fetch: app.fetch, port: 3000 })` listens on port 3000
  • Curl response body + headers diff clean against the Bun-adapter version
  • Documented in `docs/src/stdlib/` (or in the package README if external)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions