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
JS RPCを理解する
Search
Yusuke Wada
May 17, 2024
Programming
5
680
JS RPCを理解する
Cloudflare Meet-up Osaka #4
May 17, 2024. Yusuke Wada
Yusuke Wada
May 17, 2024
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
Honoとhtmx
yusukebe
6
1.8k
Cloudflare Workersの環境を再現することについて
yusukebe
7
990
Hono v4
yusukebe
11
4.8k
Hono v3 and v4
yusukebe
4
3.8k
The power of Web-standards
yusukebe
4
1.7k
実践エッジユースケース
yusukebe
7
2.2k
Other Decks in Programming
See All in Programming
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
subpath importsで始めるモック生活
10tera
0
300
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
Better Code Design in PHP
afilina
PRO
0
120
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
870
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Click-free releases & the making of a CLI app
oheyadam
2
110
Featured
See All Featured
Scaling GitHub
holman
458
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
How STYLIGHT went responsive
nonsquared
95
5.2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Agile that works and the tools we love
rasmusluckow
327
21k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
RailsConf 2023
tenderlove
29
900
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Transcript
+431$Λཧղ͢Δ $MPVE fl BSF.FFUVQ0TBLB .BZ :VTVLF8BEB
ࣗݾհ w :VTVLF8BEB w 8FCGSBNFXPSLEFWFMPQFS w %FWFMPQFS"EWPDBUF!$MPVE fl BSF w
#PLFUFDPGPVOEFS w $SFBUPSPG)POP w IUUQTHJUIVCDPNZVTVLFCF IUUQTIPOPEFW
ࣗݾհΩʔϫʔυ
લஔ͖
None
ΞδΣϯμ લஔ͖ ·ͣ#JOEJOHTΛཧղ͢Δ 4FSWJDF#JOEJOHT +431$
ྫ 4NBSU1MBDFNFOUͱͷະདྷ ϚʔέοτϓϨΠεʁ
લஔ͖
͜ͷൃද$MPVEGMBSF8PSLFSTͷ৽ػೳ ʮ+431$ʯʹ͍ͭͯཧղ͢ΔͨΊͷͷͰ͢ ʢΘΓͱ֓೦తͳͰ͢ʣ
31$ͱʁ
31$ͱ w 3FNPUF1SPDFEVSF$BMM w ԕִʢϦϞʔτʣʹ͋ΔίϯϐϡʔλͷؔʢϓϩγʔδϟʣΛ࣮ߦʢίʔ ϧʣ͢Δख๏ w ྫ w H31$
w +40/31$ w 9.-31$
Α͏ʢ8PSLFSʣͷݺͼग़ ͠ํʹ͍ͭͯͷΛ͠·͢
,FOUPOࢯͷϒϩά w ݄%FWFMPQFS8FFLͰൃද͞Εͨͭͷϒϩάهࣄ w ʮ8IZ8PSLFSTFOWJSPONFOUWBSJBCMFTDPOUBJOMJWFPCKFDUTʯ w ʮ8FWFBEEFE+BWB4DSJQUOBUJWF31$UP$MPVE fl BSF8PSLFSTʯ w
"*ͷΞοϓσʔτ%ͷ("ʹӅΕͨςΫχΧϧͳهࣄ w ͜Ε͔Βհ͢Δ+431$Λཧղ͢Δ伴ͱͳΔ
IUUQTCMPHDMPVE fl BSFDPNXPSLFSTFOWJSPONFOUMJWFPCKFDUCJOEJOHT l8IZ8PSLFSTFOWJSPONFOUWBSJBCMFTDPOUBJOMJWFPCKFDUTz
IUUQTCMPHDMPVE fl BSFDPNKBWBTDSJQUOBUJWFSQD l8FWFBEEFE+BWB4DSJQUOBUJWF31$UP$MPVEGMBSF8PSLFSTz
͜Ε͔Β͢͜ͱ͜ͷϒ ϩάهࣄʹجͮ͘
·ͣ#JOEJOHTΛཧղ͢Δ
#JOEJOHTͱʁ w $MPVE fl BSFͷϓϩμΫτ8PSLFST͔Βͭͳ͙ͨΊͷ֓೦ͱखஈ w ྫ w "*ɺ"OBMZUJDT&OHJOFɺ#SPXTFS3FOEFSJOHɺ%ɺ &OWJSPONFOU7BSJBCMFTɺ)ZQFSESJWFɺ,7ɺ2VFVFTɺ3ɺ
3BUF-JNJUJOHɺ7FDUPSJ[F
֤छϓϩμΫτ
,7Λ͏߹ͷ࣮
FOW.:@,7 ,7ΦϒδΣΫτͦͷͷʹͳ͍ͬͯΔ ྫHFU QVU EFMFUF ͕͑Δ
ଞʹॻ͘͜ͱXSBOHMFSUPNMͷઃఆ͚ͩ ίʔυͰͲͷΑ͏ͳ໊લͰݺͼग़͔͢ʁ ࡞ͬͨ,7ͷ*%
͠ɺ#JOEJOHTΛΘͳ ͔ͬͨΒͲ͏ͳΔ͔ʁ
4%,ΛJNQPSU ڥม͔ΒΩʔΛऔಘ ֎෦"1*ଓ औಘͨ͠ΦϒδΣΫτͰૢ࡞
ͭͷ ηΩϡϦςΟΩʔͷཧɺΩʔͷॲཧΛॻ͔ͳ͍͚ͯ͘ͳ͍ ։ൃऀମݧ4%,ΛΘͳ͍ͱ͍͚ͳ͍ɺADPOOFDUAͷॲཧඞཁ
ͭΛղܾ͍ͯ͠Δͷ͕#JOEJOHTͰ͋Δ ೝূΩʔΛॻ͘ඞཁ͕ͳ͍ 4%,ͰΦϒδΣΫτΛ࡞Βͣ+4ͷϝιουͰݺΔ
4FSWJDF#JOEJOHTͱʁ
8PSLFS" 8PSLFS# ෦௨৴ͳͷͰ͍ $MPVE fl BSFωοτϫʔΫ 8PSLFS"͔Β#Λͭͳ͙
ެࣜͷਤ IUUQTEFWFMPQFSTDMPVE fl BSFDPNXPSLFSTSVOUJNFBQJTCJOEJOHTTFSWJDFCJOEJOHT
࣮ w ΠϯλʔφϧͳGFUDIΛ͔͚Δ
4FSWJDF#JOEJOHTͷϢʔεέʔε w ϑΝΠϧ༰ྔ੍ݶΛආ͚Δ w ͷׂ w ϚΠΫϩϑϩϯτΤϯυ IUUQTCMPHDMPVE fl BSFDPNCFUUFSNJDSPGSPOUFOET
8FCϖʔδΛύʔπʹ͚Δ
ͦΕͧΕͷύʔπΛ8PSLFSʹͯ͠4FSWJDF#JOEJOHTͰͭͳ͙
Α͍ɻ͕ɺ࣮ͦΜͳʹ ΘΕ͍ͯͳ͍ ͍উख͕ѱ͍ʜʁ
+431$
,FOUPOͷϒϩάهࣄͱڞʹެ։ IUUQTEFWFMPQFSTDMPVE fl BSFDPNXPSLFSTSVOUJNFBQJTSQD
+431$Λཧղ͢ΔͨΊͷͭͷΞϓϩʔν #JOEJOHT8PSLFSΛΧελϜ#JOEJOHTͱͯࣗ͠Ͱͭ͘ ΕΔ 4FSWJDF#JOEJOHT4FSWJDF#JOEJOHT͕؆୯ʹॻ͚Δ ͜ͷͭΛຬͨ͢ͷ͕+431$
8PSLFS" 8PSLFS# #JOEJOHͱͯ͠ݺͼग़ͤΔ 4FSWJDF#JOEJOHTͰܨ͍ͰΔ
ʮిʯͷ߹ #JOEJOHTʮిʯͱ͍͏#JOEJOHʢ8PSLFSͰ࣮͞Ε ΔʣΛ࡞ΕΔ 4FSWJDF#JOEJOHTʮిʯͱ͍͏8PSLFSΛ؆୯ʹݺͼ ग़ͤΔ
8PSLFS" ి #JOEJOHͱͯ͠ݺͼग़ͤΔ 4FSWJDF#JOEJOHTͰܨ͍ͰΔ DOW$"-$BEE SFUVSOB C
࣮ํ๏
ిͷ࣮ݺͼग़͠Մೳͳ8PSLFSΛ࡞Δ 8PSLFS&OUSZQPJOUΛFYUFOETͨ͠ΫϥεΛFYQPSU͢Δ͚ͩ
ݺͼग़ͯ͠ΈΑ͏
XSBOHMFSUPNMʹఆٛΛՃ͢Δ ίʔυͰͲͷΑ͏ͳ໊લͰݺͼग़͔͢ʁ ݺͼग़͢8PSLFSͷ໊લ
8PSLFS͔Βݺͼग़͢ ͜͜
ͭ·Γʜ $BMDͱ͍͏αʔϏεΛ$"-$ͱ͍͏#JOEJOHͱͯ͠ར༻͢Δ ݺͼग़͢8PSLFSͱ$BMDؒ4FSWJDF#JOEJOHTͰଓ͞ΕΔ ͞Βʹɺ+BWB4DSJQUωΠςΟϒͳݺͼग़͕͠Ͱ͖Δ ʮ+4/BUJWF31$ʯ
5ZQF4DSJQUͷܕ͕ͪΌΜͱͭ͘
+431$Λ͏ ͱخ͍͜͠ͱ
+431$ͩͱ#JOEJOHTͷͭΛڗडͰ͖Δ ηΩϡϦςΟͷߟྀݺͼग़͠ʹγʔΫϨοτ͕ඞཁͳ͍ ։ൃऀମݧ#JOEJOHͱͯ͠ಛʹ+454ωΠςΟϒʹݺΔ
ྫ
8FC #MPH #JOEJOHͱͯ͠ݺͼग़ͤΔ 4FSWJDF#JOEJOHTͰܨ͍ͰΔ DOW#-0(DSFBUF1PTU ECFYFDVUF A*/4&35*/501PTUTʜA ϒϩάαʔϏε w %#Λѻ͏αʔϏεͱͦΕΛݺͼग़͢6*
ίʔυྫ
4NBSU1MBDFNFOUͱͷະདྷ
࣮͜ͷ+431$ ͭͷϝϦοτʹՃ͑ͯ͏ͻͱͭΞπ͍ͷ͕ʜ
4NBSU1MBDFNFOU ͱҰॹʹ͏݅
4NBSU1MBDFNFOUͱʁ w ϢʔβʔଆΑΓόοΫΤϯυʢΦϦδϯʣʹ8PSLFS͕͍ۙ ํ͕ޮతͳ͜ͱ͕͋Δ w 8PSLFSͷॴΛΑ͠ͳʹͯ͘͠ΕΔ
͍ΘΏΔʮΤοδʯͷΑ͞ w Ϣʔβʔͱ8PSLFS͕͍ۙ Ϣʔβʔ 8PSLFS ͍ۙ
8PSLFS͕Ϣʔβʔʹ͍͚ۙͲσʔλϕʔε͔Βԕ͍ w σʔλϕʔεͱͷΓͱΓ͕ଟ͍߹ඇޮ
8PSLFSΛσʔλϕʔεͷۙ͘ʹஔ͜͏ w Ϣʔβʔ͔Βԕ͍͚ͲɺσʔλϕʔεͱͷΓͱΓ͕ଟ͍ ߹ޮత
ΤϯτϦʔϙΠϯτ͝ ͱʹϩέʔγϣϯ͕࠷ద Խ͞ΕΕخ͍͠
ϒϩάαʔϏεͷ߹5PLZPฤ w #MPH%#͕͍ؒ #MPH 8FC Ϣʔβʔ %# 5PLZP 5PLZP 5PLZP
-POEPO ͍ ͍ ͍
ϒϩάαʔϏεͷ߹-POEPOฤ w Ϣʔβʔ8FC͕͍ؒ #MPH 8FC Ϣʔβʔ %# 5PLZP -POEPO -POEPO
-POEPO ͍ ͍ ͍
ϒϩάαʔϏεͷ߹ཧ w %#͕Ϣʔβʔ͔Βԕ͍߹ɺ#MPH͚ͩ%#ʹ͍ۙͱྑ͍ #MPH 8FC Ϣʔβʔ %# 5PLZP 5PLZP -POEPO
-POEPO ͍͔ۙΒ͍ ෦͔ͩΒ͍ ͍͔ۙΒ͍
4FSWJDF#JOEJOHTͷྫ w ͏͢ͰʹରԠ͍ͯ͠Δ
ཧతͳॻ͖ํ "1"$ʹ͋Δ%#Λऔಘ͢Δ 4FSWJDF#JOEJOHͰଓ͞Εͨ#-0(Λݺͼग़͢
ϚʔέοτϓϨΠεʁ
#JOEJOHTϚʔέοτϓϨΠε͕Ͱ͖Δ͔ʁ w Ϣʔβʔ͕࡞ͬͨΧελϜ#JOEJOHT͕ྲྀ௨͢Δ w ݱࡏ࡞ͬͨΞΧϯτͰ͔͑͠ͳ͍ w ྫ w %JTDPSEϘοτ#JOEJOH w
4MBDLϘοτ#JOEJOH w 4USJQFܾࡁ#JOEJOH
͓͞Β͍
+431$Ͱخ͍͜͠ͱ w ηΩϡϦςΟͷߟྀ w ։ൃऀମݧͷ্ w 4NBSU1MBDFNFOUͱΈ߹ΘͤΒΕΔ w ϚʔέοτϓϨΠεͰເ͕͕Δ
༡ΜͰΈͯͩ͘ ͍͞
5IBOLT