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 v4 やってみた
Search
circled9
February 23, 2024
Technology
1
140
🔥 Hono v4 やってみた
circled9
February 23, 2024
Tweet
Share
More Decks by circled9
See All by circled9
キースイッチ入門
circled9
0
42
CloudflareのAI関連の機能さわってみた
circled9
0
310
0.0.0.0 day
circled9
0
65
小数の丸め誤差の話
circled9
0
80
数値の文字列をパースしよう
circled9
0
110
JetBrains AI Assistant を試してみた
circled9
1
370
Fresh
circled9
0
220
React Hooks 勉強会 vol.3
circled9
2
400
JSON.stringify()
circled9
2
450
Other Decks in Technology
See All in Technology
AIを使って小説を書こう!【2024/10/25講演資料】
kamomeashizawa
0
160
サーバーサイドのデータプレーンプログラミング 〜 NVIDIA Blue Field / DOCA 〜
ebiken
PRO
1
230
入門『状態』#kaigionrails / "state" for beginners with Rails
shinkufencer
2
810
最速最小からはじめるデータプロダクト / Data Product MVP
amaotone
1
370
「最高のチューニング」をしないために / hack@delta 24.10
fujiwara3
15
2.7k
KMPプロジェクトでマニュアルDIを使う選択
rmakiyama
0
120
Mackerelが取り組むオブザーバビリティ - Mackerel Tech Day
mackerelio
0
330
EKS初心者が早めに知っておきたかったこと
cuorain
0
140
Emacs x Nostr
hakkadaikon
1
120
バイセルにおけるAI活用の取り組みについて紹介します/Generative AI at BuySell Technologies
kyuns
1
200
What's in a Postgres major release? An analysis of contributions in the v17 timeframe | Claire Giordano | PGConf EU 2024
clairegiordano
1
680
新R25、乃木坂46 Mobileなどのファンビジネスを支えるマルチテナンシーなプラットフォームの全体像 / cam-multi-cloud
cyberagentdevelopers
PRO
1
110
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Agile that works and the tools we love
rasmusluckow
327
21k
Designing Experiences People Love
moore
138
23k
The Art of Programming - Codeland 2020
erikaheidi
51
13k
Typedesign – Prime Four
hannesfritz
39
2.4k
Being A Developer After 40
akosma
86
590k
What's new in Ruby 2.0
geeforr
342
31k
Gamification - CAS2011
davidbonilla
80
5k
Documentation Writing (for coders)
carmenintech
65
4.4k
Building Adaptive Systems
keathley
38
2.2k
Transcript
🔥 Hono v4 ͬͯΈͨ Niigata 5min Tech #5 in Nagaoka
@circled9 1
ࣗݾհ @circled9 দҪɹਖ਼ࢤʢMatsui Masashiʣ גࣜձࣾϞχΫϧ ͚ࣾͷࡒγεςϜ࡞ͬͯ·͢ 60%ΩʔϘʔυ͓͡͞Μ 2
ࠓ͍ͨ͜͠ͱ • Hono͍͍ͧͱ͍͏ • v4Ͱ৽͘͠૿͑ͨػೳͷ • ࣮ࡍʹࢼͨ͠ײ 3
🔥 Hono 4
🔥 Hono is Կ ? • JavaScriptͷWebϑϨʔϜϫʔΫ • "Hono -
Ultrafast web framework for the Edges" 5
🔥 Hono is ... • 🚀 Ultrafast & Lightweight •
🌍 Multi-runtime • 🔋 Batteries Included • 😃 Delightful DX 6
🚀 Ultrafast & Lightweight • ΊͬͪΌ͍ɺ͍ͦͯܰ͠ • "The router RegExpRouter
is really fast. Not using linear loops. Fast." • "The hono/tiny preset is under 14kB. Hono has zero dependencies and uses only the Web Standard API." 7
🌍 Multi-runtime • େମͲ͜Ͱಈ͘ • "Works on Cloud fl are
Workers, Fastly Compute, Deno, Bun, AWS Lambda, or Node.js. The same code runs on all platforms." 8
🔋 Batteries Included • ඞཁͳͷେମ͋Δ • "Hono has built-in middleware,
custom middleware, third-party middleware, and helpers. Batteries included." 9
😃 Delightful DX • TypeScriptͰόονϦ • "Super clean APIs. First-class
TypeScript support. Now, we've got "Types"." 10
💪 ͦΕҎ֎ͷಛ 11
JSX const View = () => { return ( <html>
<body> <h1>Hello Hono!</h1> </body> </html> ) } app.get('/page', (c) => { return c.html(<View />) }) 12
hono/css const buttonClass = css` background-color: #fff; &:hover { background-color:
red; } ` 13
🔥 Hono v4 14
🔥 Hono v4 • Static Site Generation • Client Components
• File-based Routing 15
Static Site Generation • ੩తͳWebϖʔδΛॻ͖ग़ͤΔΑ͏ʹͳͬͨ • viteΛͬͯΊͬͪΌշదʹ։ൃͰ͖Δ • Β͍͠ɺ·ͩࢼ͍ͯ͠ͳ͍ 16
Client Components • hono/jsx͕ΫϥΠΞϯτͰಈ͘Α͏ʹͳͬͨ • ΫϥΠΞϯτͰಈ͘͠hooks͑Δ • ReactΛΈࠐΜͩͷͰͳࣗ͘લ࣮Β͍͠ʢʂʁʣ • ΊͪΌͪ͘Ό͍ܰ
17
εήʔʂ 18
File-based Routing • HonoXͱ͍͏ผύοέʔδ • ϑΝΠϧͷஔ͖ॴΛݩʹΑ͠ͳʹϧʔςΟϯάͯ͘͠ΕΔ • ϋΠυϨʔγϣϯ͢Δɾ͠ͳ͍Λ͚ΒΕΔ 19
✅ ͬͯΈͨ 20
✅ ͬͯΈͨ • TodoAppΛ࡞ͬͯΈͨ • DBͷอଘ໘ͳͷͰׂѪɺϝϞϦ্ʹอଘ͢Δ͚ͩ 21
ૉࡐͷຯΛੜ͔ͨ͠TodoApp 22
✅ Ͱ͖ͨʂ 23
✨ վળͯ͠ΈΔ • ݟ͕ͨΠϚΠνͳͷͰhono/cssͰ͖Ε͍ʹ͢Δ • νΣοΫϘοΫεͷ࣮ΛαϘͬͯͨͷͰɺνΣοΫͨ͠Βอଘ͢Δ Α͏ʹ͢Δ 24
✨ Ͱ͖ͨʂ 25
γϟϨΦπͳTodoApp 26
😭 ϑΥʔϜΘ͔ΒΜ • ϑΥʔϜΛ͏ػձ͕গͳ͔ͬͨͷͰϑΥʔϜͷ͜ͱ͕Θ͔Βͳ͍ • PUT/DELETEͰ͖ͳ͍ͷʁ • νΣοΫϘοΫεԡͨ࣌͠ʹformΛૹ৴͢ΔͷͲ͏͢Μͷʁ • etc...
27
ল • HTMLΛษڧ͢͜͠ͱʹͨ͠ • جૅతͳ͕͓ࣝΖ͔ͦʹͳͬͯ ͍ΔͷΛײͨ͡ • HTML5ͷࠒ͔Β͕ࣝࢭ·ͬͯ ͍Δͷײͨ͡ 28
📚 ·ͱΊ • Hono͍͍ͧ • ͍ɺ͍ܰɺΘ͔Γ͍͢ • Web Standardͱͯେࣄ 29