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
300
僕がつくった48個のWebサービス達
yusukebe
20
17k
Honoの来た道とこれから
yusukebe
20
3.2k
Honoとhtmx
yusukebe
6
1.8k
Cloudflare Workersの環境を再現することについて
yusukebe
7
1k
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
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
150
Realtime API 入門
riofujimon
0
150
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
240
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.8k
CSC509 Lecture 13
javiergs
PRO
0
110
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
CSC509 Lecture 11
javiergs
PRO
0
180
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
700
Featured
See All Featured
A Tale of Four Properties
chriscoyier
156
23k
Side Projects
sachag
452
42k
How to Ace a Technical Interview
jacobian
276
23k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
A designer walks into a library…
pauljervisheath
204
24k
Why Our Code Smells
bkeepers
PRO
334
57k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
What's in a price? How to price your products and services
michaelherold
243
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Producing Creativity
orderedlist
PRO
341
39k
Designing for Performance
lara
604
68k
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