Skip to content

Commit 0a041fe

Browse files
cdbc6e8 fix(core): fix ng generate @angular/core:output-migration (#60626)
1 parent 0cdee0b commit 0a041fe

7 files changed

Lines changed: 36 additions & 20 deletions

File tree

BUILD_INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Wed Apr 2 14:05:07 UTC 2025
2-
316fabb814da5cca80591751232dcf10b511df21
1+
Wed Apr 2 14:33:21 UTC 2025
2+
cdbc6e8ec1ebacaee1862ed3da69bef41d214792

config/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v20.0.0-next.4+sha-316fabb
2+
* @license Angular v20.0.0-next.4+sha-cdbc6e8
33
* (c) 2010-2025 Google LLC. https://angular.io/
44
* License: MIT
55
*/

fesm2022/config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v20.0.0-next.4+sha-316fabb
2+
* @license Angular v20.0.0-next.4+sha-cdbc6e8
33
* (c) 2010-2025 Google LLC. https://angular.io/
44
* License: MIT
55
*/

fesm2022/service-worker.mjs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v20.0.0-next.4+sha-316fabb
2+
* @license Angular v20.0.0-next.4+sha-cdbc6e8
33
* (c) 2010-2025 Google LLC. https://angular.io/
44
* License: MIT
55
*/
@@ -275,10 +275,10 @@ class SwPush {
275275
decodeBase64(input) {
276276
return atob(input);
277277
}
278-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: SwPush, deps: [{ token: NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
279-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: SwPush });
278+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: SwPush, deps: [{ token: NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
279+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: SwPush });
280280
}
281-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: SwPush, decorators: [{
281+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: SwPush, decorators: [{
282282
type: Injectable
283283
}], ctorParameters: () => [{ type: NgswCommChannel }] });
284284

@@ -377,10 +377,10 @@ class SwUpdate {
377377
const nonce = this.sw.generateNonce();
378378
return this.sw.postMessageWithOperation('ACTIVATE_UPDATE', { nonce }, nonce);
379379
}
380-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: SwUpdate, deps: [{ token: NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
381-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: SwUpdate });
380+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: SwUpdate, deps: [{ token: NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
381+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: SwUpdate });
382382
}
383-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: SwUpdate, decorators: [{
383+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: SwUpdate, decorators: [{
384384
type: Injectable
385385
}], ctorParameters: () => [{ type: NgswCommChannel }] });
386386

@@ -568,11 +568,11 @@ class ServiceWorkerModule {
568568
providers: [provideServiceWorker(script, options)],
569569
};
570570
}
571-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: ServiceWorkerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
572-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: ServiceWorkerModule });
573-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: ServiceWorkerModule, providers: [SwPush, SwUpdate] });
571+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: ServiceWorkerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
572+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: ServiceWorkerModule });
573+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: ServiceWorkerModule, providers: [SwPush, SwUpdate] });
574574
}
575-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-316fabb", ngImport: i0, type: ServiceWorkerModule, decorators: [{
575+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4+sha-cdbc6e8", ngImport: i0, type: ServiceWorkerModule, decorators: [{
576576
type: NgModule,
577577
args: [{ providers: [SwPush, SwUpdate] }]
578578
}] });

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v20.0.0-next.4+sha-316fabb
2+
* @license Angular v20.0.0-next.4+sha-cdbc6e8
33
* (c) 2010-2025 Google LLC. https://angular.io/
44
* License: MIT
55
*/

ngsw-worker.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ ${error.stack}`;
10691069
};
10701070

10711071
// bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/debug.mjs
1072-
var SW_VERSION = "20.0.0-next.4+sha-316fabb";
1072+
var SW_VERSION = "20.0.0-next.4+sha-cdbc6e8";
10731073
var DEBUG_LOG_BUFFER_SIZE = 100;
10741074
var DebugHandler = class {
10751075
constructor(driver, adapter2) {
@@ -1579,7 +1579,8 @@ ${msgIdle}`, { headers: this.adapter.newHeaders({ "Content-Type": "text/plain" }
15791579
return this.versions.get(hash);
15801580
}
15811581
async assignVersion(event) {
1582-
const clientId = event.resultingClientId || event.clientId;
1582+
const isWorkerScriptRequest = event.request.destination === "worker" && event.resultingClientId && event.clientId;
1583+
const clientId = isWorkerScriptRequest ? event.clientId : event.resultingClientId || event.clientId;
15831584
if (clientId) {
15841585
if (this.clientVersionMap.has(clientId)) {
15851586
const hash = this.clientVersionMap.get(clientId);
@@ -1594,6 +1595,14 @@ ${msgIdle}`, { headers: this.adapter.newHeaders({ "Content-Type": "text/plain" }
15941595
}
15951596
appVersion = this.lookupVersionByHash(this.latestHash, "assignVersion");
15961597
}
1598+
if (isWorkerScriptRequest) {
1599+
if (!this.clientVersionMap.has(event.resultingClientId)) {
1600+
this.clientVersionMap.set(event.resultingClientId, hash);
1601+
await this.sync();
1602+
} else if (this.clientVersionMap.get(event.resultingClientId) !== hash) {
1603+
throw new Error(`Version mismatch between worker client ${event.resultingClientId} and requesting client ${clientId}`);
1604+
}
1605+
}
15971606
return appVersion;
15981607
} else {
15991608
if (this.state !== DriverReadyState.NORMAL) {
@@ -1602,6 +1611,13 @@ ${msgIdle}`, { headers: this.adapter.newHeaders({ "Content-Type": "text/plain" }
16021611
if (this.latestHash === null) {
16031612
throw new Error(`Invariant violated (assignVersion): latestHash was null`);
16041613
}
1614+
if (isWorkerScriptRequest) {
1615+
if (!this.clientVersionMap.has(event.resultingClientId)) {
1616+
this.clientVersionMap.set(event.resultingClientId, this.latestHash);
1617+
} else if (this.clientVersionMap.get(event.resultingClientId) !== this.latestHash) {
1618+
throw new Error(`Version mismatch between worker client ${event.resultingClientId} and requesting client ${clientId}`);
1619+
}
1620+
}
16051621
this.clientVersionMap.set(clientId, this.latestHash);
16061622
await this.sync();
16071623
return this.lookupVersionByHash(this.latestHash, "assignVersion");

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/service-worker",
3-
"version": "20.0.0-next.4+sha-316fabb",
3+
"version": "20.0.0-next.4+sha-cdbc6e8",
44
"description": "Angular - service worker tooling!",
55
"author": "angular",
66
"license": "MIT",
@@ -33,7 +33,7 @@
3333
"tslib": "^2.3.0"
3434
},
3535
"peerDependencies": {
36-
"@angular/core": "20.0.0-next.4+sha-316fabb",
36+
"@angular/core": "20.0.0-next.4+sha-cdbc6e8",
3737
"rxjs": "^6.5.3 || ^7.4.0"
3838
},
3939
"repository": {

0 commit comments

Comments
 (0)