@angular/service-worker 20.1.0-rc.0 → 20.1.0
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/config/index.d.ts +1 -1
- package/fesm2022/config.mjs +1 -1
- package/fesm2022/service-worker.mjs +11 -11
- package/index.d.ts +1 -1
- package/ngsw-worker.js +1 -48
- package/package.json +2 -2
package/config/index.d.ts
CHANGED
package/fesm2022/config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.1.0
|
|
2
|
+
* @license Angular v20.1.0
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -344,10 +344,10 @@ class SwPush {
|
|
|
344
344
|
decodeBase64(input) {
|
|
345
345
|
return atob(input);
|
|
346
346
|
}
|
|
347
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0
|
|
348
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0
|
|
347
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: SwPush, deps: [{ token: NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
348
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: SwPush });
|
|
349
349
|
}
|
|
350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0
|
|
350
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: SwPush, decorators: [{
|
|
351
351
|
type: Injectable
|
|
352
352
|
}], ctorParameters: () => [{ type: NgswCommChannel }] });
|
|
353
353
|
|
|
@@ -455,10 +455,10 @@ class SwUpdate {
|
|
|
455
455
|
const nonce = this.sw.generateNonce();
|
|
456
456
|
return this.sw.postMessageWithOperation('ACTIVATE_UPDATE', { nonce }, nonce);
|
|
457
457
|
}
|
|
458
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0
|
|
459
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0
|
|
458
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: SwUpdate, deps: [{ token: NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
459
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: SwUpdate });
|
|
460
460
|
}
|
|
461
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: SwUpdate, decorators: [{
|
|
462
462
|
type: Injectable
|
|
463
463
|
}], ctorParameters: () => [{ type: NgswCommChannel }] });
|
|
464
464
|
|
|
@@ -649,11 +649,11 @@ class ServiceWorkerModule {
|
|
|
649
649
|
providers: [provideServiceWorker(script, options)],
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0
|
|
653
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.0
|
|
654
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.0
|
|
652
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ServiceWorkerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
653
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.0", ngImport: i0, type: ServiceWorkerModule });
|
|
654
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ServiceWorkerModule, providers: [SwPush, SwUpdate] });
|
|
655
655
|
}
|
|
656
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0
|
|
656
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ServiceWorkerModule, decorators: [{
|
|
657
657
|
type: NgModule,
|
|
658
658
|
args: [{ providers: [SwPush, SwUpdate] }]
|
|
659
659
|
}] });
|
package/index.d.ts
CHANGED
package/ngsw-worker.js
CHANGED
|
@@ -1069,7 +1069,7 @@ ${error.stack}`;
|
|
|
1069
1069
|
};
|
|
1070
1070
|
|
|
1071
1071
|
// bazel-out/k8-fastbuild/bin/packages/service-worker/worker/src/debug.js
|
|
1072
|
-
var SW_VERSION = "20.1.0
|
|
1072
|
+
var SW_VERSION = "20.1.0";
|
|
1073
1073
|
var DEBUG_LOG_BUFFER_SIZE = 100;
|
|
1074
1074
|
var DebugHandler = class {
|
|
1075
1075
|
constructor(driver, adapter2) {
|
|
@@ -1316,10 +1316,6 @@ ${msgIdle}`, { headers: this.adapter.newHeaders({ "Content-Type": "text/plain" }
|
|
|
1316
1316
|
if (req.headers.has("ngsw-bypass") || /[?&]ngsw-bypass(?:[=&]|$)/i.test(requestUrlObj.search)) {
|
|
1317
1317
|
return;
|
|
1318
1318
|
}
|
|
1319
|
-
if (req.headers.has("range")) {
|
|
1320
|
-
event.respondWith(this.handleRangeRequest(req));
|
|
1321
|
-
return;
|
|
1322
|
-
}
|
|
1323
1319
|
if (requestUrlObj.path === this.ngswStatePath) {
|
|
1324
1320
|
event.respondWith(this.debugger.handleFetch(req));
|
|
1325
1321
|
return;
|
|
@@ -1341,49 +1337,6 @@ ${msgIdle}`, { headers: this.adapter.newHeaders({ "Content-Type": "text/plain" }
|
|
|
1341
1337
|
}
|
|
1342
1338
|
event.respondWith(this.handleFetch(event));
|
|
1343
1339
|
}
|
|
1344
|
-
async handleRangeRequest(req) {
|
|
1345
|
-
try {
|
|
1346
|
-
const response = await fetch(req);
|
|
1347
|
-
const contentType = response.headers.get("Content-Type");
|
|
1348
|
-
if (!contentType || !contentType.startsWith("video/")) {
|
|
1349
|
-
return response;
|
|
1350
|
-
}
|
|
1351
|
-
const rangeHeader = req.headers.get("range");
|
|
1352
|
-
if (!rangeHeader) {
|
|
1353
|
-
return new Response(null, {
|
|
1354
|
-
status: 416,
|
|
1355
|
-
statusText: "Range Not Satisfiable"
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
|
-
const rangeMatch = /bytes=(\d+)-(\d+)?/.exec(rangeHeader);
|
|
1359
|
-
if (!rangeMatch) {
|
|
1360
|
-
return new Response(null, {
|
|
1361
|
-
status: 416,
|
|
1362
|
-
statusText: "Range Not Satisfiable"
|
|
1363
|
-
});
|
|
1364
|
-
}
|
|
1365
|
-
const start = Number(rangeMatch[1]);
|
|
1366
|
-
const end = rangeMatch[2] ? Number(rangeMatch[2]) : void 0;
|
|
1367
|
-
const buffer = await response.arrayBuffer();
|
|
1368
|
-
const contentLength = buffer.byteLength;
|
|
1369
|
-
const chunk = buffer.slice(start, end ? end + 1 : contentLength);
|
|
1370
|
-
const chunkLength = chunk.byteLength;
|
|
1371
|
-
const headers = new Headers(response.headers);
|
|
1372
|
-
headers.set("Content-Range", `bytes ${start}-${end ? end : contentLength - 1}/${contentLength}`);
|
|
1373
|
-
headers.set("Content-Length", chunkLength.toString());
|
|
1374
|
-
headers.set("Accept-Ranges", "bytes");
|
|
1375
|
-
return new Response(chunk, {
|
|
1376
|
-
status: 206,
|
|
1377
|
-
statusText: "Partial Content",
|
|
1378
|
-
headers
|
|
1379
|
-
});
|
|
1380
|
-
} catch (error) {
|
|
1381
|
-
return new Response(null, {
|
|
1382
|
-
status: 500,
|
|
1383
|
-
statusText: "Internal Server Error"
|
|
1384
|
-
});
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
1340
|
onMessage(event) {
|
|
1388
1341
|
if (this.state === DriverReadyState.SAFE_MODE) {
|
|
1389
1342
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/service-worker",
|
|
3
|
-
"version": "20.1.0
|
|
3
|
+
"version": "20.1.0",
|
|
4
4
|
"description": "Angular - service worker tooling!",
|
|
5
5
|
"author": "angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"tslib": "^2.3.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@angular/core": "20.1.0
|
|
36
|
+
"@angular/core": "20.1.0",
|
|
37
37
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|