SlideShare a Scribd company logo
1 of 62
Download to read offline
OFFLINE PWA
JOURNEY TO THE FUTURE
USING REACT
AND NODEJS
{
"name": "Ilia Idakiev",
"experience": [
"Lecturer in 'Advanced JS' @ FMI",
"Developer / Manager / Owner @ HNS",
"Project Contractor / Consultant",
"2 Angular Courses @ HB (2016 - 2017)",
"Private Courses"
],
"involvedIn": [
"SofiaJS", "BeerJS", "Angular Sofia”
]
}
ABOUT ME
I 💜 VINYL
WHY ARE WE HERE TODAY?
WHAT ARE PWA?
FAST - Respond quickly to user interactions with
silky smooth animations and no janky scrolling.
RELIABLE - Load instantly and never show the
downasaur, even in uncertain network
conditions.
ENGAGING - Feel like a natural app on the
device, with an immersive user experience.
13%
87%
WEB APPS
NATIVE APPS
USAGE STATISTICS ON MOBILE DEVICES
Source: Google
SOFTWARE DISTRIBUTION
0 APPS
100 WEB SITES
AVERAGE USER STATS PER MONTH
Source: Google
40% OF USERS BOUNCE FROM SITES
THAT TAKE MORE THAN 3 SEC TO LOAD
Source: Google
SERVICE WORKERS
OFFLINE PROGRESSIVE WEB APPLICATIONS
SERVICE WORKERS
▸ Runs separately from the main browser thread
▸ Designed to be fully asynchronous
▸ Programmable network proxy
▸ Runs only over HTTPS
▸ Becomes idle when not in use and restarts when it's next needed.
OFFLINE PROGRESSIVE WEB APPLICATIONS
ADVANCED FEATURES
▸ Notifications API - Display and interact with notifications using the operating
system's native notification system.
▸ Push API: Subscribe to a push service and receive push messages. Push
messages are delivered to a service worker, which can use the information in
the message to update the local state or display a notification to the user.
Because service workers run independently of the main app, they can receive
and display notifications even when the browser is not running.
OFFLINE PROGRESSIVE WEB APPLICATIONS
ADVANCED FEATURES
▸ Background Sync API: Defer actions until the user has stable connectivity. This
is useful to ensure that whatever the user wants to send is actually sent. This API
also allows servers to push periodic updates to the app so the app can update
when it's next online.
▸ Channel Messaging API: Lets web workers and service workers communicate
with each other and with the host application.
SERVICE WORKER
LIFECYCLE
OFFLINE PROGRESSIVE WEB APPLICATIONS
1. REGISTRATION
▸ The scope of the service worker determines which files the service worker
controls. The default scope is the location of the service worker file, and extends
to all directories below. An arbitrary scope can also be set by passing in an
additional parameter when registering.
OFFLINE PROGRESSIVE WEB APPLICATIONS
2. INSTALLATION
▸ This occurs if the service worker is considered to be new by the browser.
▸ During the install, service workers can precache parts of a web app so that it
loads instantly the next time a user opens it.
OFFLINE PROGRESSIVE WEB APPLICATIONS
3. ACTIVATION
▸ If there are any open pages controlled by the previous service worker, the new service
worker enters a waiting state.
▸ The new service worker only activates when there are no longer any pages loaded
that are still using the old service worker. This ensures that only one version of the
service worker is running at any given time.
▸ When the new service worker activates, an activate event is triggered in the activating
service worker. This event listener is a good place to clean up outdated caches.
OFFLINE PROGRESSIVE WEB APPLICATIONS
ADDITIONAL INFORMATION
‣ The clients.claim() method allows an active service worker take control of
uncontrolled clients.
▸ skipWaiting() - kill existing service workers and activate the new service worker.
‣ The clients.matchAll() method resolves to an array of all controlled clients.
‣ A client can access its controller by navigator.serviceWorker.controller
‣ Messages between service worker and client are send using .postMessage()
method (used on client or controller respectively)
OFFLINE PROGRESSIVE WEB APPLICATIONS
OTHER EVENTS THAT SW CAN LISTEN FOR
▸ message - service worker can receive information from other scripts
▸ fetch - intercept requests.
▸ push - when a (Web Push Protocol) message is received.
▸ sync - ask for an event to be fired when the user has connectivity 

(https://wicg.github.io/BackgroundSync/spec/)
OFFLINE PROGRESSIVE WEB APPLICATIONS
SERVICE WORKER UPDATE TRIGGERING
▸ On navigation to an in-scope page.
▸ On functional events such as push and sync, unless there's been an update
check within the previous 24 hours.
▸ On calling .register() only if the service worker URL has changed.
OFFLINE PROGRESSIVE WEB APPLICATIONS
SW UPDATE LIFECYCLE
OTHER EVENTS
NOTIFICATION API
OFFLINE PROGRESSIVE WEB APPLICATIONS
CHECK IF BROWSER SUPPORTS NOTIFICATION API
OFFLINE PROGRESSIVE WEB APPLICATIONS
REQUESTING PERMISSIONS FOR NOTIFICATION API
▸ Only prompt when it's obvious to the user why you need extra privileges
OFFLINE PROGRESSIVE WEB APPLICATIONS
USING NOTIFICATION API
OFFLINE PROGRESSIVE WEB APPLICATIONS
NOTIFICATION OPTIONS
▸ The BODY option adds a main description to the notification. It should give the user
enough information to decide how to act on it.
▸ The ICON option attaches an image to make the notification more visually appealing,
but also more relevant to the user.
▸ The VIBRATE option specifies a vibration pattern for a phone receiving the notification.
▸ The DATA option attaches custom data to the notification, so that the service worker
can retrieve it when the user interacts with the notification. For instance, adding a
unique "id" or "key" option to the data allows us to determine which notification was
clicked when the service worker handles the click event.
OFFLINE PROGRESSIVE WEB APPLICATIONS
LISTENING FOR NOTIFICATION CLICKS
OFFLINE PROGRESSIVE WEB APPLICATIONS
LISTENING FOR NOTIFICATION CLOSE
GOING OFFLINE
OFFLINE PROGRESSIVE WEB APPLICATIONS
CACHE API
▸ Lets us create stores of responses keyed by request.
▸ Exposed on the window so it accessed from anywhere in your scripts via "caches".
▸ waitUntil extends the lifetime of the
install event until the passed promise
resolves successfully. If the promise
rejects, the installation is considered
a failure and this service worker is
abandoned (if an older version is
running, it stays active).
OFFLINE PROGRESSIVE WEB APPLICATIONS
CACHE FALLING BACK TO THE NETWORK
▸ To serve content from the cache and make your app available offline you need
to intercept network requests and respond with files stored in the cache.
OFFLINE PROGRESSIVE WEB APPLICATIONS
ALL APPROACHES
▸ cache only
▸ network only
▸ cache falling back to network
▸ network falling back to cache
▸ cache then network
OFFLINE PROGRESSIVE WEB APPLICATIONS
SERVICE WORKERS
OFFLINE PROGRESSIVE WEB APPLICATIONS
APPLICATION SHELL
▸ An application shell is the minimal HTML, CSS, and JavaScript powering a user
interface
INDEXEDDB API
OFFLINE PROGRESSIVE WEB APPLICATIONS
INDEXEDDB API
▸ IndexedDB is a low-level API for client-side storage of significant amounts of
structured data, including files/blobs.
▸ This API uses indexes to enable high performance searches of this data.
OFFLINE PROGRESSIVE WEB APPLICATIONS
CREATING OBJECT STORE
OFFLINE PROGRESSIVE WEB APPLICATIONS
CREATING OBJECT STORE WITH KEYS
OFFLINE PROGRESSIVE WEB APPLICATIONS
INDEXEDDB TERMS
▸ Database - This is the highest level of IndexedDB. It contains the object stores, which in turn contain the data you
would like to persist.
▸ Object store - An object store is an individual bucket to store data. You can think of object stores as being similar
to tables in traditional relational databases.
▸ Index - An Index is a kind of object store for organizing data in another object store (called the reference object
store) by an individual property of the data. The index is used to retrieve records in the object store by this
property. For example, if you're storing people, you may want to fetch them later by their name, age, or favorite
animal.
▸ Operation - An interaction with the database.
▸ Transaction - A transaction is wrapper around an operation, or group of operations, that ensures database
integrity. If one of the actions within a transaction fail, none of them are applied and the database returns to the
state it was in before the transaction began.
PROMISES?
https://github.com/jakearchibald/idb
HOW TO IMPORT EXTERNAL SCRIPTS?
POUCHDB
POUCHDB IS AN OPEN-SOURCE JAVASCRIPT DATABASE INSPIRED
BY APACHE COUCHDB THAT IS DESIGNED TO RUN WELL WITHIN
THE BROWSER.
POUCHDB WAS CREATED TO HELP WEB DEVELOPERS BUILD
APPLICATIONS THAT WORK AS WELL OFFLINE AS THEY DO
ONLINE.


IT ENABLES APPLICATIONS TO STORE DATA LOCALLY WHILE
OFFLINE, THEN SYNCHRONIZE IT WITH COUCHDB
INSTALLABLE WEB APPS
OFFLINE PROGRESSIVE WEB APPLICATIONS
APPLICATION MANIFEST JSON
▸ Web app manifests provide the ability to save a site bookmark to a device's
home screen. When a site is launched this way:
▸ It has a unique icon and name so that users can distinguish it from other
sites.
▸ It displays something to the user while resources are downloaded or
restored from cache.
▸ It provides default display characterstics to the browser to avoid too abrupt
transition when site resources become available.
OFFLINE PROGRESSIVE WEB APPLICATIONS
SIMPLE MANIFEST JSON
OFFLINE PROGRESSIVE WEB APPLICATIONS
APP MANIFEST TOOLS
▸ http://realfavicongenerator.net/
▸ http://preview.pwabuilder.com
WEB PUSH API
OFFLINE PROGRESSIVE WEB APPLICATIONS
WEB PUSH API
1. A device downloads your web app containing an
already created publicKey, referred to in scripts
as the applicationServerKey. Your web app
installs a service worker.
2. During the subscription flow the browser
contacts the messaging server to create a new
subscription and returns it to the app. Note: You
don't need to know the URL of the message
server. Each browser vendor manages it's own
message server for its browser.
3. After the subscription flow, your app passes a
subscription object back to your app server.
4. At some later point, your app server sends a
message to the messaging server, which
forwards it to the recipient.
WE DON'T NEED FIREBASE / GOOGLE CLOUD
MESSAGING SENDER ID ( GCM_SENDER_ID )
ANYMORE!
OFFLINE PROGRESSIVE WEB APPLICATIONS
VOLUNTARY APPLICATION SERVER IDENTIFICATION (VAPID)
▸ Your application server creates a public/private key pair. The public key is given
to your web app.
▸ When the user elects to receive pushes, add the public key to the subscribe()
call's options object.
▸ When your app server sends a push message, include a signed JSON Web
Token along with the public key.
OFFLINE PROGRESSIVE WEB APPLICATIONS
OTHER SERVICE WORKER APIS
▸ Payment Request API
▸ Credential Management API
OFFLINE PROGRESSIVE WEB APPLICATIONS
▸ Payment Request API Workflow
IN PURSUIT OF SPEED
OFFLINE PROGRESSIVE WEB APPLICATIONS
SERVER SIDE RENDERING
▸ First Meaningful Paint - The time at which the user feels that the primary
content of the page is visible.
▸ Rendering front-end JavaScript applications on the server.
TESTING OUR WEB APPS
QUESTIONS
FOLLOW ME @ http://github.com/iliaidakiev/
THANK YOU!

More Related Content

What's hot

Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!Shelly Megan
 
HATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleHATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleApigee | Google Cloud
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web AppBinh Bui
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web appsFastly
 
PWA - Progressive Web App
PWA - Progressive Web AppPWA - Progressive Web App
PWA - Progressive Web AppRobert Robinson
 
Firebase Basics - Dialog Demo for Group Tech Staff
Firebase Basics - Dialog Demo for Group Tech StaffFirebase Basics - Dialog Demo for Group Tech Staff
Firebase Basics - Dialog Demo for Group Tech StaffTharaka Devinda
 
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...Robert Nyman
 
Discover Google Firebase Platform
Discover Google Firebase PlatformDiscover Google Firebase Platform
Discover Google Firebase PlatformSagar Mody
 
Introducing firebase
Introducing firebaseIntroducing firebase
Introducing firebaseFarouk Touzi
 
Why Progressive Web App is what you need for your Business
Why Progressive Web App is what you need for your BusinessWhy Progressive Web App is what you need for your Business
Why Progressive Web App is what you need for your BusinessLets Grow Business
 
Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testingKalhan Liyanage
 
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...James Gallagher
 
Bootstrapping an App for Launch
Bootstrapping an App for LaunchBootstrapping an App for Launch
Bootstrapping an App for LaunchCraig Phares
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 

What's hot (20)

Introduction to Firebase from Google
Introduction to Firebase from GoogleIntroduction to Firebase from Google
Introduction to Firebase from Google
 
Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!Guidance on how to develop a progressive web app using react native!
Guidance on how to develop a progressive web app using react native!
 
HATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleHATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API Style
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Introduction to Progressive Web App
Introduction to Progressive Web AppIntroduction to Progressive Web App
Introduction to Progressive Web App
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 
PWA - Progressive Web App
PWA - Progressive Web AppPWA - Progressive Web App
PWA - Progressive Web App
 
Firebase Basics - Dialog Demo for Group Tech Staff
Firebase Basics - Dialog Demo for Group Tech StaffFirebase Basics - Dialog Demo for Group Tech Staff
Firebase Basics - Dialog Demo for Group Tech Staff
 
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...
 
Firebase
FirebaseFirebase
Firebase
 
Discover Google Firebase Platform
Discover Google Firebase PlatformDiscover Google Firebase Platform
Discover Google Firebase Platform
 
Progressive Web Apps - NPD Meet
Progressive Web Apps - NPD MeetProgressive Web Apps - NPD Meet
Progressive Web Apps - NPD Meet
 
Introducing firebase
Introducing firebaseIntroducing firebase
Introducing firebase
 
Why Progressive Web App is what you need for your Business
Why Progressive Web App is what you need for your BusinessWhy Progressive Web App is what you need for your Business
Why Progressive Web App is what you need for your Business
 
Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testing
 
Frontend. Global domination.
Frontend. Global domination.Frontend. Global domination.
Frontend. Global domination.
 
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
 
Bootstrapping an App for Launch
Bootstrapping an App for LaunchBootstrapping an App for Launch
Bootstrapping an App for Launch
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]
 
Firebase
FirebaseFirebase
Firebase
 

Similar to Offline progressive web apps with NodeJS and React

Angular Offline Progressive Web Apps With NodeJS
Angular Offline Progressive Web Apps With NodeJSAngular Offline Progressive Web Apps With NodeJS
Angular Offline Progressive Web Apps With NodeJSIlia Idakiev
 
Introduction to Offline Progressive Web Applications
Introduction to Offline Progressive Web ApplicationsIntroduction to Offline Progressive Web Applications
Introduction to Offline Progressive Web ApplicationsIlia Idakiev
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developersFilip Rakowski
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web appsSuraj Kumar
 
Service workers and their role in PWAs
Service workers and their role in PWAsService workers and their role in PWAs
Service workers and their role in PWAsIpsha Bhidonia
 
PWA ( Progressive Web Apps ) - Sai Kiran Kasireddy
PWA ( Progressive Web Apps ) - Sai Kiran KasireddyPWA ( Progressive Web Apps ) - Sai Kiran Kasireddy
PWA ( Progressive Web Apps ) - Sai Kiran KasireddySai Kiran Kasireddy
 
Future of web development
Future of web developmentFuture of web development
Future of web developmenthedgehog lab
 
Service workers are your best friends
Service workers are your best friendsService workers are your best friends
Service workers are your best friendsAntonio Peric-Mazar
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Imran Sayed
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulRobert Nyman
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandImran Sayed
 
Technology stack behind Airbnb
Technology stack behind Airbnb Technology stack behind Airbnb
Technology stack behind Airbnb Rohan Khude
 
A year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMUA year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMUAntonio Peric-Mazar
 
Basic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsBasic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsAnjaliTanpure1
 

Similar to Offline progressive web apps with NodeJS and React (20)

Angular Offline Progressive Web Apps With NodeJS
Angular Offline Progressive Web Apps With NodeJSAngular Offline Progressive Web Apps With NodeJS
Angular Offline Progressive Web Apps With NodeJS
 
Introduction to Offline Progressive Web Applications
Introduction to Offline Progressive Web ApplicationsIntroduction to Offline Progressive Web Applications
Introduction to Offline Progressive Web Applications
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
PWAs overview
PWAs overview PWAs overview
PWAs overview
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developers
 
Checklist for progressive web app development
Checklist for progressive web app developmentChecklist for progressive web app development
Checklist for progressive web app development
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 
Progressive web app
Progressive web appProgressive web app
Progressive web app
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Service workers and their role in PWAs
Service workers and their role in PWAsService workers and their role in PWAs
Service workers and their role in PWAs
 
PWA ( Progressive Web Apps ) - Sai Kiran Kasireddy
PWA ( Progressive Web Apps ) - Sai Kiran KasireddyPWA ( Progressive Web Apps ) - Sai Kiran Kasireddy
PWA ( Progressive Web Apps ) - Sai Kiran Kasireddy
 
Future of web development
Future of web developmentFuture of web development
Future of web development
 
Service workers are your best friends
Service workers are your best friendsService workers are your best friends
Service workers are your best friends
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - Istanbul
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
 
Technology stack behind Airbnb
Technology stack behind Airbnb Technology stack behind Airbnb
Technology stack behind Airbnb
 
A year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMUA year with progressive web apps! #DevConMU
A year with progressive web apps! #DevConMU
 
Basic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsBasic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web Apps
 

More from Ilia Idakiev

No more promises lets RxJS 2 Edit
No more promises lets RxJS 2 EditNo more promises lets RxJS 2 Edit
No more promises lets RxJS 2 EditIlia Idakiev
 
Enterprise State Management with NGRX/platform
Enterprise State Management with NGRX/platformEnterprise State Management with NGRX/platform
Enterprise State Management with NGRX/platformIlia Idakiev
 
Deep Dive into Zone.JS
Deep Dive into Zone.JSDeep Dive into Zone.JS
Deep Dive into Zone.JSIlia Idakiev
 
RxJS Schedulers - Controlling Time
RxJS Schedulers - Controlling TimeRxJS Schedulers - Controlling Time
RxJS Schedulers - Controlling TimeIlia Idakiev
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlIlia Idakiev
 
No More Promises! Let's RxJS!
No More Promises! Let's RxJS!No More Promises! Let's RxJS!
No More Promises! Let's RxJS!Ilia Idakiev
 
Marble Testing RxJS streams
Marble Testing RxJS streamsMarble Testing RxJS streams
Marble Testing RxJS streamsIlia Idakiev
 
Deterministic JavaScript Applications
Deterministic JavaScript ApplicationsDeterministic JavaScript Applications
Deterministic JavaScript ApplicationsIlia Idakiev
 
Web Components Everywhere
Web Components EverywhereWeb Components Everywhere
Web Components EverywhereIlia Idakiev
 
Building Reusable Custom Elements With Angular
Building Reusable Custom Elements With AngularBuilding Reusable Custom Elements With Angular
Building Reusable Custom Elements With AngularIlia Idakiev
 
State management for enterprise angular applications
State management for enterprise angular applicationsState management for enterprise angular applications
State management for enterprise angular applicationsIlia Idakiev
 
Testing rx js using marbles within angular
Testing rx js using marbles within angularTesting rx js using marbles within angular
Testing rx js using marbles within angularIlia Idakiev
 
Predictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platformPredictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platformIlia Idakiev
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedIlia Idakiev
 
Reflective injection using TypeScript
Reflective injection using TypeScriptReflective injection using TypeScript
Reflective injection using TypeScriptIlia Idakiev
 
Predictable reactive state management - ngrx
Predictable reactive state management - ngrxPredictable reactive state management - ngrx
Predictable reactive state management - ngrxIlia Idakiev
 

More from Ilia Idakiev (17)

No more promises lets RxJS 2 Edit
No more promises lets RxJS 2 EditNo more promises lets RxJS 2 Edit
No more promises lets RxJS 2 Edit
 
Enterprise State Management with NGRX/platform
Enterprise State Management with NGRX/platformEnterprise State Management with NGRX/platform
Enterprise State Management with NGRX/platform
 
Deep Dive into Zone.JS
Deep Dive into Zone.JSDeep Dive into Zone.JS
Deep Dive into Zone.JS
 
RxJS Schedulers - Controlling Time
RxJS Schedulers - Controlling TimeRxJS Schedulers - Controlling Time
RxJS Schedulers - Controlling Time
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 
No More Promises! Let's RxJS!
No More Promises! Let's RxJS!No More Promises! Let's RxJS!
No More Promises! Let's RxJS!
 
Marble Testing RxJS streams
Marble Testing RxJS streamsMarble Testing RxJS streams
Marble Testing RxJS streams
 
Deterministic JavaScript Applications
Deterministic JavaScript ApplicationsDeterministic JavaScript Applications
Deterministic JavaScript Applications
 
Web Components Everywhere
Web Components EverywhereWeb Components Everywhere
Web Components Everywhere
 
Building Reusable Custom Elements With Angular
Building Reusable Custom Elements With AngularBuilding Reusable Custom Elements With Angular
Building Reusable Custom Elements With Angular
 
State management for enterprise angular applications
State management for enterprise angular applicationsState management for enterprise angular applications
State management for enterprise angular applications
 
Testing rx js using marbles within angular
Testing rx js using marbles within angularTesting rx js using marbles within angular
Testing rx js using marbles within angular
 
Predictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platformPredictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platform
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of Speed
 
Reflective injection using TypeScript
Reflective injection using TypeScriptReflective injection using TypeScript
Reflective injection using TypeScript
 
Zone.js
Zone.jsZone.js
Zone.js
 
Predictable reactive state management - ngrx
Predictable reactive state management - ngrxPredictable reactive state management - ngrx
Predictable reactive state management - ngrx
 

Recently uploaded

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Offline progressive web apps with NodeJS and React

  • 1. OFFLINE PWA JOURNEY TO THE FUTURE USING REACT AND NODEJS
  • 2. { "name": "Ilia Idakiev", "experience": [ "Lecturer in 'Advanced JS' @ FMI", "Developer / Manager / Owner @ HNS", "Project Contractor / Consultant", "2 Angular Courses @ HB (2016 - 2017)", "Private Courses" ], "involvedIn": [ "SofiaJS", "BeerJS", "Angular Sofia” ] } ABOUT ME
  • 4. WHY ARE WE HERE TODAY?
  • 5. WHAT ARE PWA? FAST - Respond quickly to user interactions with silky smooth animations and no janky scrolling. RELIABLE - Load instantly and never show the downasaur, even in uncertain network conditions. ENGAGING - Feel like a natural app on the device, with an immersive user experience.
  • 6. 13% 87% WEB APPS NATIVE APPS USAGE STATISTICS ON MOBILE DEVICES Source: Google
  • 8. 0 APPS 100 WEB SITES AVERAGE USER STATS PER MONTH Source: Google
  • 9. 40% OF USERS BOUNCE FROM SITES THAT TAKE MORE THAN 3 SEC TO LOAD Source: Google
  • 11. OFFLINE PROGRESSIVE WEB APPLICATIONS SERVICE WORKERS ▸ Runs separately from the main browser thread ▸ Designed to be fully asynchronous ▸ Programmable network proxy ▸ Runs only over HTTPS ▸ Becomes idle when not in use and restarts when it's next needed.
  • 12. OFFLINE PROGRESSIVE WEB APPLICATIONS ADVANCED FEATURES ▸ Notifications API - Display and interact with notifications using the operating system's native notification system. ▸ Push API: Subscribe to a push service and receive push messages. Push messages are delivered to a service worker, which can use the information in the message to update the local state or display a notification to the user. Because service workers run independently of the main app, they can receive and display notifications even when the browser is not running.
  • 13. OFFLINE PROGRESSIVE WEB APPLICATIONS ADVANCED FEATURES ▸ Background Sync API: Defer actions until the user has stable connectivity. This is useful to ensure that whatever the user wants to send is actually sent. This API also allows servers to push periodic updates to the app so the app can update when it's next online. ▸ Channel Messaging API: Lets web workers and service workers communicate with each other and with the host application.
  • 15. OFFLINE PROGRESSIVE WEB APPLICATIONS 1. REGISTRATION ▸ The scope of the service worker determines which files the service worker controls. The default scope is the location of the service worker file, and extends to all directories below. An arbitrary scope can also be set by passing in an additional parameter when registering.
  • 16. OFFLINE PROGRESSIVE WEB APPLICATIONS 2. INSTALLATION ▸ This occurs if the service worker is considered to be new by the browser. ▸ During the install, service workers can precache parts of a web app so that it loads instantly the next time a user opens it.
  • 17. OFFLINE PROGRESSIVE WEB APPLICATIONS 3. ACTIVATION ▸ If there are any open pages controlled by the previous service worker, the new service worker enters a waiting state. ▸ The new service worker only activates when there are no longer any pages loaded that are still using the old service worker. This ensures that only one version of the service worker is running at any given time. ▸ When the new service worker activates, an activate event is triggered in the activating service worker. This event listener is a good place to clean up outdated caches.
  • 18. OFFLINE PROGRESSIVE WEB APPLICATIONS ADDITIONAL INFORMATION ‣ The clients.claim() method allows an active service worker take control of uncontrolled clients. ▸ skipWaiting() - kill existing service workers and activate the new service worker. ‣ The clients.matchAll() method resolves to an array of all controlled clients. ‣ A client can access its controller by navigator.serviceWorker.controller ‣ Messages between service worker and client are send using .postMessage() method (used on client or controller respectively)
  • 19. OFFLINE PROGRESSIVE WEB APPLICATIONS OTHER EVENTS THAT SW CAN LISTEN FOR ▸ message - service worker can receive information from other scripts ▸ fetch - intercept requests. ▸ push - when a (Web Push Protocol) message is received. ▸ sync - ask for an event to be fired when the user has connectivity 
 (https://wicg.github.io/BackgroundSync/spec/)
  • 20. OFFLINE PROGRESSIVE WEB APPLICATIONS SERVICE WORKER UPDATE TRIGGERING ▸ On navigation to an in-scope page. ▸ On functional events such as push and sync, unless there's been an update check within the previous 24 hours. ▸ On calling .register() only if the service worker URL has changed.
  • 21. OFFLINE PROGRESSIVE WEB APPLICATIONS SW UPDATE LIFECYCLE
  • 24. OFFLINE PROGRESSIVE WEB APPLICATIONS CHECK IF BROWSER SUPPORTS NOTIFICATION API
  • 25. OFFLINE PROGRESSIVE WEB APPLICATIONS REQUESTING PERMISSIONS FOR NOTIFICATION API ▸ Only prompt when it's obvious to the user why you need extra privileges
  • 26. OFFLINE PROGRESSIVE WEB APPLICATIONS USING NOTIFICATION API
  • 27. OFFLINE PROGRESSIVE WEB APPLICATIONS NOTIFICATION OPTIONS ▸ The BODY option adds a main description to the notification. It should give the user enough information to decide how to act on it. ▸ The ICON option attaches an image to make the notification more visually appealing, but also more relevant to the user. ▸ The VIBRATE option specifies a vibration pattern for a phone receiving the notification. ▸ The DATA option attaches custom data to the notification, so that the service worker can retrieve it when the user interacts with the notification. For instance, adding a unique "id" or "key" option to the data allows us to determine which notification was clicked when the service worker handles the click event.
  • 28. OFFLINE PROGRESSIVE WEB APPLICATIONS LISTENING FOR NOTIFICATION CLICKS
  • 29. OFFLINE PROGRESSIVE WEB APPLICATIONS LISTENING FOR NOTIFICATION CLOSE
  • 31. OFFLINE PROGRESSIVE WEB APPLICATIONS CACHE API ▸ Lets us create stores of responses keyed by request. ▸ Exposed on the window so it accessed from anywhere in your scripts via "caches". ▸ waitUntil extends the lifetime of the install event until the passed promise resolves successfully. If the promise rejects, the installation is considered a failure and this service worker is abandoned (if an older version is running, it stays active).
  • 32. OFFLINE PROGRESSIVE WEB APPLICATIONS CACHE FALLING BACK TO THE NETWORK ▸ To serve content from the cache and make your app available offline you need to intercept network requests and respond with files stored in the cache.
  • 33. OFFLINE PROGRESSIVE WEB APPLICATIONS ALL APPROACHES ▸ cache only ▸ network only ▸ cache falling back to network ▸ network falling back to cache ▸ cache then network
  • 34. OFFLINE PROGRESSIVE WEB APPLICATIONS SERVICE WORKERS
  • 35. OFFLINE PROGRESSIVE WEB APPLICATIONS APPLICATION SHELL ▸ An application shell is the minimal HTML, CSS, and JavaScript powering a user interface
  • 37. OFFLINE PROGRESSIVE WEB APPLICATIONS INDEXEDDB API ▸ IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. ▸ This API uses indexes to enable high performance searches of this data.
  • 38. OFFLINE PROGRESSIVE WEB APPLICATIONS CREATING OBJECT STORE
  • 39. OFFLINE PROGRESSIVE WEB APPLICATIONS CREATING OBJECT STORE WITH KEYS
  • 40. OFFLINE PROGRESSIVE WEB APPLICATIONS INDEXEDDB TERMS ▸ Database - This is the highest level of IndexedDB. It contains the object stores, which in turn contain the data you would like to persist. ▸ Object store - An object store is an individual bucket to store data. You can think of object stores as being similar to tables in traditional relational databases. ▸ Index - An Index is a kind of object store for organizing data in another object store (called the reference object store) by an individual property of the data. The index is used to retrieve records in the object store by this property. For example, if you're storing people, you may want to fetch them later by their name, age, or favorite animal. ▸ Operation - An interaction with the database. ▸ Transaction - A transaction is wrapper around an operation, or group of operations, that ensures database integrity. If one of the actions within a transaction fail, none of them are applied and the database returns to the state it was in before the transaction began.
  • 43. HOW TO IMPORT EXTERNAL SCRIPTS?
  • 44. POUCHDB POUCHDB IS AN OPEN-SOURCE JAVASCRIPT DATABASE INSPIRED BY APACHE COUCHDB THAT IS DESIGNED TO RUN WELL WITHIN THE BROWSER. POUCHDB WAS CREATED TO HELP WEB DEVELOPERS BUILD APPLICATIONS THAT WORK AS WELL OFFLINE AS THEY DO ONLINE. 
 IT ENABLES APPLICATIONS TO STORE DATA LOCALLY WHILE OFFLINE, THEN SYNCHRONIZE IT WITH COUCHDB
  • 46. OFFLINE PROGRESSIVE WEB APPLICATIONS APPLICATION MANIFEST JSON ▸ Web app manifests provide the ability to save a site bookmark to a device's home screen. When a site is launched this way: ▸ It has a unique icon and name so that users can distinguish it from other sites. ▸ It displays something to the user while resources are downloaded or restored from cache. ▸ It provides default display characterstics to the browser to avoid too abrupt transition when site resources become available.
  • 47. OFFLINE PROGRESSIVE WEB APPLICATIONS SIMPLE MANIFEST JSON
  • 48. OFFLINE PROGRESSIVE WEB APPLICATIONS APP MANIFEST TOOLS ▸ http://realfavicongenerator.net/ ▸ http://preview.pwabuilder.com
  • 50. OFFLINE PROGRESSIVE WEB APPLICATIONS WEB PUSH API 1. A device downloads your web app containing an already created publicKey, referred to in scripts as the applicationServerKey. Your web app installs a service worker. 2. During the subscription flow the browser contacts the messaging server to create a new subscription and returns it to the app. Note: You don't need to know the URL of the message server. Each browser vendor manages it's own message server for its browser. 3. After the subscription flow, your app passes a subscription object back to your app server. 4. At some later point, your app server sends a message to the messaging server, which forwards it to the recipient.
  • 51. WE DON'T NEED FIREBASE / GOOGLE CLOUD MESSAGING SENDER ID ( GCM_SENDER_ID ) ANYMORE!
  • 52. OFFLINE PROGRESSIVE WEB APPLICATIONS VOLUNTARY APPLICATION SERVER IDENTIFICATION (VAPID) ▸ Your application server creates a public/private key pair. The public key is given to your web app. ▸ When the user elects to receive pushes, add the public key to the subscribe() call's options object. ▸ When your app server sends a push message, include a signed JSON Web Token along with the public key.
  • 53. OFFLINE PROGRESSIVE WEB APPLICATIONS OTHER SERVICE WORKER APIS ▸ Payment Request API ▸ Credential Management API
  • 54. OFFLINE PROGRESSIVE WEB APPLICATIONS ▸ Payment Request API Workflow
  • 55. IN PURSUIT OF SPEED
  • 56. OFFLINE PROGRESSIVE WEB APPLICATIONS SERVER SIDE RENDERING ▸ First Meaningful Paint - The time at which the user feels that the primary content of the page is visible. ▸ Rendering front-end JavaScript applications on the server.
  • 58.
  • 59.
  • 61. FOLLOW ME @ http://github.com/iliaidakiev/