Skip to content
Myr

docs: update migration guide for v3 (#903)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Yusuke Wada · committed by GitHub · parent 02e3786 · Browse files · 1 file+53 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+53 added−0 removed

  • other:+53 added−0 removed

1 file+53 added−0 removed

modified:docs/MIGRATION.md+53 added
1# Migration Guide23## v2.7.8 to v3.0.045There are some breaking changes.6In addition to the following, type mismatches may occur.78### `c.req` is now `HonoRequest`910`c.req` becomes `HonoRequest`, not `Request`.11Although APIs are almost same, but if you want to access `Request`, use `c.req.raw`.1213```ts14app.post('/', async (c) => {15 const metadata = c.req.raw.cf?.hostMetadata?16 ...17})18```1920### StaticRouter is obsolete2122You can't use `StaticRouter`.2324### Validator is changed2526Previous Validator Middleware is obsolete.27You can still use `hono/validator`, but the API has been changed.28See [the document](https://hono.dev).2930### `serveStatic` is provided from Adapter3132Serve Static Middleware is obsolete. Use Adapters instead.3334```ts35// For Cloudflare Workers36import { serveStatic } from 'hono/cloudflare-workers'3738// For Bun39// import { serveStatic } from 'hono/bun'4041// For Deno42// import { serveStatic } from 'npm:hono/deno'4344// ...4546app.get('/static/*', serveStatic({ root: './' }))47```4849## `serveStatic` for Cloudflare Workers "Service Worker mode" is obsolete5051For Cloudflare Workers, the `serveStatic` is obsolete in Service Worker mode.5253Note: Service Worker mode is that using `app.fire()`.54We recommend use "Module Worker" mode with `export default app`.5556## v2.7.1 - v2.x.x5758### Current Validator Middleware is deprecated59
167 unmodified lines