Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Hono v3 - Do Everything, Run Anywhere, But Small, And Faster
Yusuke Wada
January 24, 2023
Programming
4
130
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 - Ultrafast web framework for Cloudflare Workers, Deno, Bun, and Node.js
yusukebe
2
5.6k
DenoでもBunでもいいから 最速を目指す
yusukebe
2
1.2k
デザイン思考時代の企画のつくり方
yusukebe
2
3.3k
スマホ時代のBotアプリのつくり方
yusukebe
7
26k
Webサービスにおける キャッシュ戦略
yusukebe
36
33k
JUST MAKE IT.
yusukebe
6
13k
Other Decks in Programming
See All in Programming
Zynq MP SoC で楽しむエッジコンピューティング ~RTLプログラミングのススメ~
ryuz88
0
370
23年のJavaトレンドは?Quarkusで理解するコンテナネイティブJava
tatsuya1bm
1
120
CDKでValidationする本当の方法 / cdk-validation
gotok365
1
210
Rによる大規模データの処理
s_uryu
2
640
新卒でサービス立ち上げから Hasuraを使って3年経った振り返り
yutorin
0
230
PHPアプリケーションにおけるアーキテクチャメトリクスについて / Architecture Metrics in PHP Applications
isanasan
1
260
ちょうぜつ改め21世紀ふつうのソフトウェア設計
tanakahisateru
7
6.5k
ECS Service Connectでマイクロサービスを繋いでみた
xblood
0
550
Unity+C#で学ぶ! メモリレイアウトとvtableのすゝめ 〜動的ポリモーフィズムを実現する仕組み〜
rossam
1
120
NGK2023S - OCaml最高! スマホ開発にも使えちゃう?!
haochenxie
0
120
監視せなあかんし、五大紙だけにオオカミってな🐺🐺🐺🐺🐺
sadnessojisan
2
1.5k
社会人 20 年目エンジニア、発信で技術学びなおしてる話
e99h2121
1
140
Featured
See All Featured
The Cult of Friendly URLs
andyhume
69
5.1k
Building Adaptive Systems
keathley
27
1.3k
Optimizing for Happiness
mojombo
365
64k
Support Driven Design
roundedbygravity
88
8.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
6
840
Designing for Performance
lara
600
65k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
217
21k
What's in a price? How to price your products and services
michaelherold
233
9.7k
Web development in the modern age
philhawksworth
197
9.6k
How STYLIGHT went responsive
nonsquared
89
4.2k
No one is an island. Learnings from fostering a developers community.
thoeni
12
1.5k
Principles of Awesome APIs and How to Build Them.
keavy
117
15k
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
[email protected]
• 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