@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.
- package/CHANGELOG.md +32 -0
- package/compodoc/changelog.html +30 -0
- package/compodoc/components/ServiceWorkerUpdateDialogComponent.html +123 -93
- package/compodoc/dependencies.html +7 -7
- package/compodoc/injectables/AutoUpdateService.html +4 -59
- package/compodoc/injectables/CheckForUpdateService.html +6 -72
- package/compodoc/injectables/DialogUpdateService.html +15 -78
- package/compodoc/injectables/LogUpdateService.html +4 -53
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +212 -472
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/AutoUpdateService.html +2 -2
- package/docs/html/classes/CheckForUpdateService.html +2 -2
- package/docs/html/classes/DialogUpdateService.html +2 -2
- package/docs/html/classes/LogUpdateService.html +2 -2
- package/docs/html/classes/ServiceWorkerUpdateDialogComponent.html +2 -6
- package/docs/html/classes/SnackbarUpdateService.html +2 -2
- package/docs/html/functions/ProvideServiceWorkerUpdater.html +1 -1
- package/docs/html/functions/UnregisterServiceWorker.html +1 -1
- package/docs/html/functions/withAutoUpdater.html +1 -1
- package/docs/html/functions/withDialogUpdater.html +1 -1
- package/docs/html/functions/withLogUpdater.html +1 -1
- package/docs/html/functions/withSnackbarUpdater.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/variables/UPDATE_AVAILABLE_EVENT.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/AutoUpdateService.md +4 -12
- package/docs/markdown/classes/CheckForUpdateService.md +4 -16
- package/docs/markdown/classes/DialogUpdateService.md +4 -16
- package/docs/markdown/classes/LogUpdateService.md +4 -12
- package/docs/markdown/classes/ServiceWorkerUpdateDialogComponent.md +10 -32
- package/docs/markdown/classes/SnackbarUpdateService.md +3 -3
- package/docs/markdown/functions/ProvideServiceWorkerUpdater.md +2 -2
- package/docs/markdown/functions/UnregisterServiceWorker.md +2 -2
- package/docs/markdown/functions/withAutoUpdater.md +2 -2
- package/docs/markdown/functions/withDialogUpdater.md +2 -2
- package/docs/markdown/functions/withLogUpdater.md +2 -2
- package/docs/markdown/functions/withSnackbarUpdater.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/variables/UPDATE_AVAILABLE_EVENT.md +2 -2
- package/docs/wiki/Class.AutoUpdateService.md +3 -11
- package/docs/wiki/Class.CheckForUpdateService.md +3 -15
- package/docs/wiki/Class.DialogUpdateService.md +3 -15
- package/docs/wiki/Class.LogUpdateService.md +3 -11
- package/docs/wiki/Class.ServiceWorkerUpdateDialogComponent.md +9 -31
- package/docs/wiki/Class.SnackbarUpdateService.md +2 -2
- package/docs/wiki/Function.ProvideServiceWorkerUpdater.md +1 -1
- package/docs/wiki/Function.UnregisterServiceWorker.md +1 -1
- package/docs/wiki/Function.withAutoUpdater.md +1 -1
- package/docs/wiki/Function.withDialogUpdater.md +1 -1
- package/docs/wiki/Function.withLogUpdater.md +1 -1
- package/docs/wiki/Function.withSnackbarUpdater.md +1 -1
- package/docs/wiki/Variable.UPDATE_AVAILABLE_EVENT.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-service-worker.mjs +51 -82
- package/fesm2022/rxap-service-worker.mjs.map +1 -1
- package/package.json +20 -19
- package/types/rxap-service-worker.d.ts +66 -0
- package/index.d.ts +0 -8
- package/lib/auto-update.service.d.ts +0 -9
- package/lib/check-for-update.service.d.ts +0 -12
- package/lib/dialog-update.service.d.ts +0 -12
- package/lib/log-update.service.d.ts +0 -9
- package/lib/provide-service-worker-updater.d.ts +0 -6
- package/lib/service-worker-update-dialog/service-worker-update-dialog.component.d.ts +0 -13
- package/lib/snackbar-update.service.d.ts +0 -9
- 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="
|
|
243
|
-
class="link-to-prism">src/lib/dialog-update.service.ts:
|
|
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
|
-
|
|
267
|
-
createComponent,
|
|
268
|
-
Inject,
|
|
269
|
-
Injectable,
|
|
270
|
-
Injector,
|
|
271
|
-
} from '@angular/core';
|
|
205
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { ApplicationRef, createComponent, Injectable, Injector, inject } from '@angular/core';
|
|
206
|
+
import { outputToObservable } from '@angular/core/rxjs-interop';
|
|
272
207
|
import {
|
|
273
208
|
SwUpdate,
|
|
274
209
|
VersionEvent,
|
|
275
210
|
} from '@angular/service-worker';
|
|
276
211
|
import {
|
|
277
212
|
filter,
|
|
213
|
+
finalize,
|
|
278
214
|
Observable,
|
|
215
|
+
take,
|
|
279
216
|
} from 'rxjs';
|
|
280
217
|
import {
|
|
281
218
|
concatMap,
|
|
@@ -290,13 +227,9 @@ import {
|
|
|
290
227
|
providedIn: 'root',
|
|
291
228
|
})
|
|
292
229
|
export class DialogUpdateService {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
@Inject(SwUpdate)
|
|
297
|
-
private readonly updates: SwUpdate,
|
|
298
|
-
) {
|
|
299
|
-
}
|
|
230
|
+
private readonly applicationRef = inject<ApplicationRef>(ApplicationRef);
|
|
231
|
+
private readonly updates = inject<SwUpdate>(SwUpdate);
|
|
232
|
+
|
|
300
233
|
|
|
301
234
|
public start(): void {
|
|
302
235
|
console.debug('start dialog update service');
|
|
@@ -334,8 +267,12 @@ export class DialogUpdateService {
|
|
|
334
267
|
});
|
|
335
268
|
this.applicationRef.attachView(componentRef.hostView);
|
|
336
269
|
|
|
337
|
-
|
|
338
|
-
|
|
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(() => {
|
|
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="
|
|
231
|
-
class="link-to-prism">src/lib/log-update.service.ts:
|
|
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 '@angular/core';
|
|
205
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable, inject } from '@angular/core';
|
|
254
206
|
import { SwUpdate } from '@angular/service-worker';
|
|
255
207
|
import { filter } from 'rxjs';
|
|
256
208
|
|
|
@@ -258,9 +210,8 @@ import { filter } from 'rxjs';
|
|
|
258
210
|
providedIn: 'root',
|
|
259
211
|
})
|
|
260
212
|
export class LogUpdateService {
|
|
213
|
+
private readonly updates = inject(SwUpdate);
|
|
261
214
|
|
|
262
|
-
constructor(private readonly updates: SwUpdate) {
|
|
263
|
-
}
|
|
264
215
|
|
|
265
216
|
public start() {
|
|
266
217
|
console.debug('start log update');
|