Service Workersを使ったウェブアプリのアーキテクチャ / Web App Architecture on Service Workers
by
laiso
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
Service WorkersΛͬͨΣ ϒΞϓϦͷΞʔΩςΫνϟ
Slide 2
Slide 2 text
Beyond SPAs • https://developers.google.com/web/updates/2018/05/ beyond-spa
Slide 3
Slide 3 text
Stack Overflow PWA • StackOverflowϏϡϫʔ
Slide 4
Slide 4 text
Architecture in Stack Overflow PWA • Firebase Function • Express/NodeJS • Service Workers
Slide 5
Slide 5 text
Architecture in Stack Overflow PWA • 2֊ݐΞʔΩςΫνϟ(ςϯϓϨʔτΛڞ௨Խ) • Server-side Rendering(Express) • Web App in Service Workers
Slide 6
Slide 6 text
Web App in Service Workers • Workbox • fetch • Non-SPA
Slide 7
Slide 7 text
Workbox by @GoogleChrome • ΦϑϥΠϯΣϒΞϓϦͷͨΊͷϥΠϒϥϦ • Google's Web Developer Relations team
Slide 8
Slide 8 text
URLϧʔςΟϯάΛSWͰߦ͏
Slide 9
Slide 9 text
ϨεϙϯεϖʔδͷHTMLΛSW ͰΈཱͯΔ
Slide 10
Slide 10 text
ඞཁͳใΛfetch͢Δ
Slide 11
Slide 11 text
ैདྷͷΣϒΞϓϦͱͷൺֱ • Ԡ
Slide 12
Slide 12 text
SPAͱͷൺֱ • Ωϟογϡཁૉͷ੍ޚ
Slide 13
Slide 13 text
SSR: Express • GET /questions/:id • axiosͰAPI call (lru-cacheʹset) • HTMLΛΈཱͯͯ res.write()
Slide 14
Slide 14 text
SW: Workbox • GET /questions/:id (workbox-routing) • fetch() ͰAPI call • HTMLΛΈཱͯ (workbox-streams)
Slide 15
Slide 15 text
Web App in Service Workers • ϓϩάϨογϒʹ։ൃ͕Մೳ • NodeJSͰΣϒΞϓϦΛ࡞Δ • SW+WorkboxͰಈ͘Α͏ʹڞ௨Խ͢Δ
Slide 16
Slide 16 text
·ͱΊ: Service WorkersΛͬ ͨΣϒΞϓϦͷΞʔΩςΫνϟ • Σϒ͔Β৴͞ΕΠϯετʔϧ͞ΕΔ • ΩϟογϡͬͯHTMLͰUIΛΈཱͯΔ • ίϯςϯπࠩΛඇಉظʹfetchͰऔಘ͢Δ