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
860
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
MCP with Cloudflare Workers
yusukebe
2
220
Remix on Hono on Cloudflare Workers
yusukebe
3
420
僕がつくった48個のWebサービス達
yusukebe
20
17k
Honoの来た道とこれから
yusukebe
20
4.7k
JS RPCを理解する
yusukebe
5
720
Honoとhtmx
yusukebe
6
1.8k
Cloudflare Workersの環境を再現することについて
yusukebe
7
1k
Hono v4
yusukebe
11
5k
Hono v3 and v4
yusukebe
4
3.9k
Other Decks in Programming
See All in Programming
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
310
ドメインイベント増えすぎ問題
h0r15h0
1
220
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1k
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Bash Introduction
62gerente
608
210k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
A Philosophy of Restraint
colly
203
16k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
Building an army of robots
kneath
302
44k
A Tale of Four Properties
chriscoyier
157
23k
Into the Great Unknown - MozCon
thekraken
33
1.5k
YesSQL, Process and Tooling at Scale
rocio
169
14k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Typedesign – Prime Four
hannesfritz
40
2.4k
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