KEMBAR78
Pwa with vue js | PDF
PWA with VueJS
Vue meet-up Dhaka, 2018
Md. Ziaul Haq
JavaScript Developer

Author

@jquerygeek
What we will cover
• What is PWA

• Why we should care about PWA

• What tools and techniques we should know to
build PWA

• How VueJS can help us to build a PWA
(PWA)

Progressive Web App
Progressive
Enhancement in Web App
What is PWA?
• It is more a marketing term than technical :) 

• Introduced by google / chrome team members 

• Use the latest advantage of web technologies 

• Don’t need to wait for every browser
Why PWA?
Features of PWA
• Progressive

• Responsive / Mobile First 

• Works Offline

• App-like

• Fresh Content
Features of PWA
• Safe

• Discoverable

• Re-engageable

• Durable

• Linkable
We need PWA :)
Tools and technique
• Meta data

• Server Side Rendering

• Service worker
• Cache API

• IndexDB and WebSQL

• Notification in Browser

• Background Sync
Meta Data in App
• Viewport 

• Home Icon

• Manifest file

• Display
Server Side Rendering
(SSR)
Client Side Render
Server Side Render
Service Worker !!
“Programmable network proxy.”
Service Worker
Service Worker
Service Worker
• JavaScript Worker

• Works in Secure Network

• Most things in PWA need Service worker 

• Service Worker run on it’s own thread
Service worker in action
• User send request to the
service worker

• If cache, serve from cache

• no cache, serve from web
and save to cache
SW Register
SW Life Cycle
SW Life Cycle
Check SW in Browser
Learn more on
• Service Worker

• Server Side Rendering

• Cache API

• IndexDB and WebSQL

• Promise

• Notification API

• Background Sync
PWA with Vue
• PWA vue-template

• Nuxt.js paw module

• PWA Hackernews clone

• https://github.com/vuejs/vue-hackernews-2.0 

• sw-precache-webpack-plugin 
SW in Vue
var	webpackConfig	=	merge(baseWebpackConfig,	{	
		...	
		plugins:	[	
				...	
				new	SWPrecacheWebpackPlugin({	
						cacheId:	'my-vue-app',	
						filename:	'service-worker.js',	
						staticFileGlobs:	['dist/**/*.{js,html,css}'],	
						minify:	true,	
						stripPrefix:	'dist/'	
				})	
		]	
})
Thank you all.

Questions?

Pwa with vue js