Progressive Web App
Utilisez les standards du web pour développer vos applications mobiles
Editions ENI
Avant-propos
Chapitre 1
Introduction
1. Généralités9
2. Deux sigles : PRPL et FIRE13
3. Success stories15
4. Solutions concurrentes16
4.1 Applications natives17
4.2 Applications web17
4.3 Applications hybrides18
5. Ce qui ne sera pas abordé dans ce livre19
5.1 Initialisation d'une PWA avec Angular19
5.2 Initialisation d'une PWA avec React20
5.3 Initialisation d'une PWA avec Vue.js20
6. Présentation de l'application fil rouge21
Chapitre 2
Prérequis
1. Introduction25
2. Responsive Web Design25
2.1 Définition du viewport26
2.2 Media queries27
3. Outils d'aide aux développement d'application web mobile30
4. Performances34
4.1 Optimisation de la taille des livrables34
4.2 Lazy loading35
4.3 Pattern Module/No Module36
4.4 Compression des ressources statiques38
4.5 Optimisation de l'application en fonction des capacités de l'appareil39
4.6 Chargement du strict minimum et le plus rapidement possible39
4.7 Automating client hints40
5. HTTPS41
6. Auditer une application41
7. Application fil rouge44
Chapitre 3
Web App Manifest
1. Introduction49
2. Contenu à définir51
3. Add to Home Screen58
4. Critères pour avoir une application installable62
5. Custom Install Banner62
6. Interaction CSS et JavaScript66
7. Compatibilité navigateurs67
8. Application fil rouge69
Chapitre 4
Promise et Fetch
1. Introduction75
2. Objet Promise76
2.1 Présentation76
2.2 Méthodes utilitaires79
2.3 Conversions81
2.4 Async/Await82
3. API Fetch83
4. Application fil rouge86
Chapitre 5
Service Worker
1. Introduction89
2. Enregistrement du Service Worker90
3. Communication avec le Service Worker94
4. Événements96
4.1 Événement fetch96
4.2 Événement install98
4.3 Événement activate100
4.4 Événements updatefound et statechange100
5. Utilisation de scripts externes102
6. Cache du Service Worker103
7. Débogage d'un Service Worker104
8. Compatibilité navigateurs105
9. Application fil rouge106
Chapitre 6
Cache
1. Introduction115
2. Événements offline et online116
3. API Network Information117
4. API Cache118
4.1 Méthode add119
4.2 Méthode addAll119
4.3 Méthode match119
4.4 Méthode matchAll120
4.5 Méthode put120
4.6 Méthode delete121
4.7 Méthode keys121
5. Où utiliser 1API Cache ?122
6. Premières interaction avec l'API Cache123
7. Intégration dans les Service Workers124
8. Stratégies de mise en cache126
8.1 Cache only127
8.2 Network only128
8.3 Network falling back to cache128
8.4 Stale-while-revalidate128
8.5 Stratégie complexe129
9. Versionning du cache130
10. Workbox131
11. API Content Indexing134
12. Compatibilité navigateurs136
13. Application fil rouge138
Chapitre 7
IndexedDB
1. Introduction145
2. API localStorage et sessionStorage145
3. API IndexedDB147
4. Manipuler des objectStore149
5. Manipuler des données152
6. Cursor156
7. Index157
8. Stratégie de stockage159
9. Compatibilité navigateurs161
10. Application fil rouge162
Chapitre 8
Background Sync
1. Introduction165
2. API Background Sync166
3. API Periodic Background Sync172
4. Compatibilité navigateurs174
5. Application fil rouge174
Chapitre 9
Performances générales
1. Introduction183
2. Concaténation184
3. Suppression du code non nécessaire185
4. Gestion des images186
4.1 Sprites187
4.2 Balise picture187
4.3 Attribut loading188
4.4 Domain sharding189
4.5 IntersectionObserver190
5. Chargement des fichiers JavaScript192
6. Priority hints194
7. Server-side rendering194
8. Application fil rouge197
Chapitre 10
HTTP/2
1. Introduction207
2. Premiers pas avec HTTP/2208
3. Nouvelles fonctionnalités209
3.1 Format binaire209
3.2 TLS209
3.3 Multiplexage210
3.4 Compression des headers210
3.5 Server push213
4. Activation du protocole HTTP/2 avec Nginx215
5. Compatibilité navigateurs217
6. Application fil rouge218
Chapitre 11
Notifications
1. Introduction219
2. API Notification220
3. API Push224
4. Événements227
5. Mise en place côté serveur228
6. API Notification Triggers235
7. Compatibilité navigateurs236
8. Application fil rouge237
Chapitre 12
Projet Fugu
1. Introduction239
2. API Geolocation241
3. API Screen Orientation244
4. API Badging246
5. API Contact Picker247
6. API Get Installed Related Apps249
7. API Wake Lock251
8. API Shape Detection252
9. API Web Share255
10. API Web Share Target256
11. API SMS Receiver257
12. API Payment Request258
13. API Picture in Picture263
14. API Portal266
15. Application fil rouge269
Chapitre 13
Déploiement sur les stores
1. Introduction277
2. Play Store278
3. Apple Store281
4. Microsoft Store283
5. pwabuilder283
Annexes
Boîte à outils
1. Outils vus dans le chapitre Prérequis285
2. Outils vus dans le chapitre Web App Manifest285
3. Outils vus dans le chapitre Promise et Fetch287
4. Outils vus dans le chapitre Service Worker287
5. Outils vus dans le chapitre Cache288
6. Outils vus dans le chapitre IndexedDB289
7. Outils vus dans le chapitre Background Sync289
8. Outils vus dans le chapitre Performances générales290
9. Outils vus dans le chapitre HTTP/2291
10. Outils vus dans le chapitre Notifications291
11. Outils vus dans le chapitre Déploiement sur les stores292
Index293