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
840
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
Remix on Hono on Cloudflare Workers
yusukebe
1
280
僕がつくった48個のWebサービス達
yusukebe
20
17k
Honoの来た道とこれから
yusukebe
19
3.2k
JS RPCを理解する
yusukebe
5
680
Honoとhtmx
yusukebe
6
1.8k
Cloudflare Workersの環境を再現することについて
yusukebe
7
1k
Hono v4
yusukebe
11
4.8k
Hono v3 and v4
yusukebe
4
3.8k
The power of Web-standards
yusukebe
4
1.7k
Other Decks in Programming
See All in Programming
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
200
RubyLSPのマルチバイト文字対応
notfounds
0
120
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.4k
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Realtime API 入門
riofujimon
0
150
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
64k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Navigating Team Friction
lara
183
14k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Unsuck your backbone
ammeep
668
57k
YesSQL, Process and Tooling at Scale
rocio
169
14k
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