Skip to content

docs: add Fastify-to-Hono migration guide (#21)#125

Merged
PAMulligan merged 1 commit into
mainfrom
21-add-migration-guide-from-fastify-to-nervahono
Jun 13, 2026
Merged

docs: add Fastify-to-Hono migration guide (#21)#125
PAMulligan merged 1 commit into
mainfrom
21-add-migration-guide-from-fastify-to-nervahono

Conversation

@PAMulligan

Copy link
Copy Markdown
Contributor

Description

Adds docs/migration/from-fastify.md, a side-by-side migration guide for Fastify developers moving to Nerva/Hono, and links it from the README documentation index. Structure and voice mirror the existing Express-to-Hono guide (#20).

Fastify is the closest Node.js framework to Hono in philosophy — schema-first, TypeScript-first, and return-a-value handlers — so the guide leads with where the two align before mapping the genuine differences.

What's covered

  • docs/migration/from-fastify.md created
  • Fastify schemas → Zod schemas
  • Fastify plugins → Hono middleware (and encapsulation → mountable sub-apps)
  • Fastify decorators → Hono context variables (c.set/c.get/c.var)
  • Fastify hooks → Hono middleware chain (with a full lifecycle mapping table)
  • Route registration patterns
  • Serialization and validation (including the loss of fast-json-stringify response filtering)
  • Type providers (Fastify TypeBox → Hono + Zod inference)
  • "Where Fastify and Hono align" section (schema validation, TypeScript)
  • Cheat-sheet table
  • Linked from the main docs index (README)

Verification

  • All internal links resolve and external links (fastify.dev, hono.dev, zod.dev) were checked to return 200, so the check-links (lychee) CI job should pass.
  • Cross-checked against current Fastify docs: hook order, Ajv + fast-json-stringify removeAdditional filtering, and the @fastify/type-provider-typebox API.
  • Kept the "Node.js-only" framing precise — only Cloudflare Workers is called out as a target Fastify can't reach (Node/Docker/Lambda/Railway/Fly all run Fastify).

Fixes #21

🤖 Generated with Claude Code

Add docs/migration/from-fastify.md, a side-by-side porting guide for
Fastify developers moving to Nerva/Hono, mirroring the structure of the
Express guide.

Covers Fastify schemas to Zod, plugins/encapsulation to middleware and
sub-apps, decorators to context variables, hooks to the middleware
chain, route registration, serialization/validation (including the loss
of fast-json-stringify response filtering), and TypeBox type providers
to Zod inference. Leads with where Fastify and Hono align (schema-first,
TypeScript-first, return-a-value handlers, in-process testing) and
includes a cheat-sheet table. Linked from the README docs index.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@PAMulligan PAMulligan linked an issue Jun 13, 2026 that may be closed by this pull request
6 tasks
@github-actions github-actions Bot added the area: docs Documentation label Jun 13, 2026
@PAMulligan PAMulligan merged commit 35caa8f into main Jun 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add migration guide from Fastify to Nerva/Hono

1 participant