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
Vue.js, PWA & The Subway Dilemma
Search
Ignacio Anaya
May 17, 2019
Technology
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Vue.js, PWA & The Subway Dilemma
Ignacio Anaya
May 17, 2019
More Decks by Ignacio Anaya
See All by Ignacio Anaya
Security is not a feature‼️
ianaya89
2
540
Rompiendo Paradigmas Otra Vuez! 🔨📜3️⃣
ianaya89
0
170
Security is not a feature!
ianaya89
1
400
What's next in Vue 3? 🖖 3️⃣
ianaya89
0
150
What's next in Vue 3? 🖖 3️⃣
ianaya89
0
310
PWA with PWF
ianaya89
0
69
Decentralizing the Web with JavaScript
ianaya89
0
170
hey-devs-time-to-care-about-web-apps-security.pdf
ianaya89
0
140
A Token Walks into SPA
ianaya89
0
640
Other Decks in Technology
See All in Technology
マルチアカウント環境での コーディングエージェントを使った障害調査が大変なので AIエージェントにReadOnly権限を付与してみた / ReadOnly AI Agents for Multi-Account AWS Incident Response
yamaguchitk333
2
110
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.9k
2026 TECHFRESH 畢業分享會 - 開發日常大解密!從領域驅動到企業級上線
line_developers_tw
PRO
0
1.1k
SONiCのLinuxベースを活かしたZabbix監視
sonic
0
180
RAG を使わないという選択肢
tatsutaka
1
250
失敗を資産に変えるClaude Code
shinyasaita
0
670
スキルと MCP ツール、責務をどう分けるか? AI が迷わないインターフェース設計の戦略
cdataj
1
1.1k
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
270
人材育成分科会.pdf
_awache
4
260
NAB Show 2026 動画技術関連レポート / NAB Show 2026 Report
cyberagentdevelopers
PRO
0
200
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
1.1k
MCP Appsを作ってみよう
iwamot
PRO
4
660
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Between Models and Reality
mayunak
4
340
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
430
Designing for humans not robots
tammielis
254
26k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
First, design no harm
axbom
PRO
2
1.2k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
For a Future-Friendly Web
brad_frost
183
10k
Become a Pro
speakerdeck
PRO
31
6k
Transcript
Vue.js, PWA & The Subway Dilemma ! "# ! @ianaya89
Vue.js, PWA & The Subway Dilemma - @ianaya89 1
! Nacho Anaya ! @ianaya89 • JavaScript Engineer @BloqInc •
Ambassador @Auth0 • Tech Speaker @MozTechSpeakers • Organizer @Vuenos_Aires Vue.js, PWA & The Subway Dilemma - @ianaya89 2
!" Vue.js, PWA & The Subway Dilemma - @ianaya89 3
! Subway Dilemma Vue.js, PWA & The Subway Dilemma -
@ianaya89 4
Vue.js, PWA & The Subway Dilemma - @ianaya89 5
Vue.js, PWA & The Subway Dilemma - @ianaya89 6
Vue.js, PWA & The Subway Dilemma - @ianaya89 7
Vue.js, PWA & The Subway Dilemma - @ianaya89 8
! ✈ # Vue.js, PWA & The Subway Dilemma -
@ianaya89 9
Vue.js, PWA & The Subway Dilemma - @ianaya89 10
! Tools + Standards + Best Prac1ces Vue.js, PWA &
The Subway Dilemma - @ianaya89 11
! Web based applica,ons Vue.js, PWA & The Subway Dilemma
- @ianaya89 12
! Apps with a link... Vue.js, PWA & The Subway
Dilemma - @ianaya89 13
! Some Stats Vue.js, PWA & The Subway Dilemma -
@ianaya89 14
! " % ⏱ Use Mobile Web Vue.js, PWA &
The Subway Dilemma - @ianaya89 15
! " % ⏱ Use Na've Apps Vue.js, PWA &
The Subway Dilemma - @ianaya89 16
Vue.js, PWA & The Subway Dilemma - @ianaya89 17
! " % ! 3 Apps Vue.js, PWA & The
Subway Dilemma - @ianaya89 18
! ! Installed Apps Vue.js, PWA & The Subway Dilemma
- @ianaya89 19
! " % ! " Reach more audience Vue.js, PWA
& The Subway Dilemma - @ianaya89 20
! Progressives Vue.js, PWA & The Subway Dilemma - @ianaya89
21
! ⚡ Vue.js, PWA & The Subway Dilemma - @ianaya89
22
! Na$ve Apps • ! OS Feauteres • " Reach
• ❌ Vue.js, PWA & The Subway Dilemma - @ianaya89 23
! Web Apps • ! OS Features • " Reach
• ❌ Vue.js, PWA & The Subway Dilemma - @ianaya89 24
!" PWA • ! OS Features • ! Reach •
✅ Vue.js, PWA & The Subway Dilemma - @ianaya89 25
! Advantages • ♻ Deploy / Update / Installables •
" Offline Support • #$ Cross Device • % Code Source • & Bye Stores! Vue.js, PWA & The Subway Dilemma - @ianaya89 26
! Imagine a world without stores... Vue.js, PWA & The
Subway Dilemma - @ianaya89 27
Vue.js, PWA & The Subway Dilemma - @ianaya89 28
! F.I.R.E. Vue.js, PWA & The Subway Dilemma - @ianaya89
29
! Fast Vue.js, PWA & The Subway Dilemma - @ianaya89
30
! Integrated Vue.js, PWA & The Subway Dilemma - @ianaya89
31
! Reliable Vue.js, PWA & The Subway Dilemma - @ianaya89
32
! Engaging Vue.js, PWA & The Subway Dilemma - @ianaya89
33
Vue.js, PWA & The Subway Dilemma - @ianaya89 34
! Vue.js, PWA & The Subway Dilemma - @ianaya89 35
! Browsers Vue.js, PWA & The Subway Dilemma - @ianaya89
36
! whatwebcando.today Vue.js, PWA & The Subway Dilemma - @ianaya89
37
Vue.js, PWA & The Subway Dilemma - @ianaya89 38
Vue.js, PWA & The Subway Dilemma - @ianaya89 39
! Web App Manifest Vue.js, PWA & The Subway Dilemma
- @ianaya89 40
Vue.js, PWA & The Subway Dilemma - @ianaya89 41
Vue.js, PWA & The Subway Dilemma - @ianaya89 42
! Service Workers Vue.js, PWA & The Subway Dilemma -
@ianaya89 43
Vue.js, PWA & The Subway Dilemma - @ianaya89 44
Vue.js, PWA & The Subway Dilemma - @ianaya89 45
sw.js self.addEventListener('install', event => { console.log('Installing Service Worker ...', event)
}) self.addEventListener('activate', event => { console.log('Activating Service Worker ...', event) }) self.addEventListener('fetch', event => { console.log('Fetching something ....', event) event.respondWith(fetch(event.request)) }) Vue.js, PWA & The Subway Dilemma - @ianaya89 46
main.js if ('serviceWorker' in navigator) { navigator.serviceWorker.register('./sw.js') .then(() => console.log('Service
worker registered!')) } Vue.js, PWA & The Subway Dilemma - @ianaya89 47
! • ! Installable • " Cache App Shell •
# Dynamic Cache • $ Background Sync & Push No?fica?ons Vue.js, PWA & The Subway Dilemma - @ianaya89 48
! Vue.js, PWA & The Subway Dilemma - @ianaya89 49
! DX Vue.js, PWA & The Subway Dilemma - @ianaya89
50
! vue-cli $ npm i -g @vue/cli $ vue create
[app-name] Vue.js, PWA & The Subway Dilemma - @ianaya89 51
! pwa-plugin Vue.js, PWA & The Subway Dilemma - @ianaya89
52
! Already have a project? $ vue add @vue/pwa Vue.js,
PWA & The Subway Dilemma - @ianaya89 53
Vue.js, PWA & The Subway Dilemma - @ianaya89 54
Vue.js, PWA & The Subway Dilemma - @ianaya89 55
⚙ vue.config.js module.exports = { // ... pwa: { name:
'My App', themeColor: '#4DBA87', msTileColor: '#000000', appleMobileWebAppCapable: 'yes', appleMobileWebAppStatusBarStyle: 'black' } // ... } Vue.js, PWA & The Subway Dilemma - @ianaya89 56
Vue.js, PWA & The Subway Dilemma - @ianaya89 57
workbox-webpack-plugin Vue.js, PWA & The Subway Dilemma - @ianaya89 58
! Workbox !" GenerateSW Vue.js, PWA & The Subway Dilemma
- @ianaya89 59
! Workbox ! InjectManifest Vue.js, PWA & The Subway Dilemma
- @ianaya89 60
⚙ vue.config.js module.exports = { pwa: { name: 'My App',
themeColor: '#4DBA87', msTileColor: '#000000', appleMobileWebAppCapable: 'yes', appleMobileWebAppStatusBarStyle: 'black', // configure the workbox plugin workboxPluginMode: 'InjectManifest', workboxOptions: { swSrc: 'dev/sw.js', // ...other Workbox options } } } Vue.js, PWA & The Subway Dilemma - @ianaya89 61
sw.js // Cache first workbox.routing.registerRoute( new RegExp('/images/') new workbox.strategies.StaleWhileRevalidate() )
Vue.js, PWA & The Subway Dilemma - @ianaya89 62
sw.js // Network first workbox.routing.registerRoute( new RegExp('/posts/'), new workbox.strategies.NetworkFirst() )
Vue.js, PWA & The Subway Dilemma - @ianaya89 63
sw.js // Network only workbox.routing.registerRoute( new RegExp('/auth/'), new workbox.strategies.NetworkOnly() )
Vue.js, PWA & The Subway Dilemma - @ianaya89 64
㿃 Background Sync const syncQueue = new workbox.backgroundSync.Plugin('syncQueue', {}) workbox.routing.registerRoute(
/\/api\/.*\/*.json/, new workbox.strategies.NetworkOnly({ plugins: [syncQueue] }), 'POST' ); Vue.js, PWA & The Subway Dilemma - @ianaya89 65
! register-service-worker register(`${process.env.BASE_URL}service-worker.js`, { ready () {}, cached () {},
updated () {}, offline () {}, error (error) {} }) Vue.js, PWA & The Subway Dilemma - @ianaya89 66
Vue.js, PWA & The Subway Dilemma - @ianaya89 67
! Code Spli*ng Vue.js, PWA & The Subway Dilemma -
@ianaya89 68
! Async Components <script> // import Modal from './components/Modal' const
Modal = () => import( /* webpackChunkName: "modal" */ './components/Modal' ) export default { components: { Modal } } </script> Vue.js, PWA & The Subway Dilemma - @ianaya89 69
! Async Components import Router from 'vue-router' import Home from
'./views/Home.vue' export default new Router({ routes: [ { path: '/', name: 'home', component: Home }, { path: '/about', name: 'about', component: () => import(/* webpackChunkName: "about" */ './views/About.vue') } ] }) Vue.js, PWA & The Subway Dilemma - @ianaya89 70
! Async Components import Router from 'vue-router' import Home from
'./views/Home.vue' export default new Router({ routes: [ { path: '/', name: 'home', component: Home }, { path: '/about', name: 'about', component: () => import(/* webpackChunkName: "about" */ './views/About.vue') } ] }) Vue.js, PWA & The Subway Dilemma - @ianaya89 71
"There are only two hard things in Computer Science: cache
invalida:on and naming things." -- Phil Karlton Vue.js, PWA & The Subway Dilemma - @ianaya89 72
! Test Locally $ npm i -g serve $ npm
run build $ serve -s dist Vue.js, PWA & The Subway Dilemma - @ianaya89 73
Vue.js, PWA & The Subway Dilemma - @ianaya89 74
! Lighthouse Vue.js, PWA & The Subway Dilemma - @ianaya89
75
✅ Checklist • Offline Support • All browsers • Any
context • Be7er Resources = Be7er UX • HTTPS Vue.js, PWA & The Subway Dilemma - @ianaya89 76
✅ Checklist • Installable • Metadata • Fast ini/al load
• Fluid • 1 page = 1 URL Vue.js, PWA & The Subway Dilemma - @ianaya89 77
⛰ Vue.js, PWA & The Subway Dilemma - @ianaya89 78
! Resources • workbox • serviceworke.rs • lighthouse • pwastats.com
Vue.js, PWA & The Subway Dilemma - @ianaya89 79
! If it has 4 legs is PWA Vue.js, PWA
& The Subway Dilemma - @ianaya89 80
! Thanks! ! Ques&ons? ! @ianaya89 Vue.js, PWA & The
Subway Dilemma - @ianaya89 81