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
How not to mess up your first PWA
Search
Dmitri Pisarev
June 18, 2020
Programming
0
56
How not to mess up your first PWA
Dmitri Pisarev
June 18, 2020
Tweet
Share
More Decks by Dmitri Pisarev
See All by Dmitri Pisarev
React State Management
dimaip
0
130
Closing the Gap - For all who are tired of choosing between Apps and Websites
dimaip
0
47
Docker 101 - From Development to Production and back
dimaip
0
130
Your CSS Code Needs an Architect
dimaip
0
42
Other Decks in Programming
See All in Programming
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
220
複雑なドメインに挑む.pdf
yukisakai1225
5
980
Improving my own Ruby thereafter
sisshiki1969
1
150
Testing Trophyは叫ばない
toms74209200
0
690
コンテキストエンジニアリング Cursor編
kinopeee
1
760
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
820
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
130
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
380
Namespace and Its Future
tagomoris
6
690
ぬるぬる動かせ! Riveでアニメーション実装🐾
kno3a87
1
110
MLH State of the League: 2026 Season
theycallmeswift
0
220
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
460k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
186
54k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.1k
Scaling GitHub
holman
463
140k
A Tale of Four Properties
chriscoyier
160
23k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
Bash Introduction
62gerente
615
210k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Typedesign – Prime Four
hannesfritz
42
2.8k
Fireside Chat
paigeccino
39
3.6k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Transcript
Dmitri Pisarev, Neos Conference 2020 How not to Mess up
Your First PWA Wish I knew this stuff earlier…
- Christian believer ❤ - Into web dev since 2005
- Volunteer @ SFI.ru - Part-time @ DEED - team member Dmitri Pisarev Me, COVID-19 edition @dimaip dimaip.github.io
https://c.psmb.ru
None
http://dimaip.github.io/2015/11/15/react-neos/ https://github.com/bwaidelich/Wwwision.Neos.GraphQL
Some research
None
None
None
Why Native Apps are so engaging? + offline, performance, reliability
+ push notifications + home screen icon, OS integration + hardware access
Native Apps + Web React Native Flutter, Xamarin Cordova/Capacitor -
3x effort - Web is an afterthought - Yoga !== CSS - No JS no Love - WebView << Safari/Chrome - App Store review?! Options?
How about PWAs?
What are PWAs? + Offline (ServiceWorker) + push notifications (WebPush)
+ home screen icon (manifest.json) + other cool web APIs
Useful Web APIs + WebShare + WebAuthn + RequestPayment +
WebRTC + WebPush
iOS + SW support since iOS 11.3 - No App
Store - No push notifications - No install prompt - No SW in WKWebView Support Android + PWA paradise! + Submit to Play Market as Trusted Web Activity
Mobile Integration
Desktop Integration
https://love2dev.com/pwa/
Let’s write some code!
Challenge 1. ServiceWorkers are rocket science
manifest.json index.html
Let’s go offline some.js sw.js
We are stuck! - Reload? - Restart device? - Delete
service worker? - Replace with empty service worker? ⏳ - HTTP header Clear-Site-Data: "*"
Caching Strategies - Stale-While-Revalidate - Cache First (Cache Falling Back
to Network) - Network First (Network Falling Back to Cache) - Network Only Hand-rolling is hard and dangerous!
Workbox to mask some complexity Warning! Workbox is a leaky
abstraction! sw.js
Challenge 2. Getting PWA to self-update
Service Worker Lifecycle
sw.js
https://redfin.engineering/service-workers-break-the-browsers-refresh-button-by-default-here-s-why-56f9417694 Must read:
Don’t wait for reload …on iOS 12 it may not
happen soon
Challenge 3. Deploying an app with code-splitting
Deploying an app with code-splitting
Solution 1. Keep previous versions of assets PROS: the most
reliable solution CONS: not many platforms support it out of the box
Solution 2. Catch exceptions and force-reload SW PROS: works with
all deployment platforms CONS: horrible UX for stateful apps
Solution 3. Pre-cache all JS bundles with a service worker
PROS: prefetching makes sense in many cases anyways CONS: does not conserve bandwidth
Make it look native
Viewport, Icons, loading screen
CSS to disable some browser effects Use with caution and
keep a11y in mind!
Meet platform expectations!
Ionic Components
Dark Mode
Useful tools
None
pwabuilder.com
None
1. Choose the right platform 2. Make sure you understand
Service Workers well 3. Pretend to be native Too long; Didn’t listen
It’s open source! ❤ github.com/dimaip/calendar
@dimaip dimaip.github.io dev.to/dimaip Say Hi!