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
#ionic_jp 同人誌即売会の回線事情をIonic + PWAで手軽に解決してみる
Search
potato4d(Takuma HANATANI)
January 28, 2018
Programming
0
390
#ionic_jp 同人誌即売会の回線事情をIonic + PWAで手軽に解決してみる
2018/01/28 に #ionic_jp のLTにて発表したスライドです。
potato4d(Takuma HANATANI)
January 28, 2018
Tweet
Share
More Decks by potato4d(Takuma HANATANI)
See All by potato4d(Takuma HANATANI)
どうせキレイに書けない処理は逆にAIに書いてもらうほうが良い説 / #kyotojs 22
potato4d
3
310
TSX First な Zero-Runtime SSG potato4d/dodai とその仕組み / owned static site generator #kyotojs
potato4d
1
2k
Vue.js with TSX - From Vue 2.x to Vue 3 #v_tokyo11
potato4d
9
4.7k
終わりゆく Vue 2.x 時代の状態設計のアンサー - Vue 3 の Provider への期待 / The Last Architecture of the Vue 2.x
potato4d
25
6.8k
Web Worker を使ってブラウザ上でポケモンの画像を解析したい! / Pokemon recognition from screenshots in browser using web worker
potato4d
0
1.2k
Firebase & Google Cloud によるサーバーレス帳票管理 #FJUG / Serverless Architecture in Candy
potato4d
8
3.6k
NestJS meetup Tokyo Opening Talk / What is NestJS? #nestjs_meetup
potato4d
11
3.9k
私たちはなぜ SPA で開発するのか / Why you choose SPA
potato4d
39
26k
Amplify Console 誕生以来本番運用しつづけてわかったこと #awswakaran_tokyo
potato4d
6
3.4k
Other Decks in Programming
See All in Programming
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
役立つログに取り組もう
irof
28
9.6k
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
Arm移行タイムアタック
qnighy
0
310
CSC509 Lecture 11
javiergs
PRO
0
180
Ethereum_.pdf
nekomatu
0
460
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
EventSourcingの理想と現実
wenas
6
2.3k
Macとオーディオ再生 2024/11/02
yusukeito
0
370
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Jakarta EE meets AI
ivargrimstad
0
520
Featured
See All Featured
The Cult of Friendly URLs
andyhume
78
6k
A designer walks into a library…
pauljervisheath
203
24k
Side Projects
sachag
452
42k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Practical Orchestrator
shlominoach
186
10k
We Have a Design System, Now What?
morganepeng
50
7.2k
Being A Developer After 40
akosma
86
590k
Designing the Hi-DPI Web
ddemaree
280
34k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Teambox: Starting and Learning
jrom
133
8.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Optimizing for Happiness
mojombo
376
70k
Transcript
ಉਓࢽଈചձͷճઢࣄΛ*POJD 18"Ͱखܰʹղܾͯ͠ΈΔ ɹ#ionic_jp 2018.01.27 HANATANI Takuma LT 5#'0⒐JOF7JFXFSΛ ࢧ͑Δٕज़ ࣌ؒͰ࡞ͬͨ1SPHSFTTJWF8FC"QQMJDBUJPOͷཪଆ
ࠓճͷLT͕ Կ͔Βͳ͍ਓ͕͠·͢
ࣗݾհ • Ֆ୩ຏ a.k.a. @potato4d • ϑϦʔϥϯεͷϑϩϯτΤϯυΤϯδχΞ • ීஈຆͲVue.js/Nuxt.jsͰࣄͯ͠·͢ •
Vue.js jpελοϑ, FRONTEND CONFERENCE 2017࣮ߦҕһ, etc… • PWAʹڧ͍Nuxt.jsͷهࣄͱ͔ॻ͍ͯ·͢ • https://html5experts.jp/potato4d/24346/
None
None
@potato4d ࠓ͙͢ϑΥϩʔʂʂʂ
ͬͨ͜ͱ
IonicͰಉਓΠϕϯτͷ ϏϡʔΞʔΛ࡞ͬͨ
None
ࣗدߘͨ͠
࣍ࣗͰग़͢
TBF03 Offline Viewer • ٕज़ॻయ03ͷΦϑϥΠϯϏϡʔΞʔ • ͷαʔΫϧҰཡͷදࣔػೳ • ๚༧ఆͷαʔΫϧͷϒοΫϚʔΫػೳ •
αʔΫϧҰཡͷΦϑϥΠϯӾཡػೳ
Կނ͜ΕΛ࡞ͬͨͷ͔
͍ͭίϛέߦ͚͘Ͳ ճઢऴΘΔʢࢮ͵ʣΑͳ
ٕज़ॻయࠞࡶ૿ͯ͠Δ͠ কདྷతʹ͋Δ͔͠Εͳ͍
ͳΒ͜Ε͔Β͑Δ ʮଈചձ͚ͷΦϑϥΠϯΞϓϦͷ࡞Γํʯ Λ͓֮͑ͯ͜͏
ͳʹΛ͔͓ͭ͏ʁ
ී௨ͳΒ ΦϑϥΠϯʹΞϓϦ
͚Ͳ
ࠓͳΒ PWAͱ͍͏બࢶ
Ͱ͖ΕϥΠτʹ࡞Γ͍ͨ
ͦΕͳΒWebٕज़Ͱ
PoCͳͷͰUIαΫοͱ
ͦΜͳ࣌ʹ
None
IonicͰͰ͖ͦ͏ͳ͜ͱ
ָʹUI͕Ίͦ͏
PWAରԠ͕ڧͯ͘SWʹڧͦ͏
Service Worker
Service Worker
Service WorkerͰͰ͖Δ͜ͱ
WebαΠτΛ
ωΠςΟϒΞϓϦͷΑ͏ʹ
Service WorkerͰͰ͖Δ͜ͱ
Service WorkerͰͰ͖Δ͜ͱ • HTTPϦΫΤετΛΩϟονͯ͠ଞͷॲཧΛड͚࣋ͭ • ྫ͑WebαΠτͷભҠઌͷ༰ΛઌʹͱͬͯരͰಈ͔͢ • ΦϑϥΠϯ࣌ʹαʔόʔͷΘΓʹίϯςϯπΛฦ٫͢Δ • Push
Nofication API Λୟ͘ʢWebϓογϡ௨ͷ࣮͕Մೳʣ • ͦͷଞ༷ʑͳʮWebΞϓϦΛωΠςΟϒΞϓϦͷΑ͏ʹ͑Δॲཧʯ
ࣗͰॻ͘ͱμϧ͍
https://github.com/potato4d/potato4d.me/blob/423a064d9f54131f93b57ca22c5d5d57bdc4edc7/static/service-worker.js
ຊʹࣗͰॻ͘ͱμϧ͍
IonicσϑΥϧτͰ ͍ͭͯΔͷͰઃఆΛॻ͚ͩ͘
ྑͦ͞͏ʂ
ͬͯΈΑ͏
in ϧϊΞʔϧ
ͦͷ··ϧϊΞʔϧͰॻ͘͜ͱ 3࣌ؒ…
ʂ
None
IonicͳΒαΫοͱ ϓϩτλΠϓΛ࡞ΕΔ
طଘͷ֓೦ͱPWAͷϚονΛ ࢼ͢ͷʹΦεεϝ
ͬͯΈΔϝϦοτ
ྫ͑ಉਓࢽଈചձͷ߹……
ΠϕϯτެࣜαΠτΘΓʹ ؾܰʹ࡞ΕΔ ӡӦऀ͕……
αʔΫϧҰཡϖʔδͷΘΓʹ ίϛϡχέʔγϣϯͷʹ ӡӦऀ͕……
ಛʹΞχϝܥͷ߹ ݸਓͷझຯझΦϑϥΠϯͰอ࣋ ࢀՃऀͱͯ͠……
ϥΠτʹࢼͤΔPWAڥ
None
࠷ޙʹIonicࣗମΛͬͨॴײ
ྑ͞ॻ͍ͨͷͰͦΕҎ֎
ͭΒ͔ͬͨ͜ͱ
2ͭ͋ͬͨ
1ͭΊ
service-worker.jsͷ σϑΥઃఆͰ٧Μͩ
ઃఆΛnetworkFirstʹ͠ͳ͍ͱͩΊ https://github.com/potato4d/tbf03-offline/commit/031900744a63a3e192b83f0b91957484f8425e2f#diff-e81c54751ff186bde816ffd37408c102
2ͭΊ
ʢݸਓͷײͰ͢ʣ
Angularґଘ
ʢݸਓͷײͰ͢ʣ
IonicͰϥΠτʹ࡞Γ͍ͨ
Angularී௨ʹେ͖͍
ʢݸਓͷײͰ͢ʣ
ͭΒ͍
ผʹViewer࡞Δ࣌ʹRx͍Βͳ͍
ʢݸਓͷײͰ͢ʣ
ͭΒ͍
Macbook͍ͳͷͰ Angular + IonicϥΠϒϦϩʔυ͕2
ͭΒ͍
ࡶͳΞϓϦ ୯ҰͷStoreͱaxios͕͋Ε͍͍
ʢݸਓͷײͰ͢ʣ
IonicָͳͷͰ ࡶͳΞϓϦͰ͍͍ͨ
ʢݸਓͷײͰ͢ʣ
ແବʹͰ͔͍ͷͰͭΒ͍
ʢݸਓͷײͰ͢ʣ
UIίϯϙʔωϯτ͚ͩ΄͍͠
ʢݸਓͷײͰ͢ʣ
ଞͷFw൛ͷIonicൃల్্ͬΆ͍͠ Ionic wayͰͳͦ͞͏
͜͏͍͏ͭҰ൪ਪͯ͠Δͷʹ ͔ͬΔͷ͕ਖ਼ղ
Ionic + Reactͱ͔Ionic + VueͰ ແཧ͢Δͳ
ʢݸਓͷײͰ͢ʣ
࠷ڧʹ͍ͨ͠ͳΒSwiftΛॻ͚
ʢݸਓͷײͰ͢ʣ
૯ධ
• WebϕʔεͷΞϓϦΛ࡞ΔͨΊʹඞཁͳͷ͕ຊͷҙຯͰἧ͍ͬͯΔ • ී௨ͷʮϑϧελοΫͳ։ൃηοτʯ։ൃΑΓͷ͕ଟ͘ɺࢼ͠ʹ࡞ ΔʹͭΒ͍͚ͲɺIonicUI·Ͱἧ͍ͬͯΔͷͰ୯ମͰ։ൃͰ͖Δ • PWAͷΑ͏ͳ৽͍ٕ͠ज़ʹόονϦରԠ͍ͯͯ͠৽͍͜͠ͱΛΔʹ ྑͦ͞͏ • ΞϓϦԽ͍ͨ͠߹ΞϓϦԽͰ͖Δͷྑͦ͞͏ɻͨͩɺPWAͰͬͯ
͍͘ͷʹྑ͍ͷͩͱ͍͏ҹ
• ׂΓͱϥΠτʹ͑Δ͚ΕͲཪʹ͋Δͷ͕େ͖͍ؾ͕͢Δɻ • WebΞϓϦΛ࡞Δ࣌ʹ͍͖ͳΓʮRails͡Ί·ͨ͠ʂʯͷۭؾײͱಉ͡ ͷΛײ͡Δ • มʹΞϓϦ͕ਪ͞Εؾຯͳ෩ைͲ͏ͳΜͩΖ͏ɻRNΈ͍ͨͳωΠςΟ ϒίʔυ͕ಈ͘ڧྗͳڝ߹͕ଟ͍தɺͦ͜ओઓ͡Όͳ͍ؾ͕͢Δ • গͳ͘ͱIonicͰຊ֨తͳΞϓϦΛ։ൃ͍ͨ͠ͳ͊ͱࢥ͏͔ͱݴΘΕΔͱ
ඍົ
• Ionic + ҙͷϑϨʔϜϫʔΫͰ࡞ΕΔͱͬͱྑ͍͔ • Service Workerɺॻ͖͡Όͳͯ͘Ӆṭ͞ΕΔͱͪΐͬͱϋϚΓ͕Θ͔Γ ͮΒ͍ͷͰ࣮֬ʹωοτϫʔΫ༏ઌͰ͋ͬͯ΄͔͔ͬͨ͠ • ͪΐͬͱ࡞ͬͯΈΔʹྑ͍ͱࢥ͏ʢσβΠϯΛͪΌΜͱ͍ͨ͠ͳΒී௨
ʹࣗͰSPAΛΜͩ΄͏͕ྑͦ͞͏ʣͷͰϓϩτλΠϐϯά࿏ઢͰͬ ͱྲྀߦΔͱྑ͍͔
গ͠લͷະདྷΛ
ΠϚͷٕज़ͱͯ͠ؾܰʹ͏
͕ͦ͜Ionic
એ
Service WorkerόϦόϦͳ αʔϏε։ൃखͬͯ·͢
Service WorkerͰͷ ϓογϡ௨Λ3ͰಋೖͰ͖Δʂ
Push7
ͪΌΜͱߟ͑ͯಋೖ͠ͳ͍ͱ ʮअѱͳϓογϡ௨ʯʹͳΔͷͰҙʂ
※Push7વΔ͖λΠϛϯά ͰͷߪಡڐΛਪ͍ͯ͠·͢
None
͏·͘׆༻ͯ͠ Progressive Enhancement ͍ͯ͜͠͏
Thanks!