Who is using Hono
• cdnjs API Server
• Drivly - Commerce infrastructure for the automotive industry
• Ultra - Zero-Legacy Deno/React Suspense SSR Framework
• Deno cli/bench/http
7
Node.js - router
29
Decode URI, Handle Query strings
Does not support regexp
Does not support regexp
Slide 30
Slide 30 text
Why so fast?
30
Slide 31
Slide 31 text
3+1 Routers
1. StaticRouter
• Fastest, supports only static routes.
2. RegExpRouter
• Faster, supports almost routes.
3. TrieRouter
• Slowest, supports all routes.
But it's faster than other routers in the world.
31
Slide 32
Slide 32 text
"Linear" router
32
Slide 33
Slide 33 text
ref: https://github.com/yusukebe/pico
Slide 34
Slide 34 text
TrieRouter
• Using Trie Tree structure
• Support all patterns
34
Slide 35
Slide 35 text
No content
Slide 36
Slide 36 text
RegExpRouter
• Match the route with using one big Regex made before dispatch.
• By @usualoma
• https://speakerdeck.com/usualoma/ultrafast-js-router
36
Slide 37
Slide 37 text
37
Slide 38
Slide 38 text
StaticRouter
• Optimized for static routings
• Does not support dynamic routings such as "path parameters"
38
Slide 39
Slide 39 text
No content
Slide 40
Slide 40 text
SmartRouter
• The default router
• Automatically picks the best router from the three routers.
40
• StaticRouter
• RegExpRouter
• TrieRouter
Slide 41
Slide 41 text
Great 👍
41
Slide 42
Slide 42 text
Concept 3
Middleware
42
Slide 43
Slide 43 text
Small core
• hono.ts
• context.ts
• compose.ts
• request.ts
43
Basic app with Wrangler: Total Upload: 34.15 KiB / gzip: 8.26 KiB
Slide 44
Slide 44 text
Three types of Middleware
• Built-in Middleware - including the package
• Custom Middleware - created by the users
• Third-party Middleware - depends on external libraries
44
TypeScript
• Wrangler, Deno, and Bun
fi
rst-class support TypeScript.
52
Slide 53
Slide 53 text
Path parameters
53
Slide 54
Slide 54 text
Validator Middleware
54
Slide 55
Slide 55 text
Easy to write tests
• With `jest-environment-mini
fl
are`
• We can do test `Request` to `Response`
55
Slide 56
Slide 56 text
Great 👍
56
Slide 57
Slide 57 text
Example: Blog
57
Slide 58
Slide 58 text
import
58
Slide 59
Slide 59 text
Model
59
Slide 60
Slide 60 text
Logic
60
Slide 61
Slide 61 text
JSX
61
Slide 62
Slide 62 text
GET /
62
Slide 63
Slide 63 text
POST /post
63
Slide 64
Slide 64 text
Use cases in the real world
64
Slide 65
Slide 65 text
With Cloudflare R2
65
• github.com/yusukebe/r2-image-worker
• Store and Deliver images with R2 backend Cloud
fl
are Workers.
ref: https://github.com/yusukebe/r2-image-worker
Slide 66
Slide 66 text
With Cloudflare D1
66
ref: https://blog.cloud
fl
are.com/making-static-sites-dynamic-with-cloud
fl
are-d1/
Slide 67
Slide 67 text
Cache control
67
ref: https://yusukebe.com/posts/2022/wsh/
Slide 68
Slide 68 text
Express alternative on Bun
68
Slide 69
Slide 69 text
Feature plans
69
Slide 70
Slide 70 text
Ecosystem
• For Third-party Middleware
• monorepo
• API specs as Types
• tRPC like, but integrated
70
Slide 71
Slide 71 text
API specs as Types
71
ref: https://github.com/honojs/hono/issues/582
Slide 72
Slide 72 text
And...
72
Slide 73
Slide 73 text
Going to
Standard web framework
for Web standards
73
Slide 74
Slide 74 text
One more thing
74
Slide 75
Slide 75 text
Pico
75
Pico is ultra-tiny (about 1kB) web framework using URLPattern.
Pico works on Cloud
fl
are Workers and Deno. Pico is compatible with Hono.
Slide 76
Slide 76 text
Love
76
Slide 77
Slide 77 text
Thanks
• Thanks to all contributors, all supporters, and all users!!
77