What?
Why?
How?
</intro>
Progressive Web App
Progressive Web App
Progressive Web Experience
native-like
Alex Russell in 2015 Progressive Web Apps: Escaping Tabs Without Losing Our Soul mentions things like
Go over all the points made in the what part and explain how they relate to what to the gif
Most web apps take 15 - 16s to load
Mobile web continues to be increasingly important to reach users
Mobile > 50% usage in 2017
~ 80% of time on mobile is spent in 3 apps
First point of engagement to interactive time
Native app, go to app store, download, install, oh wait flappy bird, go to home screen and click
PWA see link, click opens your experience in browser immediately. After the user has been there for a while prompt for install
How to progressive web experience?
Choose what matters the most to you
if ('serviceWorker' in navigator) {
navigator
.serviceWorker
.register('/service-worker.js')
.then(function(registration) {
console.log('Registration successful, scope is:', registration.scope);
})
.catch(function(error) {
console.log('Service worker registration failed, error:', error);
});
}
// events: 'install', 'activate', 'message', 'fetch', 'push', 'sync'
self.addEventListener('install', function(event) {
// postMessage() telling application that new version of service worker is
// available
});
self.addEventListener('activate', function(event) {
// Prepare environment for service worker, clean old caches,
// prefetch new resources, warm stale caches
});
self.addEventListener('fetch', function(event) {
if (event.url.contains('meaning-of-life')) {
event.respondWith(new Response('42'));
} else {
event.respondWith(new Response('Try googling it'));
}
});
AI for code loading
Integrates with webpack
Integrates with common frameworks, Angular
AI for content perfecting.
Used to a deploy model where you deploy a web server and serve requests
More economical
Faster Time to first byte
2 hardest things
Integrates with your build pipeline, webpack, cli, or standalone node moredule
Caching made easy
WebPack plugin for precaching
Tons of great modules
Works well with larger assets
hinders small images
Standard
Progressive
built into tools
route based
module.exports = {
performance: {
hints: 'warning',
// How large can index.js be (bytes)
maxEntrypointSize: 400000,
// How large can any single asset be (bytes)
maxAssetSize: 100000,
// Do analysis only only specified files
assetFilter: function(assetFilename) {
return assetFilename.endsWith('.js') ||
assetFilename.endsWith('.jsx') ||
assetFilename.endsWith('.vue');
}
}
};
short_name / Name, icons (192, 512px), start_url, display (fullscreen )