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とハーネスで育てるトランスコンパイラ / 20260722 Yasushi Katayama
shift_evolve
PRO
0
130
Alphaモジュール使っていいのかい!?いけないのかい!?どっちなんだいっ!?
watany
1
290
「守りたい体験」を渡すだけで E2E を生成させられるようになった話
hinac0
1
760
シンガポールで登壇してきます
yama3133
0
250
LLMやAIエージェントをソフトウェアに組み込むプラクティス
shibuiwilliam
2
430
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
180
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
290
[2026-07-15] AI Ready なはずだったアーキテクチャと、見えてきた課題・次に目指す状態
wxyzzz
9
4k
AI時代のPlaywright活用(システムテストを自動化する ー 実行エンジンにPla ywrightを選んだ理由)
ynisqa1988
1
680
Webアプリ認証の全体像 / The Big Picture of Web App Authentication
kitano_yuichi
0
240
DMM.com 購入改善推進チーム におけるCodeRabbitを用いた レビューフロー改善の一例
ysknsid25
2
670
発表と総括 / Presentations and Summary
ks91
PRO
0
140
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
510
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
240
Ruling the World: When Life Gets Gamed
codingconduct
0
280
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
45k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
320
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
340
Utilizing Notion as your number one productivity tool
mfonobong
4
430
How to Think Like a Performance Engineer
csswizardry
28
2.7k
How to build a perfect <img>
jonoalderson
1
5.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
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