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
WordPressユーザーのためのAngular & Progressive Web Appsの話
Search
Yosuke Onoue
October 09, 2016
Technology
1
930
WordPressユーザーのためのAngular & Progressive Web Appsの話
Yosuke Onoue
October 09, 2016
Tweet
Share
More Decks by Yosuke Onoue
See All by Yosuke Onoue
Think About Front-end Web Development with Rust
likr
2
470
Yewにおけるoff-the-main-thread
likr
1
700
行政事業レビューデータの可視化 / Visualization of Japan's National Budget with JUDGIT!
likr
1
190
モダンJavaScript再入門 / Re-introduction to Modern JavaScript
likr
23
11k
Web-based Data Visualization with Rust and WebAssembly
likr
4
5.5k
Introduction to Graph Drawing
likr
0
450
20190707Ionic_Meetup.pdf
likr
0
370
About the end of the web
likr
2
470
Rust + WebAssemblyで広がるWebの未来
likr
16
6.6k
Other Decks in Technology
See All in Technology
AIチャットボット開発への生成AI活用
ryomrt
0
170
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
200
強いチームと開発生産性
onk
PRO
34
11k
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
290
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
380
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
190
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
130
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Writing Fast Ruby
sferik
627
61k
The Language of Interfaces
destraynor
154
24k
Rails Girls Zürich Keynote
gr2m
94
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Faster Mobile Websites
deanohume
305
30k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Producing Creativity
orderedlist
PRO
341
39k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Transcript
WordPressϢʔβʔͷͨΊͷ Angular & Progressive Web Appsͷ ͓ͷ͏͑ (@_likr)
ࣗݾհ • ͓ͷ͏͑ (@_likr) • ژେֶ ֶࡍ༥߹ڭҭݚڀਪਐηϯλʔ ࡦͷͨΊͷՊֶϢχοτ ಛఆॿڭ •
ng-kyotoΦʔΨφΠβʔɺGDGਆށελοϑ • ՄࢹԽɺ࠷దԽɺΞϧΰϦζϜͷݚڀ • WordPressॳ৺ऀ
ng-kyoto • ژΛத৺ʹ׆ಈ͢ΔAngularͷϢʔβʔίϛϡχςΟ • https://ng-kyoto.github.io/ • 2.0.0-alpha.31ͩͬͨͷͰͦΖͦΖߋ৽͍ͨ͠…
ࠓͷ • WP REST APIͷԬຊ͞Μ͕͍ͯ͠Δͣ… • ϑϨʔϜϫʔΫͷ͍ํطʹઆ໌͞Ε͍ͯΔͣ… • Progressive Web
AppsͱAngularͷΛ௨ͯ͡ɺ ࡢࠓͷϑϩϯτΤϯυٕज़͕ɺࠓͲ͔͓͜͏ͱ ͍ͯ͠Δͷ͔Λͬ͘͟Γհ͢Δ • ͜Ε͔ΒϑϩϯτΤϯυΛ࢝ΊΔਓ͕͙͢ʹ࠷৽ͷ τϨϯυΛऔΓೖΕΔͨΊͷπʔϧհ
࣍ • Progressive Web Appsͷ • Angularͷ • Blog࡞ͬͯΈͨ •
·ͱΊ
࣍ • Progressive Web Appsͷ • Angularͷ • Blog࡞ͬͯΈͨ •
·ͱΊ
Progressive Web Apps • https://developers.google.com/web/progressive- web-apps/ • WebαΠτͱωΠςΟϒΞϓϦͷ ͍͍ͱ͜औΓΛͨ͠WebΞϓϦ •
Progressive Enhancement • ߴ͍ϢʔβϏϦςΟͷ࣮ݱ • ϏδωεϑϨϯυϦʔ
PWAͰͰ͖Δ͜ͱ • ΦϑϥΠϯԽ • Πϯλʔωοτଓͳ͠Ͱͷར༻ • දࣔͷߴԽ • Push௨ •
ΞϓϦͷ࠶๚Λଅਐ • App Install Banner • ϗʔϜը໘ͷγϣʔτΧοτՃ • ঃʑʹΞϓϦͷΑ͏ʹͳΔʂ
PWAͷProgressive Enhancement • WebαΠτʹΞΫηε ˠ ΩϟογϡʹΑΔදࣔͷߴԽ ˠ γϣʔτΧοτͷՃ ˠ Push௨
ͳͥPWAʁ • Ϣʔβʔ͕ϞόΠϧΞϓϦΛ༻͢Δ࣌ؒݶΒΕ͍ͯ Δ͕ɺۃҰ෦ͷਓؾΞϓϦʹׂ͔ΕΔ͕࣌ؒଟ͍ ˠ ΄ͱΜͲͷϞόΠϧΞϓϦͷ༻ඇৗʹ͍ ˠ Ϣʔβʔ͕ΑΓଟ͘ར༻͢ΔWebαΠτʹ ɹωΠςΟϒΞϓϦͷརΛऔΓࠐΉ
PWAΛࢧ͑ΔWebٕज़ • Service Worker https://www.w3.org/TR/service-workers/ • Web App Manifest https://www.w3.org/TR/appmanifest/
ؔ࿈Ωʔϫʔυ • Responsive Design • RAIL Performance Model • Web
Storage / IndexedDB • ϞδϡʔϧγεςϜ • webpackɺSystemJSɺrollup.jsɺ… • ϑϩϯτΤϯυϑϨʔϜϫʔΫɺϥΠϒϥϦ • AngularɺPolymerɺReactɺ…
Service Workerͱ • Webϖʔδ(ϝΠϯεϨουɺUIεϨου)ͱ ಠཱͯ͠εΫϦϓτΛಈ࡞ͤ͞ΔΈ • ωοτϫʔΫϦΫΤετΛϑοΫ • ΩϟογϡΛͬͯϨεϙϯε •
ϦΫΤετΛमਖ਼ • αʔόʔPushΛड͚ͯ௨Λදࣔ • postMessageͰϝΠϯεϨουͱ௨৴ • HTTPSͰͷΈಈ࡞ (localhostΛআ͘)
ͳͥΦϑϥΠϯWebΞϓϦʁ • ϞόΠϧڥͷରԠ • ௨৴ͷෆ҆ఆ͞ • ௨৴ͷޮԽ • ޫෆมʂ •
ΦϑϥΠϯɾϑΝʔετͷࢥͱ࣮ફ by നੴढ़ฏ http://www.slideshare.net/shumpei/thought-and- practice-of-offline-first
Fetchઓུ • The offline cookbook https://jakearchibald.com/2014/offline-cookbook/ • Cache only •
Network only • Cache, falling back to network (cache first) • Cache & network race (fastest) • Network falling back to cache (network first) • …
sw-precache • https://github.com/GoogleChrome/sw-precache • JavaScript·ͨઃఆϑΝΠϧ͔Β Service WorkerίʔυΛੜ • Α͘͏Fetchઓུ͕࣮ࡁΈ •
networkFirst • cacheFirst • fastest • cacheOnly • networkOnly
ࢀߟࢿྉ • PWAϋϯζΦϯษڧձ @ GDGਆށ 2016/7/30 https://speakerdeck.com/likr/gdgshen-hu- progressive-web-apphanzuonmian-qiang-hui • Codelabs
https://codelabs.developers.google.com/pwa-dev- summit
࣍ • Progressive Web Appsͷ • Angularͷ • Blog࡞ͬͯΈͨ •
·ͱΊ
Angular • Google͕த৺ʹ։ൃ͢ΔΦʔϓϯιʔεͷ ϑϩϯτΤϯυϑϨʔϜϫʔΫ • https://angular.io/ • Angular 2.0 ϦϦʔε
Angular 2.0ͷಛ • ύϑΥʔϚϯε • ޮྑ͍มߋݕ • AoTίϯύΠϧ • ҆શੑ
• TypeScript࠾༻ʹΑΔܕαϙʔτ • ςετϑϨϯυϦʔͳAPI (DI) • ੜ࢈ੑ • ϑϧελοΫϑϨʔϜϫʔΫ
Կނ Angular ? • εέʔϥϒϧ • ϋΠύϑΥʔϚϯεɺνʔϜ։ൃ • ް͍ίϛϡχςΟ •
׆ൃͳ։ൃɺଟͷϢʔβʔ • Webඪ४Λҙࣝͨ͠API • ShadowDOMɺObservableɺZonesɺ… • ઌઓ͑Δٕज़Λʹ͚ͭΔʂ
Angular CLI • CLI tool for Angular2 • https://github.com/angular/angular-cli •
Ͱ͖Δ͜ͱ • ComponentServiceͷੜ • Ϗϧυ • ϩʔΧϧαʔόʔͷىಈ • σϓϩΠ(GitHub Pages) • …
Hello World $ npm install -g angular-cli $ ng new
hello-angular $ cd hello-angular $ ng serve
ࢀߟใ • ng-japan Slack https://ng-japan-invite.herokuapp.com/ • Angular 2 ϋϯζΦϯ https://github.com/ng-japan/ng2-hands-on-seed
࣍ • Progressive Web Appsͷ • Angularͷ • Blog࡞ͬͯΈͨ •
·ͱΊ
ͬͯΈͨ • Angular & WordPress.com APIͰ࣮ͨ͠ϒϩά • https://likr.github.io/blog • https://github.com/likr/blog
• ͬͨ͜ͱ • Service WorkerʹΑΔΦϑϥΠϯରԠ • sw-precache༻ • هࣄnetwork firstͰऔಘ • ϗʔϜεΫϦʔϯͷՃ
ߏ • Angular 2.0 & Angular CLI • WordPress.com REST
API • https://developer.wordpress.com/docs/api/ • Pure.css • http://purecss.io/ • sw-precache • https://github.com/GoogleChrome/sw-precache • GitHub Pages
σϞ https://likr.github.io/blog/#/posts/62 https://likr.github.io/blog/#/posts
ࢀߟใ • for Angular 1 https://github.com/likr/wpapi-angular-example • for Angular 2
https://github.com/likr/wpapi-angular2-example https://github.com/likr/blog
࣍ • Progressive Web Appsͷ • Angularͷ • Blog࡞ͬͯΈͨ •
·ͱΊ
·ͱΊ • WP(or WordPress.com) REST APIʹڵຯΛ࣋ͬͨਓɺ AngularΛࢼͯ͠ཉ͍͠ʂ • কདྷΛݟਾ͑ͯɺઌઓ͑Δٕज़Λʹ͚Α͏ •
Angular CLIͱsw-precacheศར