@rxap/service-worker 19.2.0 → 21.0.1-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/compodoc/changelog.html +30 -0
  3. package/compodoc/components/ServiceWorkerUpdateDialogComponent.html +123 -93
  4. package/compodoc/dependencies.html +7 -7
  5. package/compodoc/injectables/AutoUpdateService.html +4 -59
  6. package/compodoc/injectables/CheckForUpdateService.html +6 -72
  7. package/compodoc/injectables/DialogUpdateService.html +15 -78
  8. package/compodoc/injectables/LogUpdateService.html +4 -53
  9. package/compodoc/js/search/search_index.js +2 -2
  10. package/compodoc/properties.html +1 -1
  11. package/docs/documentation.json +212 -472
  12. package/docs/html/assets/search.js +1 -1
  13. package/docs/html/classes/AutoUpdateService.html +2 -2
  14. package/docs/html/classes/CheckForUpdateService.html +2 -2
  15. package/docs/html/classes/DialogUpdateService.html +2 -2
  16. package/docs/html/classes/LogUpdateService.html +2 -2
  17. package/docs/html/classes/ServiceWorkerUpdateDialogComponent.html +2 -6
  18. package/docs/html/classes/SnackbarUpdateService.html +2 -2
  19. package/docs/html/functions/ProvideServiceWorkerUpdater.html +1 -1
  20. package/docs/html/functions/UnregisterServiceWorker.html +1 -1
  21. package/docs/html/functions/withAutoUpdater.html +1 -1
  22. package/docs/html/functions/withDialogUpdater.html +1 -1
  23. package/docs/html/functions/withLogUpdater.html +1 -1
  24. package/docs/html/functions/withSnackbarUpdater.html +1 -1
  25. package/docs/html/index.html +2 -2
  26. package/docs/html/modules.html +1 -1
  27. package/docs/html/variables/UPDATE_AVAILABLE_EVENT.html +1 -1
  28. package/docs/markdown/README.md +1 -1
  29. package/docs/markdown/classes/AutoUpdateService.md +4 -12
  30. package/docs/markdown/classes/CheckForUpdateService.md +4 -16
  31. package/docs/markdown/classes/DialogUpdateService.md +4 -16
  32. package/docs/markdown/classes/LogUpdateService.md +4 -12
  33. package/docs/markdown/classes/ServiceWorkerUpdateDialogComponent.md +10 -32
  34. package/docs/markdown/classes/SnackbarUpdateService.md +3 -3
  35. package/docs/markdown/functions/ProvideServiceWorkerUpdater.md +2 -2
  36. package/docs/markdown/functions/UnregisterServiceWorker.md +2 -2
  37. package/docs/markdown/functions/withAutoUpdater.md +2 -2
  38. package/docs/markdown/functions/withDialogUpdater.md +2 -2
  39. package/docs/markdown/functions/withLogUpdater.md +2 -2
  40. package/docs/markdown/functions/withSnackbarUpdater.md +2 -2
  41. package/docs/markdown/globals.md +2 -2
  42. package/docs/markdown/variables/UPDATE_AVAILABLE_EVENT.md +2 -2
  43. package/docs/wiki/Class.AutoUpdateService.md +3 -11
  44. package/docs/wiki/Class.CheckForUpdateService.md +3 -15
  45. package/docs/wiki/Class.DialogUpdateService.md +3 -15
  46. package/docs/wiki/Class.LogUpdateService.md +3 -11
  47. package/docs/wiki/Class.ServiceWorkerUpdateDialogComponent.md +9 -31
  48. package/docs/wiki/Class.SnackbarUpdateService.md +2 -2
  49. package/docs/wiki/Function.ProvideServiceWorkerUpdater.md +1 -1
  50. package/docs/wiki/Function.UnregisterServiceWorker.md +1 -1
  51. package/docs/wiki/Function.withAutoUpdater.md +1 -1
  52. package/docs/wiki/Function.withDialogUpdater.md +1 -1
  53. package/docs/wiki/Function.withLogUpdater.md +1 -1
  54. package/docs/wiki/Function.withSnackbarUpdater.md +1 -1
  55. package/docs/wiki/Variable.UPDATE_AVAILABLE_EVENT.md +1 -1
  56. package/docs/wiki/globals.md +1 -1
  57. package/fesm2022/rxap-service-worker.mjs +51 -82
  58. package/fesm2022/rxap-service-worker.mjs.map +1 -1
  59. package/package.json +20 -19
  60. package/types/rxap-service-worker.d.ts +66 -0
  61. package/index.d.ts +0 -8
  62. package/lib/auto-update.service.d.ts +0 -9
  63. package/lib/check-for-update.service.d.ts +0 -12
  64. package/lib/dialog-update.service.d.ts +0 -12
  65. package/lib/log-update.service.d.ts +0 -9
  66. package/lib/provide-service-worker-updater.d.ts +0 -6
  67. package/lib/service-worker-update-dialog/service-worker-update-dialog.component.d.ts +0 -13
  68. package/lib/snackbar-update.service.d.ts +0 -9
  69. package/lib/unregister-service-worker.d.ts +0 -2
@@ -151,66 +151,6 @@
151
151
  </table>
152
152
  </section>
153
153
 
154
- <section data-compodoc="block-constructor">
155
- <h3 id="constructor">Constructor</h3>
156
- <table class="table table-sm table-bordered">
157
- <tbody>
158
- <tr>
159
- <td class="col-md-4">
160
- <code>constructor(applicationRef: ApplicationRef, updates: SwUpdate)</code>
161
- </td>
162
- </tr>
163
- <tr>
164
- <td class="col-md-4">
165
- <div class="io-line">Defined in <a href="" data-line="28" class="link-to-prism">src/lib/dialog-update.service.ts:28</a></div>
166
- </td>
167
- </tr>
168
-
169
- <tr>
170
- <td class="col-md-4">
171
- <div>
172
- <b>Parameters :</b>
173
- <table class="params">
174
- <thead>
175
- <tr>
176
- <td>Name</td>
177
- <td>Type</td>
178
- <td>Optional</td>
179
- </tr>
180
- </thead>
181
- <tbody>
182
- <tr>
183
- <td>applicationRef</td>
184
-
185
- <td>
186
- <code>ApplicationRef</code>
187
- </td>
188
-
189
- <td>
190
- No
191
- </td>
192
-
193
- </tr>
194
- <tr>
195
- <td>updates</td>
196
-
197
- <td>
198
- <code>SwUpdate</code>
199
- </td>
200
-
201
- <td>
202
- No
203
- </td>
204
-
205
- </tr>
206
- </tbody>
207
- </table>
208
- </div>
209
- </td>
210
- </tr>
211
- </tbody>
212
- </table>
213
- </section>
214
154
 
215
155
  <section data-compodoc="block-methods">
216
156
 
@@ -239,8 +179,8 @@
239
179
 
240
180
  <tr>
241
181
  <td class="col-md-4">
242
- <div class="io-line">Defined in <a href="" data-line="37"
243
- class="link-to-prism">src/lib/dialog-update.service.ts:37</a></div>
182
+ <div class="io-line">Defined in <a href="" data-line="30"
183
+ class="link-to-prism">src/lib/dialog-update.service.ts:30</a></div>
244
184
  </td>
245
185
  </tr>
246
186
 
@@ -262,20 +202,17 @@
262
202
 
263
203
 
264
204
  <div class="tab-pane fade tab-source-code" id="source">
265
- <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
266
- ApplicationRef,
267
- createComponent,
268
- Inject,
269
- Injectable,
270
- Injector,
271
- } from &#x27;@angular/core&#x27;;
205
+ <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { ApplicationRef, createComponent, Injectable, Injector, inject } from &#x27;@angular/core&#x27;;
206
+ import { outputToObservable } from &#x27;@angular/core/rxjs-interop&#x27;;
272
207
  import {
273
208
  SwUpdate,
274
209
  VersionEvent,
275
210
  } from &#x27;@angular/service-worker&#x27;;
276
211
  import {
277
212
  filter,
213
+ finalize,
278
214
  Observable,
215
+ take,
279
216
  } from &#x27;rxjs&#x27;;
280
217
  import {
281
218
  concatMap,
@@ -290,13 +227,9 @@ import {
290
227
  providedIn: &#x27;root&#x27;,
291
228
  })
292
229
  export class DialogUpdateService {
293
- constructor(
294
- @Inject(ApplicationRef)
295
- private readonly applicationRef: ApplicationRef,
296
- @Inject(SwUpdate)
297
- private readonly updates: SwUpdate,
298
- ) {
299
- }
230
+ private readonly applicationRef &#x3D; inject&lt;ApplicationRef&gt;(ApplicationRef);
231
+ private readonly updates &#x3D; inject&lt;SwUpdate&gt;(SwUpdate);
232
+
300
233
 
301
234
  public start(): void {
302
235
  console.debug(&#x27;start dialog update service&#x27;);
@@ -334,8 +267,12 @@ export class DialogUpdateService {
334
267
  });
335
268
  this.applicationRef.attachView(componentRef.hostView);
336
269
 
337
- return componentRef.instance.closeDialog.pipe(
338
- tap(() &#x3D;&gt; {
270
+ // The cleanup must run after the close event has been forwarded. Destroying the component
271
+ // inside a tap completes the output observable before the value reaches the subscriber,
272
+ // so the update would never be activated.
273
+ return outputToObservable(componentRef.instance.closeDialog).pipe(
274
+ take(1),
275
+ finalize(() &#x3D;&gt; {
339
276
  componentRef.destroy();
340
277
  body.removeChild(div);
341
278
  div.remove();
@@ -151,54 +151,6 @@
151
151
  </table>
152
152
  </section>
153
153
 
154
- <section data-compodoc="block-constructor">
155
- <h3 id="constructor">Constructor</h3>
156
- <table class="table table-sm table-bordered">
157
- <tbody>
158
- <tr>
159
- <td class="col-md-4">
160
- <code>constructor(updates: SwUpdate)</code>
161
- </td>
162
- </tr>
163
- <tr>
164
- <td class="col-md-4">
165
- <div class="io-line">Defined in <a href="" data-line="8" class="link-to-prism">src/lib/log-update.service.ts:8</a></div>
166
- </td>
167
- </tr>
168
-
169
- <tr>
170
- <td class="col-md-4">
171
- <div>
172
- <b>Parameters :</b>
173
- <table class="params">
174
- <thead>
175
- <tr>
176
- <td>Name</td>
177
- <td>Type</td>
178
- <td>Optional</td>
179
- </tr>
180
- </thead>
181
- <tbody>
182
- <tr>
183
- <td>updates</td>
184
-
185
- <td>
186
- <code>SwUpdate</code>
187
- </td>
188
-
189
- <td>
190
- No
191
- </td>
192
-
193
- </tr>
194
- </tbody>
195
- </table>
196
- </div>
197
- </td>
198
- </tr>
199
- </tbody>
200
- </table>
201
- </section>
202
154
 
203
155
  <section data-compodoc="block-methods">
204
156
 
@@ -227,8 +179,8 @@
227
179
 
228
180
  <tr>
229
181
  <td class="col-md-4">
230
- <div class="io-line">Defined in <a href="" data-line="13"
231
- class="link-to-prism">src/lib/log-update.service.ts:13</a></div>
182
+ <div class="io-line">Defined in <a href="" data-line="12"
183
+ class="link-to-prism">src/lib/log-update.service.ts:12</a></div>
232
184
  </td>
233
185
  </tr>
234
186
 
@@ -250,7 +202,7 @@
250
202
 
251
203
 
252
204
  <div class="tab-pane fade tab-source-code" id="source">
253
- <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from &#x27;@angular/core&#x27;;
205
+ <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable, inject } from &#x27;@angular/core&#x27;;
254
206
  import { SwUpdate } from &#x27;@angular/service-worker&#x27;;
255
207
  import { filter } from &#x27;rxjs&#x27;;
256
208
 
@@ -258,9 +210,8 @@ import { filter } from &#x27;rxjs&#x27;;
258
210
  providedIn: &#x27;root&#x27;,
259
211
  })
260
212
  export class LogUpdateService {
213
+ private readonly updates &#x3D; inject(SwUpdate);
261
214
 
262
- constructor(private readonly updates: SwUpdate) {
263
- }
264
215
 
265
216
  public start() {
266
217
  console.debug(&#x27;start log update&#x27;);