Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hono v3 - Do Everything, Run Anywhere, But Smal...
Search
Yusuke Wada
January 24, 2023
Programming
4
1k
Hono v3 - Do Everything, Run Anywhere, But Small, And Faster
About the next major version of Hono. "v3".
Yusuke Wada
January 24, 2023
Tweet
Share
More Decks by Yusuke Wada
See All by Yusuke Wada
Honoをフロントエンドで使う 3つのやり方
yusukebe
8
4.3k
Honoのおもしろいミドルウェアをみてみよう
yusukebe
2
340
MCP with Cloudflare Workers
yusukebe
2
390
Remix on Hono on Cloudflare Workers
yusukebe
3
710
僕がつくった48個のWebサービス達
yusukebe
21
18k
Honoの来た道とこれから
yusukebe
20
7k
JS RPCを理解する
yusukebe
5
870
Honoとhtmx
yusukebe
6
2k
Cloudflare Workersの環境を再現することについて
yusukebe
7
1.1k
Other Decks in Programming
See All in Programming
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
460
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
390
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
1
720
童醫院敏捷轉型的實踐經驗
cclai999
0
210
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
130
Cursor AI Agentと伴走する アプリケーションの高速リプレイス
daisuketakeda
1
130
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
4
230
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
260
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
1
240
Discover Metal 4
rei315
2
110
ふつうの技術スタックでアート作品を作ってみる
akira888
0
270
Select API from Kotlin Coroutine
jmatsu
1
210
Featured
See All Featured
How to Ace a Technical Interview
jacobian
277
23k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
680
It's Worth the Effort
3n
185
28k
Building Applications with DynamoDB
mza
95
6.5k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
720
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
500
The Cult of Friendly URLs
andyhume
79
6.5k
Designing for humans not robots
tammielis
253
25k
Faster Mobile Websites
deanohume
307
31k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Transcript
Yusuke Wada 2023-01-24 Serverless Frontend Meetup Hono v3 Do Everything,
Run Anywhere, But Small, And Faster * will be released soon!
Me • Yusuke Wada • Supervisor at TravelBook Inc. •
Web developer, Web framework developer • https://yusukebe.com/ • https://github.com/yusukebe 2
Ultrafast web framework for Cloudflare Workers, Deno, Bun, and Node.js
3 What's Hono?
Without Hono
With Hono
6 Web frameworks/routers for Cloudflare Workers •itty-router ~550 bytes •Sunder
•Worktop •Hono
•Fast - 3+1 Routers •Tiny - about 20kB •Multi-runtimes -
CF, Fastly, Deno, Bun, Lagon, Node.js •Fine DX - TypeScript •Batteries Included - Middleware 7 Hono Features
•Deno •Deno Benchmark •cdnjs •Ultra - Deno/React SSR Framework •Cloud
fl are D1 example •substats •Kings League Project •react-starter-kit •Driv.ly 8 Who uses Hono?
Demo 1-minute deploy 9
Current version v2.7.5 shipped today 10
Going to "v3" Not released yet but will be soon.
11 Do Everything, Run Anywhere, But Small, And Faster
Run anywhere 12
13 Multi-runtimes CI support
Node.js support 14
Adapters 15 Cloud fl are Workers, Cloud fl are Pages,
Bun, Deno are available
Cloudflare Pages
`/functions` 17
Next.js Edge API Routes
Use middleware on Vercel 19
Anywhere! thanks to Web Standard • Cloud fl are Workers
• Cloud fl are Pages • Fastly Compute@Edge • Deno • Bun • Lagon • Vercel • Node.js • ... 20 Hono may work on every JavaScript runtime!
Faster 21
Performance improvement 22 15% faster! 3% slower:( Using https://github.com/SaltyAom/bun-http-framework-benchmark Measured
on 2023-01-22
Small 23
A little fatter, but still small. 24 Express => 572
kB Fastify => 1.2 MB
[email protected]
=> 48 kB
Pico - Ultratiny web framework 25 https://github.com/yusukebe/pico May be placed
on @hono/pico ??
Do everything 26
RPC mode - like tRPC but integrated, too simple 27
1. Server: Write the schema 28
2. Use `zod-validator` Middleware 29
3. Write the endpoint with `jsonT()` and `build()` 30
4. Export "types" 31
5. Client: Use `@honoj/hc` and import "types" 32
6. Post JSON and parse the response 33
Share the API specs 34
Demo: https://github.com/honojs/hono/issues/727#issuecomment-1369078973 35
Great 👍 36
`create hono` command 37
@honojs to `@hono` ! 38 • We can make packages
such middleware as `@hono/xxx` • Middleware • @hono/zod-validator • @hono/qwik-city • @hono/graphql-server - by @metrue • @hono/sentry by @sam-lippert • @hono/ fi rebase-auth by @Code-Hex • @hono/node-server • @hono/hc
Ecosystem 39 Hono Middleware hc node-server Adapter Pico `create hono`
@hono/qwik-city 40 Works on Cloud fl are Workers and Bun
(also on Deno?)
It works on your runtime if it works on Hono
41
Others • `HonoRequest` • `HTTPException` • Router - regexp with
slash support 42
Hono v3 will be released soon! 43