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
A description of Hono Prepared Router
Search
EdamAmex
December 20, 2024
Technology
0
61
A description of Hono Prepared Router
A description of Hono Prepared Router
EdamAmex
December 20, 2024
Tweet
Share
Other Decks in Technology
See All in Technology
エンジニアリングマネージャーの成長の道筋とキャリア / Developers Summit 2025 KANSAI
daiksy
2
450
【NoMapsTECH 2025】AI Edge Computing Workshop
akit37
0
220
いま注目のAIエージェントを作ってみよう
supermarimobros
0
340
株式会社ログラス - 会社説明資料【エンジニア】/ Loglass Engineer
loglass2019
4
65k
スマートファクトリーの第一歩 〜AWSマネージドサービスで 実現する予知保全と生成AI活用まで
ganota
2
270
AWSを利用する上で知っておきたい名前解決のはなし(10分版)
nagisa53
10
3.2k
Modern Linux
oracle4engineer
PRO
0
150
Generative AI Japan 第一回生成AI実践研究会「AI駆動開発の現在地──ブレイクスルーの鍵を握るのはデータ領域」
shisyu_gaku
0
310
💡Ruby 川辺で灯すPicoRubyからの光
bash0c7
0
120
「Linux」という言葉が指すもの
sat
PRO
4
140
実践!カスタムインストラクション&スラッシュコマンド
puku0x
0
480
TS-S205_昨年対比2倍以上の機能追加を実現するデータ基盤プロジェクトでのAI活用について
kaz3284
1
210
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
Agile that works and the tools we love
rasmusluckow
330
21k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Navigating Team Friction
lara
189
15k
KATA
mclloyd
32
14k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
A Modern Web Designer's Workflow
chriscoyier
696
190k
Faster Mobile Websites
deanohume
309
31k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Become a Pro
speakerdeck
PRO
29
5.5k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Transcript
Prepared Router
Process of Build 1. Lexer Path 2. Generate Conditions 3.
Rollup and Optimize 4. Dynamic Prediction
1. Lexer Path /book/:id /book/:id/:page{\\d+} /search/* separator static dynamic regex
wildcard analyze the routing path 2. Generate Conditions pathParts is an array separated by separators. pathParts[1] = ‘book’ !!pathParts[2] ... /\d+/.test(pathParts[3]) ... pathParts.length > 2 ... And generate params
3. Rollup and Optimize if (A) { if (B) {
... } } if (C) { if (A) { ... } } optimize conditions if (A) { if (B) { ... } if (C) { ... } } if B and C are exclusive (B⊕C) if (A) { if (B) { ... }else if (C) { ... } }
4. Dynamic Prediction cache static path POST /books/list This is
static path Routing with built matcher and cache the results const results = matcher(“POST”, “/books/list”, ...) // [/books/*, /books/list] cache(“POST”, “/books/list”, results)