Skip to content

Hono acceptance: 30-line program with hono/cors or hono/logger middleware end-to-end #486

Description

@proggeramlug

Scope

Closes the second + third bullet of #421's acceptance list:

  • A 30-line Hono program (routing + JSON request/response + one middleware — e.g. a logger or a basic auth header check) compiles via `perry compile`, produces a single-file native binary, serves real HTTP traffic, and matches the same program under `node --experimental-strip-types` byte-for-byte for response bodies/headers.
  • At least one official Hono middleware (`hono/cors` or `hono/logger`) verified end-to-end.

Blocked on

#485 (class-field arrow methods on inherited classes don't apply across compilePackages). Hono's request/response dispatch chain is built entirely from arrow-class-fields on `HonoBase`; until those get applied to `new Hono()` instances, no real HTTP traffic can flow.

Plan after #485 lands

  1. Write `test-hono-min.ts` (30 lines): `new Hono() → app.get('/', json) → app.use('*', logger) → app.fetch(req)`.
  2. Compile + run `./test-hono-min` listening on a free port.
  3. Curl real HTTP traffic, diff response body + headers against `node --experimental-strip-types test-hono-min.ts`.
  4. Repeat with `hono/cors`.
  5. Add to parity test suite.

What stays out of scope

The full `@hono/perry-server` adapter is the fourth bullet of #421's acceptance — separate ticket since it's substantial work (signal handling, graceful shutdown, hyper integration, docs).

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