From b6dbec6c546641371deef0d5cdf8641094f1e03f Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 8 Jan 2025 20:02:43 +0000 Subject: [PATCH 01/91] 280ee38 release: cut the v19.1.0-rc.0 release --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index d09b235a..95498e42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-next.2+sha-6fc31fd", + "version": "19.1.0-rc.0+sha-280ee38", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6fc31fd", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#280ee38", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#6fc31fd", + "@angular/ssr": "github:angular/angular-ssr-builds#280ee38", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#6fc31fd", + "@angular/ssr": "github:angular/angular-ssr-builds#280ee38", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index f37ca6c7..4a564ec5 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-next.2+sha-6fc31fd'; +const VERSION = '19.1.0-rc.0+sha-280ee38'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 9df7c6da..5c37596e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 08 2025 19:42:08 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 08 2025 20:02:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 9bcd71e161b9c3d8afbe8263de619f9b2c0dddc3 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 9 Jan 2025 08:53:01 +0000 Subject: [PATCH 02/91] 0412c53 build: never use interop targets for ts compilations --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 95498e42..2bffb20d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-280ee38", + "version": "19.1.0-rc.0+sha-0412c53", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#280ee38", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#0412c53", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#280ee38", + "@angular/ssr": "github:angular/angular-ssr-builds#0412c53", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#280ee38", + "@angular/ssr": "github:angular/angular-ssr-builds#0412c53", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 4a564ec5..6e0fca89 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-280ee38'; +const VERSION = '19.1.0-rc.0+sha-0412c53'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 5c37596e..2ea15ee4 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 08 2025 20:02:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 09 2025 08:53:01 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ee35453e87f39fbb4956fdbc4aaecb5c8ebe8e17 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 9 Jan 2025 15:15:36 +0000 Subject: [PATCH 03/91] 8aa1ce6 fix(@angular/build): handle loaders correctly in SSR bundles for external packages --- package.json | 8 ++-- src/tools/esbuild/application-code-bundle.js | 42 ++++++++++---------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 2bffb20d..6af33d0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-0412c53", + "version": "19.1.0-rc.0+sha-8aa1ce6", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#0412c53", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8aa1ce6", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#0412c53", + "@angular/ssr": "github:angular/angular-ssr-builds#8aa1ce6", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#0412c53", + "@angular/ssr": "github:angular/angular-ssr-builds#8aa1ce6", "less": { "optional": true }, diff --git a/src/tools/esbuild/application-code-bundle.js b/src/tools/esbuild/application-code-bundle.js index 55848e09..1b09464b 100644 --- a/src/tools/esbuild/application-code-bundle.js +++ b/src/tools/esbuild/application-code-bundle.js @@ -65,19 +65,7 @@ function createBrowserCodeBundleOptions(options, target, sourceFileCache, styles if (options.plugins) { buildOptions.plugins?.push(...options.plugins); } - if (options.externalPackages) { - // Package files affected by a customized loader should not be implicitly marked as external - if (options.loaderExtensions || - options.plugins || - typeof options.externalPackages === 'object') { - // Plugin must be added after custom plugins to ensure any added loader options are considered - buildOptions.plugins?.push((0, external_packages_plugin_1.createExternalPackagesPlugin)(options.externalPackages !== true ? options.externalPackages : undefined)); - } - else { - // Safe to use the packages external option directly - buildOptions.packages = 'external'; - } - } + appendOptionsForExternalPackages(options, buildOptions); return buildOptions; }; } @@ -207,10 +195,7 @@ function createServerMainCodeBundleOptions(options, target, sourceFileCache, sty ], }; buildOptions.plugins ??= []; - if (externalPackages) { - buildOptions.packages = 'external'; - } - else { + if (!externalPackages) { buildOptions.plugins.push((0, rxjs_esm_resolution_plugin_1.createRxjsEsmResolutionPlugin)()); } // Mark manifest and polyfills file as external as these are generated by a different bundle step. @@ -269,6 +254,7 @@ function createServerMainCodeBundleOptions(options, target, sourceFileCache, sty if (options.plugins) { buildOptions.plugins.push(...options.plugins); } + appendOptionsForExternalPackages(options, buildOptions); return buildOptions; }; } @@ -311,10 +297,7 @@ function createSsrEntryCodeBundleOptions(options, target, sourceFileCache, style ], }; buildOptions.plugins ??= []; - if (externalPackages) { - buildOptions.packages = 'external'; - } - else { + if (!externalPackages) { buildOptions.plugins.push((0, rxjs_esm_resolution_plugin_1.createRxjsEsmResolutionPlugin)()); } // Mark manifest file as external. As this will be generated later on. @@ -370,6 +353,7 @@ function createSsrEntryCodeBundleOptions(options, target, sourceFileCache, style if (options.plugins) { buildOptions.plugins.push(...options.plugins); } + appendOptionsForExternalPackages(options, buildOptions); return buildOptions; }; } @@ -528,3 +512,19 @@ function entryFileToWorkspaceRelative(workspaceRoot, entryFile) { .replace(/.[mc]?ts$/, '') .replace(/\\/g, '/')); } +function appendOptionsForExternalPackages(options, buildOptions) { + if (!options.externalPackages) { + return; + } + buildOptions.plugins ??= []; + // Package files affected by a customized loader should not be implicitly marked as external + if (options.loaderExtensions || options.plugins || typeof options.externalPackages === 'object') { + // Plugin must be added after custom plugins to ensure any added loader options are considered + buildOptions.plugins.push((0, external_packages_plugin_1.createExternalPackagesPlugin)(options.externalPackages !== true ? options.externalPackages : undefined)); + buildOptions.packages = undefined; + } + else { + // Safe to use the packages external option directly + buildOptions.packages = 'external'; + } +} diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6e0fca89..a145708b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-0412c53'; +const VERSION = '19.1.0-rc.0+sha-8aa1ce6'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 2ea15ee4..5cda77ea 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 09 2025 08:53:01 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 09 2025 15:15:36 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 3d905f2559263d739eaba80dc1b3682653c49571 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 9 Jan 2025 16:13:34 +0000 Subject: [PATCH 04/91] e74300a fix(@angular/build): use component updates for component style HMR --- package.json | 8 ++++---- src/builders/dev-server/vite-server.js | 2 +- src/utils/environment-options.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 6af33d0f..3f6b0f56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-8aa1ce6", + "version": "19.1.0-rc.0+sha-e74300a", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8aa1ce6", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#e74300a", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#8aa1ce6", + "@angular/ssr": "github:angular/angular-ssr-builds#e74300a", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#8aa1ce6", + "@angular/ssr": "github:angular/angular-ssr-builds#e74300a", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index f3e14d29..68ce4a85 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -103,7 +103,7 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context // https://nodejs.org/api/process.html#processsetsourcemapsenabledval process.setSourceMapsEnabled(true); } - // Enable to support link-based component style hot reloading (`NG_HMR_CSTYLES=0` can be used to disable selectively) + // Enable to support link-based component style hot reloading (`NG_HMR_CSTYLES=1` can be used to enable) browserOptions.externalRuntimeStyles = serverOptions.liveReload && serverOptions.hmr && environment_options_1.useComponentStyleHmr; // Enable to support component template hot replacement (`NG_HMR_TEMPLATE=0` can be used to disable selectively) diff --git a/src/utils/environment-options.js b/src/utils/environment-options.js index 2140fffc..ac113cd1 100644 --- a/src/utils/environment-options.js +++ b/src/utils/environment-options.js @@ -83,7 +83,7 @@ exports.useJSONBuildLogs = isPresent(buildLogsJsonVariable) && isEnabled(buildLo const optimizeChunksVariable = process.env['NG_BUILD_OPTIMIZE_CHUNKS']; exports.shouldOptimizeChunks = isPresent(optimizeChunksVariable) && isEnabled(optimizeChunksVariable); const hmrComponentStylesVariable = process.env['NG_HMR_CSTYLES']; -exports.useComponentStyleHmr = !isPresent(hmrComponentStylesVariable) || !isDisabled(hmrComponentStylesVariable); +exports.useComponentStyleHmr = isPresent(hmrComponentStylesVariable) && isEnabled(hmrComponentStylesVariable); const hmrComponentTemplateVariable = process.env['NG_HMR_TEMPLATES']; exports.useComponentTemplateHmr = !isPresent(hmrComponentTemplateVariable) || !isDisabled(hmrComponentTemplateVariable); const partialSsrBuildVariable = process.env['NG_BUILD_PARTIAL_SSR']; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a145708b..702a4fdc 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-8aa1ce6'; +const VERSION = '19.1.0-rc.0+sha-e74300a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 5cda77ea..5808c3ca 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 09 2025 15:15:36 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 09 2025 16:13:34 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 3c5068efbc0af2dcd774269a6c63efd75dea902f Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 10 Jan 2025 12:22:10 +0000 Subject: [PATCH 05/91] 3d5f02d fixup! build: migrate `@angular-devkit/architect` to `npm_package` --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3f6b0f56..353132e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-e74300a", + "version": "19.1.0-rc.0+sha-3d5f02d", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#e74300a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3d5f02d", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#e74300a", + "@angular/ssr": "github:angular/angular-ssr-builds#3d5f02d", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#e74300a", + "@angular/ssr": "github:angular/angular-ssr-builds#3d5f02d", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 702a4fdc..a04077ed 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-e74300a'; +const VERSION = '19.1.0-rc.0+sha-3d5f02d'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 5808c3ca..f2b813ce 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 09 2025 16:13:34 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 10 2025 12:22:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d7ef5b115a3bfee91031b7a42fcf0ac517b032ee Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 10 Jan 2025 14:12:10 +0000 Subject: [PATCH 06/91] 940ce56 ci: disable fixup commit messages --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 353132e1..e127eb18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-3d5f02d", + "version": "19.1.0-rc.0+sha-940ce56", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3d5f02d", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#940ce56", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#3d5f02d", + "@angular/ssr": "github:angular/angular-ssr-builds#940ce56", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#3d5f02d", + "@angular/ssr": "github:angular/angular-ssr-builds#940ce56", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a04077ed..8234f322 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-3d5f02d'; +const VERSION = '19.1.0-rc.0+sha-940ce56'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f2b813ce..4b1abe95 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 10 2025 12:22:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 10 2025 14:12:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From dab9851ddf76d944eb8bec44c8a03d288b31e1ff Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 10 Jan 2025 16:40:32 +0000 Subject: [PATCH 07/91] 3b9bd77 build: update `_exec` to handle timeouts gracefully when `waitForMatch` does not match within 60 seconds. --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e127eb18..715e5fd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-940ce56", + "version": "19.1.0-rc.0+sha-3b9bd77", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#940ce56", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3b9bd77", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#940ce56", + "@angular/ssr": "github:angular/angular-ssr-builds#3b9bd77", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#940ce56", + "@angular/ssr": "github:angular/angular-ssr-builds#3b9bd77", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 8234f322..873847dd 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-940ce56'; +const VERSION = '19.1.0-rc.0+sha-3b9bd77'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 4b1abe95..7f2e3906 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 10 2025 14:12:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 10 2025 16:40:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 3d8975d91ea21b21ae33d699307a1707b4ee1a1e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 10 Jan 2025 19:17:40 +0000 Subject: [PATCH 08/91] 955acef fix(@angular/build): trigger browser reload on asset changes with Vite dev server --- package.json | 8 ++-- src/builders/application/build-action.js | 41 +++++++++++------ src/builders/dev-server/vite-server.d.ts | 6 ++- src/builders/dev-server/vite-server.js | 44 ++++++++++++------- .../esbuild/bundler-execution-result.d.ts | 5 ++- src/tools/esbuild/bundler-execution-result.js | 1 + .../vite/middlewares/assets-middleware.d.ts | 4 +- .../vite/middlewares/assets-middleware.js | 8 ++-- .../plugins/setup-middlewares-plugin.d.ts | 4 +- src/tools/vite/utils.d.ts | 3 ++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 12 files changed, 82 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 715e5fd1..b776240b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-3b9bd77", + "version": "19.1.0-rc.0+sha-955acef", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3b9bd77", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#955acef", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#3b9bd77", + "@angular/ssr": "github:angular/angular-ssr-builds#955acef", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#3b9bd77", + "@angular/ssr": "github:angular/angular-ssr-builds#955acef", "less": { "optional": true }, diff --git a/src/builders/application/build-action.js b/src/builders/application/build-action.js index 0d6cacea..2e0358a8 100644 --- a/src/builders/application/build-action.js +++ b/src/builders/application/build-action.js @@ -164,7 +164,7 @@ async function* runEsBuildBuildAction(action, options) { if (staleWatchFiles?.size) { watcher.remove([...staleWatchFiles]); } - for (const outputResult of emitOutputResults(result, outputOptions, incrementalResults ? rebuildState.previousOutputInfo : undefined)) { + for (const outputResult of emitOutputResults(result, outputOptions, changes, incrementalResults ? rebuildState : undefined)) { yield outputResult; } } @@ -175,7 +175,7 @@ async function* runEsBuildBuildAction(action, options) { (0, sass_language_1.shutdownSassWorkerPool)(); } } -function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externalMetadata, htmlIndexPath, htmlBaseHref, templateUpdates, }, outputOptions, previousOutputInfo) { +function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externalMetadata, htmlIndexPath, htmlBaseHref, templateUpdates, }, outputOptions, changes, rebuildState) { if (errors.length > 0) { yield { kind: results_1.ResultKind.Failure, @@ -201,7 +201,8 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa yield updateResult; } // Use an incremental result if previous output information is available - if (previousOutputInfo) { + if (rebuildState && changes) { + const { previousAssetsInfo, previousOutputInfo } = rebuildState; const incrementalResult = { kind: results_1.ResultKind.Incremental, warnings: warnings, @@ -245,21 +246,33 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa }; } } - // Include the removed output files - incrementalResult.removed.push(...Array.from(removedOutputFiles, ([file, { type }]) => ({ - path: file, - type, - }))); - // Always consider asset files as added to ensure new/modified assets are available. - // TODO: Consider more comprehensive asset analysis. - for (const file of assetFiles) { - incrementalResult.added.push(file.destination); - incrementalResult.files[file.destination] = { + // Initially assume all previous assets files have been removed + const removedAssetFiles = new Map(previousAssetsInfo); + for (const { source, destination } of assetFiles) { + removedAssetFiles.delete(source); + if (!previousAssetsInfo.has(source)) { + incrementalResult.added.push(destination); + } + else if (changes.modified.has(source)) { + incrementalResult.modified.push(destination); + } + else { + continue; + } + incrementalResult.files[destination] = { type: bundler_context_1.BuildOutputFileType.Browser, - inputPath: file.source, + inputPath: source, origin: 'disk', }; } + // Include the removed output and asset files + incrementalResult.removed.push(...Array.from(removedOutputFiles, ([file, { type }]) => ({ + path: file, + type, + })), ...Array.from(removedAssetFiles.values(), (file) => ({ + path: file, + type: bundler_context_1.BuildOutputFileType.Browser, + }))); yield incrementalResult; return; } diff --git a/src/builders/dev-server/vite-server.d.ts b/src/builders/dev-server/vite-server.d.ts index c09a7338..2452ec43 100644 --- a/src/builders/dev-server/vite-server.d.ts +++ b/src/builders/dev-server/vite-server.d.ts @@ -23,6 +23,10 @@ interface OutputFileRecord { servable: boolean; type: BuildOutputFileType; } +interface OutputAssetRecord { + source: string; + updated: boolean; +} interface DevServerExternalResultMetadata extends Omit { explicitBrowser: string[]; explicitServer: string[]; @@ -34,5 +38,5 @@ export declare function serveWithVite(serverOptions: NormalizedDevServerOptions, middleware?: Connect.NextHandleFunction[]; buildPlugins?: Plugin[]; }): AsyncIterableIterator; -export declare function setupServer(serverOptions: NormalizedDevServerOptions, outputFiles: Map, assets: Map, preserveSymlinks: boolean | undefined, externalMetadata: DevServerExternalResultMetadata, ssrMode: ServerSsrMode, prebundleTransformer: JavaScriptTransformer, target: string[], zoneless: boolean, componentStyles: Map, templateUpdates: Map, prebundleLoaderExtensions: EsbuildLoaderOption | undefined, define: ApplicationBuilderInternalOptions['define'], extensionMiddleware?: Connect.NextHandleFunction[], indexHtmlTransformer?: (content: string) => Promise, thirdPartySourcemaps?: boolean): Promise; +export declare function setupServer(serverOptions: NormalizedDevServerOptions, outputFiles: Map, assets: Map, preserveSymlinks: boolean | undefined, externalMetadata: DevServerExternalResultMetadata, ssrMode: ServerSsrMode, prebundleTransformer: JavaScriptTransformer, target: string[], zoneless: boolean, componentStyles: Map, templateUpdates: Map, prebundleLoaderExtensions: EsbuildLoaderOption | undefined, define: ApplicationBuilderInternalOptions['define'], extensionMiddleware?: Connect.NextHandleFunction[], indexHtmlTransformer?: (content: string) => Promise, thirdPartySourcemaps?: boolean): Promise; export {}; diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 68ce4a85..36f3e34d 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -182,13 +182,8 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context assetFiles.clear(); componentStyles.clear(); generatedFiles.clear(); - for (const entry of Object.entries(result.files)) { - const [outputPath, file] = entry; - if (file.origin === 'disk') { - assetFiles.set('/' + normalizePath(outputPath), normalizePath(file.inputPath)); - continue; - } - updateResultRecord(outputPath, file, normalizePath, htmlIndexPath, generatedFiles, componentStyles, + for (const [outputPath, file] of Object.entries(result.files)) { + updateResultRecord(outputPath, file, normalizePath, htmlIndexPath, generatedFiles, assetFiles, componentStyles, // The initial build will not yet have a server setup !server); } @@ -207,10 +202,10 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context assetFiles.delete(filePath); } for (const modified of result.modified) { - updateResultRecord(modified, result.files[modified], normalizePath, htmlIndexPath, generatedFiles, componentStyles); + updateResultRecord(modified, result.files[modified], normalizePath, htmlIndexPath, generatedFiles, assetFiles, componentStyles); } for (const added of result.added) { - updateResultRecord(added, result.files[added], normalizePath, htmlIndexPath, generatedFiles, componentStyles); + updateResultRecord(added, result.files[added], normalizePath, htmlIndexPath, generatedFiles, assetFiles, componentStyles); } break; case results_1.ResultKind.ComponentUpdate: @@ -262,9 +257,12 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context if (server) { // Update fs allow list to include any new assets from the build option. server.config.server.fs.allow = [ - ...new Set([...server.config.server.fs.allow, ...assetFiles.values()]), + ...new Set([ + ...server.config.server.fs.allow, + ...[...assetFiles.values()].map(({ source }) => source), + ]), ]; - await handleUpdate(normalizePath, generatedFiles, server, serverOptions, context.logger, componentStyles); + await handleUpdate(normalizePath, generatedFiles, assetFiles, server, serverOptions, context.logger, componentStyles); } else { const projectName = context.target?.project; @@ -337,10 +335,18 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context } await new Promise((resolve) => (deferred = resolve)); } -async function handleUpdate(normalizePath, generatedFiles, server, serverOptions, logger, componentStyles) { +async function handleUpdate(normalizePath, generatedFiles, assetFiles, server, serverOptions, logger, componentStyles) { const updatedFiles = []; - let destroyAngularServerAppCalled = false; + // Invalidate any updated asset + for (const [file, record] of assetFiles) { + if (!record.updated) { + continue; + } + record.updated = false; + updatedFiles.push(file); + } // Invalidate any updated files + let destroyAngularServerAppCalled = false; for (const [file, record] of generatedFiles) { if (!record.updated) { continue; @@ -419,8 +425,12 @@ async function handleUpdate(normalizePath, generatedFiles, server, serverOptions logger.info('Page reload sent to client(s).'); } } -function updateResultRecord(outputPath, file, normalizePath, htmlIndexPath, generatedFiles, componentStyles, initial = false) { +function updateResultRecord(outputPath, file, normalizePath, htmlIndexPath, generatedFiles, assetFiles, componentStyles, initial = false) { if (file.origin === 'disk') { + assetFiles.set('/' + normalizePath(outputPath), { + source: normalizePath(file.inputPath), + updated: !initial, + }); return; } let filePath; @@ -542,7 +552,11 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, // The first two are required for Vite to function in prebundling mode (the default) and to load // the Vite client-side code for browser reloading. These would be available by default but when // the `allow` option is explicitly configured, they must be included manually. - allow: [cacheDir, (0, node_path_1.join)(serverOptions.workspaceRoot, 'node_modules'), ...assets.values()], + allow: [ + cacheDir, + (0, node_path_1.join)(serverOptions.workspaceRoot, 'node_modules'), + ...[...assets.values()].map(({ source }) => source), + ], }, // This is needed when `externalDependencies` is used to prevent Vite load errors. // NOTE: If Vite adds direct support for externals, this can be removed. diff --git a/src/tools/esbuild/bundler-execution-result.d.ts b/src/tools/esbuild/bundler-execution-result.d.ts index 6a490463..00c5b200 100644 --- a/src/tools/esbuild/bundler-execution-result.d.ts +++ b/src/tools/esbuild/bundler-execution-result.d.ts @@ -22,10 +22,11 @@ export interface RebuildState { componentStyleBundler: ComponentStylesheetBundler; codeBundleCache?: SourceFileCache; fileChanges: ChangedFiles; - previousOutputInfo: Map; + previousAssetsInfo: ReadonlyMap; templateUpdates?: Map; } export interface ExternalResultMetadata { @@ -86,7 +87,7 @@ export declare class ExecutionResult { }; get watchFiles(): Readonly; createRebuildState(fileChanges: ChangedFiles): RebuildState; - findChangedFiles(previousOutputHashes: Map): Set; diff --git a/src/tools/esbuild/bundler-execution-result.js b/src/tools/esbuild/bundler-execution-result.js index ede7b633..09dcd268 100644 --- a/src/tools/esbuild/bundler-execution-result.js +++ b/src/tools/esbuild/bundler-execution-result.js @@ -123,6 +123,7 @@ class ExecutionResult { componentStyleBundler: this.componentStyleBundler, fileChanges, previousOutputInfo: new Map(this.outputFiles.map(({ path, hash, type }) => [path, { hash, type }])), + previousAssetsInfo: new Map(this.assetFiles.map(({ source, destination }) => [source, destination])), templateUpdates: this.templateUpdates, }; } diff --git a/src/tools/vite/middlewares/assets-middleware.d.ts b/src/tools/vite/middlewares/assets-middleware.d.ts index 6b90881c..40d5e46e 100644 --- a/src/tools/vite/middlewares/assets-middleware.d.ts +++ b/src/tools/vite/middlewares/assets-middleware.d.ts @@ -6,10 +6,10 @@ * found in the LICENSE file at https://angular.dev/license */ import type { Connect, ViteDevServer } from 'vite'; -import { AngularMemoryOutputFiles } from '../utils'; +import { AngularMemoryOutputFiles, AngularOutputAssets } from '../utils'; export interface ComponentStyleRecord { rawContent: Uint8Array; used?: Set; reload?: boolean; } -export declare function createAngularAssetsMiddleware(server: ViteDevServer, assets: Map, outputFiles: AngularMemoryOutputFiles, componentStyles: Map, encapsulateStyle: (style: Uint8Array, componentId: string) => string): Connect.NextHandleFunction; +export declare function createAngularAssetsMiddleware(server: ViteDevServer, assets: AngularOutputAssets, outputFiles: AngularMemoryOutputFiles, componentStyles: Map, encapsulateStyle: (style: Uint8Array, componentId: string) => string): Connect.NextHandleFunction; diff --git a/src/tools/vite/middlewares/assets-middleware.js b/src/tools/vite/middlewares/assets-middleware.js index 73c827c4..0ab4daa9 100644 --- a/src/tools/vite/middlewares/assets-middleware.js +++ b/src/tools/vite/middlewares/assets-middleware.js @@ -22,15 +22,15 @@ function createAngularAssetsMiddleware(server, assets, outputFiles, componentSty const extension = (0, node_path_1.extname)(pathname); const pathnameHasTrailingSlash = pathname[pathname.length - 1] === '/'; // Rewrite all build assets to a vite raw fs URL - const assetSourcePath = assets.get(pathname); - if (assetSourcePath !== undefined) { + const asset = assets.get(pathname); + if (asset) { // Workaround to disable Vite transformer middleware. // See: https://github.com/vitejs/vite/blob/746a1daab0395f98f0afbdee8f364cb6cf2f3b3f/packages/vite/src/node/server/middlewares/transform.ts#L201 and // https://github.com/vitejs/vite/blob/746a1daab0395f98f0afbdee8f364cb6cf2f3b3f/packages/vite/src/node/server/transformRequest.ts#L204-L206 req.headers.accept = 'text/html'; // The encoding needs to match what happens in the vite static middleware. // ref: https://github.com/vitejs/vite/blob/d4f13bd81468961c8c926438e815ab6b1c82735e/packages/vite/src/node/server/middlewares/static.ts#L163 - req.url = `${server.config.base}@fs/${encodeURI(assetSourcePath)}`; + req.url = `${server.config.base}@fs/${encodeURI(asset.source)}`; next(); return; } @@ -43,7 +43,7 @@ function createAngularAssetsMiddleware(server, assets, outputFiles, componentSty : // Non-trailing slash check for fallback `.html` assets.get(pathname + '.html'); if (htmlAssetSourcePath) { - req.url = `${server.config.base}@fs/${encodeURI(htmlAssetSourcePath)}`; + req.url = `${server.config.base}@fs/${encodeURI(htmlAssetSourcePath.source)}`; next(); return; } diff --git a/src/tools/vite/plugins/setup-middlewares-plugin.d.ts b/src/tools/vite/plugins/setup-middlewares-plugin.d.ts index 3a467bf0..2b013ea0 100644 --- a/src/tools/vite/plugins/setup-middlewares-plugin.d.ts +++ b/src/tools/vite/plugins/setup-middlewares-plugin.d.ts @@ -7,7 +7,7 @@ */ import type { Connect, Plugin } from 'vite'; import { ComponentStyleRecord } from '../middlewares'; -import { AngularMemoryOutputFiles } from '../utils'; +import { AngularMemoryOutputFiles, AngularOutputAssets } from '../utils'; export declare enum ServerSsrMode { /** * No SSR @@ -32,7 +32,7 @@ export declare enum ServerSsrMode { } interface AngularSetupMiddlewaresPluginOptions { outputFiles: AngularMemoryOutputFiles; - assets: Map; + assets: AngularOutputAssets; extensionMiddleware?: Connect.NextHandleFunction[]; indexHtmlTransformer?: (content: string) => Promise; componentStyles: Map; diff --git a/src/tools/vite/utils.d.ts b/src/tools/vite/utils.d.ts index 350d692c..8cedb738 100644 --- a/src/tools/vite/utils.d.ts +++ b/src/tools/vite/utils.d.ts @@ -12,6 +12,9 @@ export type AngularMemoryOutputFiles = Map; +export type AngularOutputAssets = Map; export declare function pathnameWithoutBasePath(url: string, basePath: string): string; export declare function lookupMimeTypeFromRequest(url: string): string | undefined; export type EsbuildLoaderOption = Exclude['loader']; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 873847dd..38c92963 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-3b9bd77'; +const VERSION = '19.1.0-rc.0+sha-955acef'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7f2e3906..d5e0f7c7 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 10 2025 16:40:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 10 2025 19:17:40 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 3367bbf4d5685420fec6ceed41c20e237175b16e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 10 Jan 2025 19:58:49 +0000 Subject: [PATCH 09/91] d350f35 fix(@angular/build): correctly validate locales `subPath` --- package.json | 8 ++++---- src/utils/i18n-options.js | 6 +++--- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b776240b..e5477add 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-955acef", + "version": "19.1.0-rc.0+sha-d350f35", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#955acef", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d350f35", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#955acef", + "@angular/ssr": "github:angular/angular-ssr-builds#d350f35", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#955acef", + "@angular/ssr": "github:angular/angular-ssr-builds#d350f35", "less": { "optional": true }, diff --git a/src/utils/i18n-options.js b/src/utils/i18n-options.js index 024b3921..6332d8f7 100644 --- a/src/utils/i18n-options.js +++ b/src/utils/i18n-options.js @@ -39,7 +39,7 @@ function ensureString(value, name) { throw new Error(`Project field '${name}' is malformed. Expected a string.`); } } -function ensureValidsubPath(value, name) { +function ensureValidSubPath(value, name) { ensureString(value, name); if (!/^[\w-]*$/.test(value)) { throw new Error(`Project field '${name}' is invalid. It can only contain letters, numbers, hyphens, and underscores.`); @@ -78,7 +78,7 @@ function createI18nOptions(projectMetadata, inline, logger) { rawSourceLocaleBaseHref = metadata.sourceLocale.baseHref; } if (metadata.sourceLocale.subPath !== undefined) { - ensureValidsubPath(metadata.sourceLocale.subPath, 'i18n.sourceLocale.subPath'); + ensureValidSubPath(metadata.sourceLocale.subPath, 'i18n.sourceLocale.subPath'); rawsubPath = metadata.sourceLocale.subPath; } if (rawsubPath !== undefined && rawSourceLocaleBaseHref !== undefined) { @@ -111,7 +111,7 @@ function createI18nOptions(projectMetadata, inline, logger) { baseHref = options.baseHref; } if ('subPath' in options) { - ensureString(options.subPath, `i18n.locales.${locale}.subPath`); + ensureValidSubPath(options.subPath, `i18n.locales.${locale}.subPath`); subPath = options.subPath; } if (subPath !== undefined && baseHref !== undefined) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 38c92963..aeb49ae6 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-955acef'; +const VERSION = '19.1.0-rc.0+sha-d350f35'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index d5e0f7c7..a69d9b1b 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 10 2025 19:17:40 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 10 2025 19:58:49 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 114ac05580e72ad24e1e07fc3d8d15ff212dd3d0 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 13 Jan 2025 18:27:22 +0000 Subject: [PATCH 10/91] ad90eec build: support substituting/stamping files other than `package.json` --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e5477add..663a3542 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-d350f35", + "version": "19.1.0-rc.0+sha-ad90eec", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d350f35", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ad90eec", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#d350f35", + "@angular/ssr": "github:angular/angular-ssr-builds#ad90eec", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#d350f35", + "@angular/ssr": "github:angular/angular-ssr-builds#ad90eec", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index aeb49ae6..9a35d8f0 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-d350f35'; +const VERSION = '19.1.0-rc.0+sha-ad90eec'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index a69d9b1b..23173f22 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 10 2025 19:58:49 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 13 2025 18:27:22 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 6f389977d4d7f51c01d3871401b1599f3d1e2b85 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 13 Jan 2025 18:57:15 +0000 Subject: [PATCH 11/91] a0e54de refactor(@angular/cli): replace `VERSION` with Bazel-stamped version --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 663a3542..555b21d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-ad90eec", + "version": "19.1.0-rc.0+sha-a0e54de", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ad90eec", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a0e54de", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#ad90eec", + "@angular/ssr": "github:angular/angular-ssr-builds#a0e54de", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#ad90eec", + "@angular/ssr": "github:angular/angular-ssr-builds#a0e54de", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 9a35d8f0..9ab4d65d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-ad90eec'; +const VERSION = '19.1.0-rc.0+sha-a0e54de'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 23173f22..8ffb3e1d 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 13 2025 18:27:22 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 13 2025 18:57:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1e7486b77e40efd50f6927821f9e916f8f700a91 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 13 Jan 2025 21:09:21 +0000 Subject: [PATCH 12/91] a96f68e build: add script to diff local npm package with snapshot repository --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 555b21d2..fe1085c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-a0e54de", + "version": "19.1.0-rc.0+sha-a96f68e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a0e54de", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a96f68e", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#a0e54de", + "@angular/ssr": "github:angular/angular-ssr-builds#a96f68e", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#a0e54de", + "@angular/ssr": "github:angular/angular-ssr-builds#a96f68e", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 9ab4d65d..e662098d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-a0e54de'; +const VERSION = '19.1.0-rc.0+sha-a96f68e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 8ffb3e1d..f7af5605 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 13 2025 18:57:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 13 2025 21:09:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From a2e04aa46c6c59709f15ab53cfbbf31037acd16c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 14 Jan 2025 07:53:46 +0000 Subject: [PATCH 13/91] 8e110bb build: migrate @ngtools/webpack to npm_package --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fe1085c0..0788e3d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-a96f68e", + "version": "19.1.0-rc.0+sha-8e110bb", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a96f68e", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8e110bb", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#a96f68e", + "@angular/ssr": "github:angular/angular-ssr-builds#8e110bb", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#a96f68e", + "@angular/ssr": "github:angular/angular-ssr-builds#8e110bb", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index e662098d..7961d0e5 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-a96f68e'; +const VERSION = '19.1.0-rc.0+sha-8e110bb'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f7af5605..38816101 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 13 2025 21:09:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 14 2025 07:53:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 946831a9afc6667c768107abe26fad43495ad436 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 14 Jan 2025 08:51:41 +0000 Subject: [PATCH 14/91] 2f55209 fix(@angular-devkit/schematics): update `Rule` type to support returning a `Promise` of `Tree` --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0788e3d7..c1a851d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-8e110bb", + "version": "19.1.0-rc.0+sha-2f55209", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8e110bb", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2f55209", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#8e110bb", + "@angular/ssr": "github:angular/angular-ssr-builds#2f55209", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#8e110bb", + "@angular/ssr": "github:angular/angular-ssr-builds#2f55209", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 7961d0e5..0a003358 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-8e110bb'; +const VERSION = '19.1.0-rc.0+sha-2f55209'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 38816101..e368019d 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 14 2025 07:53:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 14 2025 08:51:41 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e814bfabd4d55554b5f409326f1ee8dfab42375d Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 14 Jan 2025 15:13:30 +0000 Subject: [PATCH 15/91] d52f853 build: migrate `@angular-devkit/schematics` to `npm_package` --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index c1a851d7..d6bdcbc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-2f55209", + "version": "19.1.0-rc.0+sha-d52f853", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2f55209", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d52f853", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#2f55209", + "@angular/ssr": "github:angular/angular-ssr-builds#d52f853", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#2f55209", + "@angular/ssr": "github:angular/angular-ssr-builds#d52f853", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 0a003358..51453975 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-2f55209'; +const VERSION = '19.1.0-rc.0+sha-d52f853'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e368019d..a0b43e51 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 14 2025 08:51:41 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 14 2025 15:13:30 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 5c69e7e6140bad8e9edcce9b0f26e763a2e66c07 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 14 Jan 2025 15:46:46 +0000 Subject: [PATCH 16/91] 89a05c1 refactor(@angular/build): move Angular compilation creation to build execution --- package.json | 8 ++--- src/builders/application/execute-build.js | 5 ++- src/builders/application/setup-bundling.d.ts | 3 +- src/builders/application/setup-bundling.js | 4 +-- src/private.d.ts | 11 +++---- src/private.js | 5 ++- .../esbuild/angular/compiler-plugin.d.ts | 6 ++-- src/tools/esbuild/angular/compiler-plugin.js | 31 +++++++++++++------ .../esbuild/application-code-bundle.d.ts | 3 +- src/tools/esbuild/application-code-bundle.js | 17 +++++++--- src/tools/esbuild/compiler-plugin-options.js | 1 - src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 13 files changed, 59 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index d6bdcbc6..1f8b5497 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-d52f853", + "version": "19.1.0-rc.0+sha-89a05c1", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d52f853", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#89a05c1", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#d52f853", + "@angular/ssr": "github:angular/angular-ssr-builds#89a05c1", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#d52f853", + "@angular/ssr": "github:angular/angular-ssr-builds#89a05c1", "less": { "optional": true }, diff --git a/src/builders/application/execute-build.js b/src/builders/application/execute-build.js index 99edaab9..a76618d2 100644 --- a/src/builders/application/execute-build.js +++ b/src/builders/application/execute-build.js @@ -41,6 +41,7 @@ var __importStar = (this && this.__importStar) || (function () { })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.executeBuild = executeBuild; +const compilation_1 = require("../../tools/angular/compilation"); const source_file_cache_1 = require("../../tools/esbuild/angular/source-file-cache"); const budget_stats_1 = require("../../tools/esbuild/budget-stats"); const bundler_context_1 = require("../../tools/esbuild/bundler-context"); @@ -102,7 +103,9 @@ async function executeBuild(options, context, rebuildState) { if (options.templateUpdates) { templateUpdates = new Map(); } - bundlerContexts = (0, setup_bundling_1.setupBundlerContexts)(options, target, codeBundleCache, componentStyleBundler, templateUpdates); + bundlerContexts = (0, setup_bundling_1.setupBundlerContexts)(options, target, codeBundleCache, componentStyleBundler, + // Create new reusable compilation for the appropriate mode based on the `jit` plugin option + await (0, compilation_1.createAngularCompilation)(!!options.jit, !options.serverEntryPoint), templateUpdates); // Bundle everything on initial build bundlingResult = await bundler_context_1.BundlerContext.bundleAll([ ...bundlerContexts.typescriptContexts, diff --git a/src/builders/application/setup-bundling.d.ts b/src/builders/application/setup-bundling.d.ts index 7561c1cb..ab0253c7 100644 --- a/src/builders/application/setup-bundling.d.ts +++ b/src/builders/application/setup-bundling.d.ts @@ -5,6 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ +import { AngularCompilation } from '../../tools/angular/compilation'; import { ComponentStylesheetBundler } from '../../tools/esbuild/angular/component-stylesheets'; import { SourceFileCache } from '../../tools/esbuild/angular/source-file-cache'; import { BundlerContext } from '../../tools/esbuild/bundler-context'; @@ -17,7 +18,7 @@ import { NormalizedApplicationBuildOptions } from './options'; * @param codeBundleCache An instance of the TypeScript source file cache. * @returns An array of BundlerContext objects. */ -export declare function setupBundlerContexts(options: NormalizedApplicationBuildOptions, target: string[], codeBundleCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler, templateUpdates: Map | undefined): { +export declare function setupBundlerContexts(options: NormalizedApplicationBuildOptions, target: string[], codeBundleCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler, angularCompilation: AngularCompilation, templateUpdates: Map | undefined): { typescriptContexts: BundlerContext[]; otherContexts: BundlerContext[]; }; diff --git a/src/builders/application/setup-bundling.js b/src/builders/application/setup-bundling.js index 38f3cea9..3d7e1ebf 100644 --- a/src/builders/application/setup-bundling.js +++ b/src/builders/application/setup-bundling.js @@ -23,12 +23,12 @@ const utils_1 = require("../../tools/esbuild/utils"); * @param codeBundleCache An instance of the TypeScript source file cache. * @returns An array of BundlerContext objects. */ -function setupBundlerContexts(options, target, codeBundleCache, stylesheetBundler, templateUpdates) { +function setupBundlerContexts(options, target, codeBundleCache, stylesheetBundler, angularCompilation, templateUpdates) { const { outputMode, serverEntryPoint, appShellOptions, prerenderOptions, ssrOptions, workspaceRoot, watch = false, } = options; const typescriptContexts = []; const otherContexts = []; // Browser application code - typescriptContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, (0, application_code_bundle_1.createBrowserCodeBundleOptions)(options, target, codeBundleCache, stylesheetBundler, templateUpdates))); + typescriptContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, (0, application_code_bundle_1.createBrowserCodeBundleOptions)(options, target, codeBundleCache, stylesheetBundler, angularCompilation, templateUpdates))); // Browser polyfills code const browserPolyfillBundleOptions = (0, application_code_bundle_1.createBrowserPolyfillBundleOptions)(options, target, codeBundleCache, stylesheetBundler); if (browserPolyfillBundleOptions) { diff --git a/src/private.d.ts b/src/private.d.ts index 1b9eeb7f..adfb7d03 100644 --- a/src/private.d.ts +++ b/src/private.d.ts @@ -5,12 +5,6 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -/** - * @fileoverview - * Private exports intended only for use with the @angular-devkit/build-angular package. - * All exports are not supported for external use, do not provide SemVer guarantees, and - * their existence may change in any future version. - */ import { CompilerPluginOptions } from './tools/esbuild/angular/compiler-plugin'; import { BundleStylesheetOptions } from './tools/esbuild/stylesheets/bundle-options'; export { buildApplicationInternal } from './builders/application'; @@ -25,7 +19,10 @@ export { SassWorkerImplementation } from './tools/sass/sass-service'; export { SourceFileCache } from './tools/esbuild/angular/source-file-cache'; export { createJitResourceTransformer } from './tools/angular/transformers/jit-resource-transformer'; export { JavaScriptTransformer } from './tools/esbuild/javascript-transformer'; -export declare function createCompilerPlugin(pluginOptions: CompilerPluginOptions, styleOptions: BundleStylesheetOptions & { +export declare function createCompilerPlugin(pluginOptions: CompilerPluginOptions & { + browserOnlyBuild?: boolean; + noopTypeScriptCompilation?: boolean; +}, styleOptions: BundleStylesheetOptions & { inlineStyleLanguage: string; }): import('esbuild').Plugin; export * from './utils/bundle-calculator'; diff --git a/src/private.js b/src/private.js index c634cd9f..6367133e 100644 --- a/src/private.js +++ b/src/private.js @@ -29,6 +29,7 @@ exports.createCompilerPlugin = createCompilerPlugin; * All exports are not supported for external use, do not provide SemVer guarantees, and * their existence may change in any future version. */ +const compilation_1 = require("./tools/angular/compilation"); const compiler_plugin_1 = require("./tools/esbuild/angular/compiler-plugin"); const component_stylesheets_1 = require("./tools/esbuild/angular/component-stylesheets"); // Builders @@ -53,7 +54,9 @@ Object.defineProperty(exports, "createJitResourceTransformer", { enumerable: tru var javascript_transformer_1 = require("./tools/esbuild/javascript-transformer"); Object.defineProperty(exports, "JavaScriptTransformer", { enumerable: true, get: function () { return javascript_transformer_1.JavaScriptTransformer; } }); function createCompilerPlugin(pluginOptions, styleOptions) { - return (0, compiler_plugin_1.createCompilerPlugin)(pluginOptions, new component_stylesheets_1.ComponentStylesheetBundler(styleOptions, styleOptions.inlineStyleLanguage, pluginOptions.incremental)); + return (0, compiler_plugin_1.createCompilerPlugin)(pluginOptions, pluginOptions.noopTypeScriptCompilation + ? new compilation_1.NoopCompilation() + : () => (0, compilation_1.createAngularCompilation)(!!pluginOptions.jit, !!pluginOptions.browserOnlyBuild), new component_stylesheets_1.ComponentStylesheetBundler(styleOptions, styleOptions.inlineStyleLanguage, pluginOptions.incremental)); } // Utilities __exportStar(require("./utils/bundle-calculator"), exports); diff --git a/src/tools/esbuild/angular/compiler-plugin.d.ts b/src/tools/esbuild/angular/compiler-plugin.d.ts index fa0abd9b..7fb0bb9e 100644 --- a/src/tools/esbuild/angular/compiler-plugin.d.ts +++ b/src/tools/esbuild/angular/compiler-plugin.d.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ import type { Plugin } from 'esbuild'; +import { AngularCompilation } from '../../angular/compilation'; import { LoadResultCache } from '../load-result-cache'; import { ComponentStylesheetBundler } from './component-stylesheets'; import { SourceFileCache } from './source-file-cache'; @@ -13,9 +14,6 @@ export interface CompilerPluginOptions { sourcemap: boolean | 'external'; tsconfig: string; jit?: boolean; - browserOnlyBuild?: boolean; - /** Skip TypeScript compilation setup. This is useful to re-use the TypeScript compilation from another plugin. */ - noopTypeScriptCompilation?: boolean; advancedOptimizations?: boolean; thirdPartySourcemaps?: boolean; fileReplacements?: Record; @@ -26,4 +24,4 @@ export interface CompilerPluginOptions { instrumentForCoverage?: (request: string) => boolean; templateUpdates?: Map; } -export declare function createCompilerPlugin(pluginOptions: CompilerPluginOptions, stylesheetBundler: ComponentStylesheetBundler): Plugin; +export declare function createCompilerPlugin(pluginOptions: CompilerPluginOptions, compilationOrFactory: AngularCompilation | (() => Promise), stylesheetBundler: ComponentStylesheetBundler): Plugin; diff --git a/src/tools/esbuild/angular/compiler-plugin.js b/src/tools/esbuild/angular/compiler-plugin.js index f6eb144d..0af0f275 100644 --- a/src/tools/esbuild/angular/compiler-plugin.js +++ b/src/tools/esbuild/angular/compiler-plugin.js @@ -56,7 +56,7 @@ const compilation_state_1 = require("./compilation-state"); const file_reference_tracker_1 = require("./file-reference-tracker"); const jit_plugin_callbacks_1 = require("./jit-plugin-callbacks"); // eslint-disable-next-line max-lines-per-function -function createCompilerPlugin(pluginOptions, stylesheetBundler) { +function createCompilerPlugin(pluginOptions, compilationOrFactory, stylesheetBundler) { return { name: 'angular-compiler', // eslint-disable-next-line max-lines-per-function @@ -94,16 +94,17 @@ function createCompilerPlugin(pluginOptions, stylesheetBundler) { // Setup defines based on the values used by the Angular compiler-cli build.initialOptions.define ??= {}; build.initialOptions.define['ngI18nClosureMode'] ??= 'false'; + // The factory is only relevant for compatibility purposes with the private API. + // TODO: Update private API in the next major to allow compilation function factory removal here. + const compilation = typeof compilationOrFactory === 'function' + ? await compilationOrFactory() + : compilationOrFactory; // The in-memory cache of TypeScript file outputs will be used during the build in `onLoad` callbacks for TS files. // A string value indicates direct TS/NG output and a Uint8Array indicates fully transformed code. const typeScriptFileCache = pluginOptions.sourceFileCache?.typeScriptFileCache ?? new Map(); // The resources from component stylesheets and web workers that will be added to the build results output files const additionalResults = new Map(); - // Create new reusable compilation for the appropriate mode based on the `jit` plugin option - const compilation = pluginOptions.noopTypeScriptCompilation - ? new compilation_1.NoopCompilation() - : await (0, compilation_1.createAngularCompilation)(!!pluginOptions.jit, !!pluginOptions.browserOnlyBuild); // Compilation is initially assumed to have errors until emitted let hasCompilationErrors = true; // Determines if TypeScript should process JavaScript files based on tsconfig `allowJs` option @@ -128,8 +129,8 @@ function createCompilerPlugin(pluginOptions, stylesheetBundler) { // Angular compiler which does not have direct knowledge of transitive resource // dependencies or web worker processing. let modifiedFiles; - if (pluginOptions.sourceFileCache?.modifiedFiles.size && - !pluginOptions.noopTypeScriptCompilation) { + if (!(compilation instanceof compilation_1.NoopCompilation) && + pluginOptions.sourceFileCache?.modifiedFiles.size) { // TODO: Differentiate between changed input files and stale output files modifiedFiles = referencedFileTracker.update(pluginOptions.sourceFileCache.modifiedFiles); pluginOptions.sourceFileCache.invalidate(modifiedFiles); @@ -141,9 +142,7 @@ function createCompilerPlugin(pluginOptions, stylesheetBundler) { // Remove any stale additional results based on modified files modifiedFiles.forEach((file) => additionalResults.delete(file)); } - if (!pluginOptions.noopTypeScriptCompilation && - compilation.update && - pluginOptions.sourceFileCache?.modifiedFiles.size) { + if (compilation.update && pluginOptions.sourceFileCache?.modifiedFiles.size) { await compilation.update(modifiedFiles ?? pluginOptions.sourceFileCache.modifiedFiles); } // Create Angular compiler host options @@ -523,6 +522,18 @@ function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserve notes: [{ text: `The 'module' option will be set to 'ES2022' instead.` }], }); } + if (compilerOptions.isolatedModules && compilerOptions.emitDecoratorMetadata) { + setupWarnings?.push({ + text: `TypeScript compiler option 'isolatedModules' may prevent the 'emitDecoratorMetadata' option from emitting all metadata.`, + location: null, + notes: [ + { + text: `The 'emitDecoratorMetadata' option is not required by Angular` + + 'and can be removed if not explictly required by the project.', + }, + ], + }); + } // Synchronize custom resolve conditions. // Set if using the supported bundler resolution mode (bundler is the default in new projects) if (compilerOptions.moduleResolution === 100 /* ModuleResolutionKind.Bundler */) { diff --git a/src/tools/esbuild/application-code-bundle.d.ts b/src/tools/esbuild/application-code-bundle.d.ts index 323a248d..adf9cfea 100644 --- a/src/tools/esbuild/application-code-bundle.d.ts +++ b/src/tools/esbuild/application-code-bundle.d.ts @@ -7,11 +7,12 @@ */ import type { BuildOptions } from 'esbuild'; import type { NormalizedApplicationBuildOptions } from '../../builders/application/options'; +import { AngularCompilation } from '../angular/compilation'; import { ComponentStylesheetBundler } from './angular/component-stylesheets'; import { SourceFileCache } from './angular/source-file-cache'; import { BundlerOptionsFactory } from './bundler-context'; import type { LoadResultCache } from './load-result-cache'; -export declare function createBrowserCodeBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], sourceFileCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler, templateUpdates: Map | undefined): BundlerOptionsFactory; +export declare function createBrowserCodeBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], sourceFileCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler, angularCompilation: AngularCompilation, templateUpdates: Map | undefined): BundlerOptionsFactory; export declare function createBrowserPolyfillBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], sourceFileCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler): BuildOptions | BundlerOptionsFactory | undefined; export declare function createServerPolyfillBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], loadResultCache: LoadResultCache | undefined): BundlerOptionsFactory | undefined; export declare function createServerMainCodeBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], sourceFileCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler): BundlerOptionsFactory; diff --git a/src/tools/esbuild/application-code-bundle.js b/src/tools/esbuild/application-code-bundle.js index 1b09464b..dea33231 100644 --- a/src/tools/esbuild/application-code-bundle.js +++ b/src/tools/esbuild/application-code-bundle.js @@ -21,6 +21,7 @@ const node_path_1 = require("node:path"); const schema_1 = require("../../builders/application/schema"); const environment_options_1 = require("../../utils/environment-options"); const manifest_1 = require("../../utils/server-rendering/manifest"); +const compilation_1 = require("../angular/compilation"); const compiler_plugin_1 = require("./angular/compiler-plugin"); const angular_localize_init_warning_plugin_1 = require("./angular-localize-init-warning-plugin"); const compiler_plugin_options_1 = require("./compiler-plugin-options"); @@ -33,7 +34,7 @@ const sourcemap_ignorelist_plugin_1 = require("./sourcemap-ignorelist-plugin"); const utils_1 = require("./utils"); const virtual_module_plugin_1 = require("./virtual-module-plugin"); const wasm_plugin_1 = require("./wasm-plugin"); -function createBrowserCodeBundleOptions(options, target, sourceFileCache, stylesheetBundler, templateUpdates) { +function createBrowserCodeBundleOptions(options, target, sourceFileCache, stylesheetBundler, angularCompilation, templateUpdates) { return (loadCache) => { const { entryPoints, outputNames, polyfills } = options; const pluginOptions = (0, compiler_plugin_options_1.createCompilerPluginOptions)(options, sourceFileCache, loadCache, templateUpdates); @@ -57,7 +58,7 @@ function createBrowserCodeBundleOptions(options, target, sourceFileCache, styles (0, angular_localize_init_warning_plugin_1.createAngularLocalizeInitWarningPlugin)(), (0, compiler_plugin_1.createCompilerPlugin)( // JS/TS options - pluginOptions, + pluginOptions, angularCompilation, // Component stylesheet bundler stylesheetBundler), ], @@ -97,7 +98,9 @@ function createBrowserPolyfillBundleOptions(options, target, sourceFileCache, st const pluginOptions = (0, compiler_plugin_options_1.createCompilerPluginOptions)(options, sourceFileCache); buildOptions.plugins.push((0, compiler_plugin_1.createCompilerPlugin)( // JS/TS options - { ...pluginOptions, noopTypeScriptCompilation: true }, + pluginOptions, + // Browser compilation handles the actual Angular code compilation + new compilation_1.NoopCompilation(), // Component stylesheet options are unused for polyfills but required by the plugin stylesheetBundler)); } @@ -189,7 +192,9 @@ function createServerMainCodeBundleOptions(options, target, sourceFileCache, sty (0, angular_localize_init_warning_plugin_1.createAngularLocalizeInitWarningPlugin)(), (0, compiler_plugin_1.createCompilerPlugin)( // JS/TS options - { ...pluginOptions, noopTypeScriptCompilation: true }, + pluginOptions, + // Browser compilation handles the actual Angular code compilation + new compilation_1.NoopCompilation(), // Component stylesheet bundler stylesheetBundler), ], @@ -291,7 +296,9 @@ function createSsrEntryCodeBundleOptions(options, target, sourceFileCache, style (0, angular_localize_init_warning_plugin_1.createAngularLocalizeInitWarningPlugin)(), (0, compiler_plugin_1.createCompilerPlugin)( // JS/TS options - { ...pluginOptions, noopTypeScriptCompilation: true }, + pluginOptions, + // Browser compilation handles the actual Angular code compilation + new compilation_1.NoopCompilation(), // Component stylesheet bundler stylesheetBundler), ], diff --git a/src/tools/esbuild/compiler-plugin-options.js b/src/tools/esbuild/compiler-plugin-options.js index 4d790286..3bc2dbf1 100644 --- a/src/tools/esbuild/compiler-plugin-options.js +++ b/src/tools/esbuild/compiler-plugin-options.js @@ -12,7 +12,6 @@ function createCompilerPluginOptions(options, sourceFileCache, loadResultCache, const { sourcemapOptions, tsconfig, fileReplacements, advancedOptimizations, jit, externalRuntimeStyles, instrumentForCoverage, } = options; const incremental = !!options.watch; return { - browserOnlyBuild: !options.serverEntryPoint, sourcemap: !!sourcemapOptions.scripts && (sourcemapOptions.hidden ? 'external' : true), thirdPartySourcemaps: sourcemapOptions.vendor, tsconfig, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 51453975..8c1d0cb6 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-d52f853'; +const VERSION = '19.1.0-rc.0+sha-89a05c1'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index a0b43e51..1d57047a 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 14 2025 15:13:30 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 14 2025 15:46:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 00efc7242a65bcd8970befbab4700166688e421d Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 15 Jan 2025 09:16:15 +0000 Subject: [PATCH 17/91] 738671e build: migrate @schematics/angular to npm_package --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1f8b5497..394b2cc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-89a05c1", + "version": "19.1.0-rc.0+sha-738671e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#89a05c1", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#738671e", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#89a05c1", + "@angular/ssr": "github:angular/angular-ssr-builds#738671e", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#89a05c1", + "@angular/ssr": "github:angular/angular-ssr-builds#738671e", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 8c1d0cb6..649fb809 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-89a05c1'; +const VERSION = '19.1.0-rc.0+sha-738671e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 1d57047a..853877a9 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 14 2025 15:46:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 15 2025 09:16:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 98a00fdf0a1c4b639fb8c9b0700bd9c819373bb3 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 15 Jan 2025 14:13:48 +0000 Subject: [PATCH 18/91] 230f636 refactor(@ngtools/webpack): add types to exported module variables --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 394b2cc7..90e62750 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-738671e", + "version": "19.1.0-rc.0+sha-230f636", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#738671e", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#230f636", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#738671e", + "@angular/ssr": "github:angular/angular-ssr-builds#230f636", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#738671e", + "@angular/ssr": "github:angular/angular-ssr-builds#230f636", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 649fb809..f7444de6 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-738671e'; +const VERSION = '19.1.0-rc.0+sha-230f636'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 853877a9..3fbe8808 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 15 2025 09:16:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 15 2025 14:13:48 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From a2b9302c333a6347e60fc9957a2946c05502c6f9 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 15 Jan 2025 16:44:14 +0000 Subject: [PATCH 19/91] 84bbfa5 build: migrate @angular-devkit/schematics-cli to npm_package --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 90e62750..011a52ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-230f636", + "version": "19.1.0-rc.0+sha-84bbfa5", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#230f636", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#84bbfa5", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#230f636", + "@angular/ssr": "github:angular/angular-ssr-builds#84bbfa5", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#230f636", + "@angular/ssr": "github:angular/angular-ssr-builds#84bbfa5", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index f7444de6..c0a59451 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-230f636'; +const VERSION = '19.1.0-rc.0+sha-84bbfa5'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 3fbe8808..b89f2795 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 15 2025 14:13:48 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 15 2025 16:44:14 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1371c35d1cbe4287bef3eff21954967e261da0b5 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 15 Jan 2025 19:05:24 +0000 Subject: [PATCH 20/91] a092dfd build: migrate `@angular-devkit/architect` jasmine test to native `rules_js` --- package.json | 8 ++++---- src/builders/application/index.d.ts | 7 ++++--- src/builders/application/index.js | 3 ++- src/builders/dev-server/index.d.ts | 6 ++++-- src/builders/dev-server/index.js | 3 ++- src/builders/extract-i18n/index.d.ts | 6 ++++-- src/builders/extract-i18n/index.js | 3 ++- src/builders/ng-packagr/index.d.ts | 6 ++++-- src/builders/ng-packagr/index.js | 3 ++- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 11 files changed, 30 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 011a52ee..c880111c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-84bbfa5", + "version": "19.1.0-rc.0+sha-a092dfd", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#84bbfa5", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a092dfd", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0 || ^19.1.0-next.0", "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#84bbfa5", + "@angular/ssr": "github:angular/angular-ssr-builds#a092dfd", "less": "^4.2.0", "ng-packagr": "^19.0.0 || ^19.1.0-next.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#84bbfa5", + "@angular/ssr": "github:angular/angular-ssr-builds#a092dfd", "less": { "optional": true }, diff --git a/src/builders/application/index.d.ts b/src/builders/application/index.d.ts index 42549e41..4d5d9b6a 100644 --- a/src/builders/application/index.d.ts +++ b/src/builders/application/index.d.ts @@ -5,7 +5,8 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -import { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; +import { Builder, BuilderContext, BuilderOutput } from '@angular-devkit/architect'; +import { json } from '@angular-devkit/core'; import { ApplicationBuilderExtensions, ApplicationBuilderInternalOptions } from './options'; import { Result } from './results'; import { Schema as ApplicationBuilderOptions } from './schema'; @@ -28,5 +29,5 @@ export declare function buildApplicationInternal(options: ApplicationBuilderInte * @returns The build output results of the build. */ export declare function buildApplication(options: ApplicationBuilderOptions, context: BuilderContext, extensions?: ApplicationBuilderExtensions): AsyncIterable; -declare const _default: import("../../../../../angular_devkit/architect/src/internal").Builder; -export default _default; +declare const builder: Builder; +export default builder; diff --git a/src/builders/application/index.js b/src/builders/application/index.js index 116ad942..05e0399a 100644 --- a/src/builders/application/index.js +++ b/src/builders/application/index.js @@ -196,4 +196,5 @@ function generateFullPath(filePath, type, outputOptions) { const fullFilePath = node_path_1.default.join(outputOptions.base, typeDirectory, filePath); return fullFilePath; } -exports.default = (0, architect_1.createBuilder)(buildApplication); +const builder = (0, architect_1.createBuilder)(buildApplication); +exports.default = builder; diff --git a/src/builders/dev-server/index.d.ts b/src/builders/dev-server/index.d.ts index 2757603f..5281f71c 100644 --- a/src/builders/dev-server/index.d.ts +++ b/src/builders/dev-server/index.d.ts @@ -5,10 +5,12 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ +import { Builder } from '@angular-devkit/architect'; +import { json } from '@angular-devkit/core'; import { execute } from './builder'; import type { DevServerBuilderOutput } from './output'; import type { Schema as DevServerBuilderOptions } from './schema'; export { type DevServerBuilderOptions, type DevServerBuilderOutput, execute as executeDevServerBuilder, }; -declare const _default: import("../../../../../angular_devkit/architect/src/internal").Builder; -export default _default; +declare const builder: Builder; +export default builder; export { execute as executeDevServer }; diff --git a/src/builders/dev-server/index.js b/src/builders/dev-server/index.js index 7c7352ce..599dd7c4 100644 --- a/src/builders/dev-server/index.js +++ b/src/builders/dev-server/index.js @@ -12,4 +12,5 @@ const architect_1 = require("@angular-devkit/architect"); const builder_1 = require("./builder"); Object.defineProperty(exports, "executeDevServerBuilder", { enumerable: true, get: function () { return builder_1.execute; } }); Object.defineProperty(exports, "executeDevServer", { enumerable: true, get: function () { return builder_1.execute; } }); -exports.default = (0, architect_1.createBuilder)(builder_1.execute); +const builder = (0, architect_1.createBuilder)(builder_1.execute); +exports.default = builder; diff --git a/src/builders/extract-i18n/index.d.ts b/src/builders/extract-i18n/index.d.ts index 030f922a..9c641b08 100644 --- a/src/builders/extract-i18n/index.d.ts +++ b/src/builders/extract-i18n/index.d.ts @@ -5,8 +5,10 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ +import { Builder } from '@angular-devkit/architect'; +import { json } from '@angular-devkit/core'; import { execute } from './builder'; import type { Schema as ExtractI18nBuilderOptions } from './schema'; export { ExtractI18nBuilderOptions, execute }; -declare const _default: import("../../../../../angular_devkit/architect/src/internal").Builder; -export default _default; +declare const builder: Builder; +export default builder; diff --git a/src/builders/extract-i18n/index.js b/src/builders/extract-i18n/index.js index a33fef33..f204f9f9 100644 --- a/src/builders/extract-i18n/index.js +++ b/src/builders/extract-i18n/index.js @@ -11,4 +11,5 @@ exports.execute = void 0; const architect_1 = require("@angular-devkit/architect"); const builder_1 = require("./builder"); Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return builder_1.execute; } }); -exports.default = (0, architect_1.createBuilder)(builder_1.execute); +const builder = (0, architect_1.createBuilder)(builder_1.execute); +exports.default = builder; diff --git a/src/builders/ng-packagr/index.d.ts b/src/builders/ng-packagr/index.d.ts index 08421cbb..96468079 100644 --- a/src/builders/ng-packagr/index.d.ts +++ b/src/builders/ng-packagr/index.d.ts @@ -5,8 +5,10 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ +import { Builder } from '@angular-devkit/architect'; +import { json } from '@angular-devkit/core'; import { execute } from './builder'; import type { Schema as NgPackagrBuilderOptions } from './schema'; export { type NgPackagrBuilderOptions, execute }; -declare const _default: import("../../../../../angular_devkit/architect/src/internal").Builder; -export default _default; +declare const builder: Builder; +export default builder; diff --git a/src/builders/ng-packagr/index.js b/src/builders/ng-packagr/index.js index a33fef33..f204f9f9 100644 --- a/src/builders/ng-packagr/index.js +++ b/src/builders/ng-packagr/index.js @@ -11,4 +11,5 @@ exports.execute = void 0; const architect_1 = require("@angular-devkit/architect"); const builder_1 = require("./builder"); Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return builder_1.execute; } }); -exports.default = (0, architect_1.createBuilder)(builder_1.execute); +const builder = (0, architect_1.createBuilder)(builder_1.execute); +exports.default = builder; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c0a59451..72d7ca7f 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-84bbfa5'; +const VERSION = '19.1.0-rc.0+sha-a092dfd'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index b89f2795..749fb90b 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 15 2025 16:44:14 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 15 2025 19:05:24 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From c8c8589fb6917a1accf856eaab53b602bdc6878c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 15 Jan 2025 22:08:25 +0000 Subject: [PATCH 21/91] 6ea8b5c build: update Angular versions to 19.1 stable --- package.json | 20 ++++++++++---------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index c880111c..734f08a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-a092dfd", + "version": "19.1.0-rc.0+sha-6ea8b5c", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a092dfd", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6ea8b5c", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -52,14 +52,14 @@ "lmdb": "3.2.2" }, "peerDependencies": { - "@angular/compiler": "^19.0.0 || ^19.1.0-next.0", - "@angular/compiler-cli": "^19.0.0 || ^19.1.0-next.0", - "@angular/localize": "^19.0.0 || ^19.1.0-next.0", - "@angular/platform-server": "^19.0.0 || ^19.1.0-next.0", - "@angular/service-worker": "^19.0.0 || ^19.1.0-next.0", - "@angular/ssr": "github:angular/angular-ssr-builds#a092dfd", + "@angular/compiler": "^19.0.0", + "@angular/compiler-cli": "^19.0.0", + "@angular/localize": "^19.0.0", + "@angular/platform-server": "^19.0.0", + "@angular/service-worker": "^19.0.0", + "@angular/ssr": "github:angular/angular-ssr-builds#6ea8b5c", "less": "^4.2.0", - "ng-packagr": "^19.0.0 || ^19.1.0-next.0", + "ng-packagr": "^19.0.0", "postcss": "^8.4.0", "tailwindcss": "^2.0.0 || ^3.0.0", "typescript": ">=5.5 <5.8" @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#a092dfd", + "@angular/ssr": "github:angular/angular-ssr-builds#6ea8b5c", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 72d7ca7f..b1b6fa92 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-a092dfd'; +const VERSION = '19.1.0-rc.0+sha-6ea8b5c'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 749fb90b..73cd300e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 15 2025 19:05:24 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 15 2025 22:08:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 6d6ddf6ca30197e420059c3bc52857930b38d831 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 15 Jan 2025 22:46:27 +0000 Subject: [PATCH 22/91] f78c140 release: cut the v19.1.0 release --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 734f08a4..da9d4fee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0-rc.0+sha-6ea8b5c", + "version": "19.1.0+sha-f78c140", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6ea8b5c", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f78c140", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#6ea8b5c", + "@angular/ssr": "github:angular/angular-ssr-builds#f78c140", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#6ea8b5c", + "@angular/ssr": "github:angular/angular-ssr-builds#f78c140", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index b1b6fa92..428b6b5b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0-rc.0+sha-6ea8b5c'; +const VERSION = '19.1.0+sha-f78c140'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 73cd300e..83bcbe17 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 15 2025 22:08:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 15 2025 22:46:27 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 394bb14fac34eadfb69b4d422e1fc10df2915946 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 16 Jan 2025 09:50:54 +0000 Subject: [PATCH 23/91] 2985067 fix(@angular/build): resolve HMR-prefixed files in SSR with Vite --- package.json | 8 ++++---- src/tools/vite/plugins/angular-memory-plugin.js | 14 ++++++++++++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index da9d4fee..ca832caa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0+sha-f78c140", + "version": "19.1.0+sha-2985067", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f78c140", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2985067", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#f78c140", + "@angular/ssr": "github:angular/angular-ssr-builds#2985067", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#f78c140", + "@angular/ssr": "github:angular/angular-ssr-builds#2985067", "less": { "optional": true }, diff --git a/src/tools/vite/plugins/angular-memory-plugin.js b/src/tools/vite/plugins/angular-memory-plugin.js index fda168e0..cbd4a2ce 100644 --- a/src/tools/vite/plugins/angular-memory-plugin.js +++ b/src/tools/vite/plugins/angular-memory-plugin.js @@ -14,9 +14,11 @@ exports.createAngularMemoryPlugin = createAngularMemoryPlugin; const node_assert_1 = __importDefault(require("node:assert")); const promises_1 = require("node:fs/promises"); const node_path_1 = require("node:path"); +const node_url_1 = require("node:url"); const load_esm_1 = require("../../../utils/load-esm"); const ANGULAR_PREFIX = '/@ng/'; const VITE_FS_PREFIX = '/@fs/'; +const FILE_PROTOCOL = 'file:'; async function createAngularMemoryPlugin(options) { const { virtualProjectRoot, outputFiles, external } = options; const { normalizePath } = await (0, load_esm_1.loadEsmModule)('vite'); @@ -29,8 +31,16 @@ async function createAngularMemoryPlugin(options) { return; } // For SSR with component HMR, pass through as a virtual module - if (ssr && source.startsWith(ANGULAR_PREFIX)) { - return '\0' + source; + if (ssr && source.startsWith(FILE_PROTOCOL) && source.includes(ANGULAR_PREFIX)) { + // Vite will resolve these these files example: + // `file:///@ng/component?c=src%2Fapp%2Fapp.component.ts%40AppComponent&t=1737017253850` + const sourcePath = (0, node_url_1.fileURLToPath)(source); + const { root } = (0, node_path_1.parse)(sourcePath); + const sourceWithoutRoot = normalizePath('/' + sourcePath.slice(root.length)); + if (sourceWithoutRoot.startsWith(ANGULAR_PREFIX)) { + const [, query] = source.split('?', 2); + return `\0${sourceWithoutRoot}?${query}`; + } } // Prevent vite from resolving an explicit external dependency (`externalDependencies` option) if (external?.includes(source)) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 428b6b5b..949ae65a 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0+sha-f78c140'; +const VERSION = '19.1.0+sha-2985067'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 83bcbe17..6e4d7137 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 15 2025 22:46:27 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 16 2025 09:50:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From f00ec3b0faa45f09d4e283db4dc39e9600d5ed13 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 16 Jan 2025 10:33:53 +0000 Subject: [PATCH 24/91] 5261b5a release: cut the v19.1.1 release --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ca832caa..0247ff7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.0+sha-2985067", + "version": "19.1.1+sha-5261b5a", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2985067", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5261b5a", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#2985067", + "@angular/ssr": "github:angular/angular-ssr-builds#5261b5a", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#2985067", + "@angular/ssr": "github:angular/angular-ssr-builds#5261b5a", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 949ae65a..da56abbd 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.0+sha-2985067'; +const VERSION = '19.1.1+sha-5261b5a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 6e4d7137..200a1edf 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 16 2025 09:50:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 16 2025 10:33:53 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d2173c6ce9474a7665e2236ec25c8e72e76ca7bf Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 16 Jan 2025 16:53:42 +0000 Subject: [PATCH 25/91] 069818b build: exclude `pnpm` and `dependenciesMeta` fields from published NPM packages --- package.json | 21 +++++---------------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 0247ff7e..306b0c5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.1+sha-5261b5a", + "version": "19.1.1+sha-069818b", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5261b5a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#069818b", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#5261b5a", + "@angular/ssr": "github:angular/angular-ssr-builds#069818b", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#5261b5a", + "@angular/ssr": "github:angular/angular-ssr-builds#069818b", "less": { "optional": true }, @@ -102,16 +102,5 @@ "bugs": { "url": "https://github.com/angular/angular-cli/issues" }, - "homepage": "https://github.com/angular/angular-cli", - "dependenciesMeta": { - "esbuild": { - "built": true - }, - "puppeteer": { - "built": true - } - }, - "pnpm": { - "onlyBuiltDependencies": [] - } + "homepage": "https://github.com/angular/angular-cli" } diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index da56abbd..70ca974c 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.1+sha-5261b5a'; +const VERSION = '19.1.1+sha-069818b'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 200a1edf..4c61d2a5 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 16 2025 10:33:53 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 16 2025 16:53:42 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From dc6b1514d4df5eeaa2377d67d317c28269f8922a Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 16 Jan 2025 17:16:10 +0000 Subject: [PATCH 26/91] 939d161 fix(@angular/build): perform incremental background file updates with component updates --- package.json | 8 ++++---- src/builders/application/build-action.js | 12 ++++++------ src/builders/application/results.d.ts | 1 + src/builders/dev-server/vite-server.js | 7 ++++++- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 306b0c5d..6ab0a2c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.1+sha-069818b", + "version": "19.1.1+sha-939d161", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#069818b", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#939d161", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#069818b", + "@angular/ssr": "github:angular/angular-ssr-builds#939d161", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#069818b", + "@angular/ssr": "github:angular/angular-ssr-builds#939d161", "less": { "optional": true }, diff --git a/src/builders/application/build-action.js b/src/builders/application/build-action.js index 2e0358a8..8e75b03a 100644 --- a/src/builders/application/build-action.js +++ b/src/builders/application/build-action.js @@ -206,6 +206,8 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa const incrementalResult = { kind: results_1.ResultKind.Incremental, warnings: warnings, + // These files need to be updated in the dev server but should not signal any updates + background: hasTemplateUpdates, added: [], removed: [], modified: [], @@ -221,12 +223,6 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa const removedOutputFiles = new Map(previousOutputInfo); for (const file of outputFiles) { removedOutputFiles.delete(file.path); - // Temporarily ignore JS files until Angular compiler plugin refactor to allow - // bypassing application code bundling for template affecting only changes. - // TODO: Remove once refactor is complete. - if (hasTemplateUpdates && /\.js(?:\.map)?$/.test(file.path)) { - continue; - } const previousHash = previousOutputInfo.get(file.path)?.hash; let needFile = false; if (previousHash === undefined) { @@ -238,6 +234,10 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa incrementalResult.modified.push(file.path); } if (needFile) { + // Updates to non-JS files must signal an update with the dev server + if (!/(?:\.js|\.map)?$/.test(file.path)) { + incrementalResult.background = false; + } incrementalResult.files[file.path] = { type: file.type, contents: file.contents, diff --git a/src/builders/application/results.d.ts b/src/builders/application/results.d.ts index e7bba898..9bc82d50 100644 --- a/src/builders/application/results.d.ts +++ b/src/builders/application/results.d.ts @@ -29,6 +29,7 @@ export interface FullResult extends BaseResult { } export interface IncrementalResult extends BaseResult { kind: ResultKind.Incremental; + background?: boolean; added: string[]; removed: { path: string; diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 36f3e34d..9aa723d3 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -166,6 +166,7 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context updates: [], }); } + let needClientUpdate = true; switch (result.kind) { case results_1.ResultKind.Full: if (result.detail?.['htmlIndexPath']) { @@ -196,6 +197,8 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context break; case results_1.ResultKind.Incremental: (0, node_assert_1.default)(server, 'Builder must provide an initial full build before incremental results.'); + // Background updates should only update server files/options + needClientUpdate = !result.background; for (const removed of result.removed) { const filePath = '/' + normalizePath(removed.path); generatedFiles.delete(filePath); @@ -262,7 +265,9 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context ...[...assetFiles.values()].map(({ source }) => source), ]), ]; - await handleUpdate(normalizePath, generatedFiles, assetFiles, server, serverOptions, context.logger, componentStyles); + if (needClientUpdate) { + await handleUpdate(normalizePath, generatedFiles, assetFiles, server, serverOptions, context.logger, componentStyles); + } } else { const projectName = context.target?.project; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 70ca974c..ec9b2d71 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.1+sha-069818b'; +const VERSION = '19.1.1+sha-939d161'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 4c61d2a5..fdffd57f 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 16 2025 16:53:42 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 16 2025 17:16:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 614a1f2487ec9bb6b43a96fc0925a28b8d1d7b9e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 17 Jan 2025 15:30:15 +0000 Subject: [PATCH 27/91] 3040272 fix(@angular/build): prevent full page reload on HMR updates with SSR enabled --- package.json | 8 +++--- src/builders/application/build-action.js | 2 +- src/builders/dev-server/vite-server.js | 36 +++++++++++++----------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 6ab0a2c5..3f681312 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.1+sha-939d161", + "version": "19.1.1+sha-3040272", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#939d161", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3040272", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#939d161", + "@angular/ssr": "github:angular/angular-ssr-builds#3040272", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#939d161", + "@angular/ssr": "github:angular/angular-ssr-builds#3040272", "less": { "optional": true }, diff --git a/src/builders/application/build-action.js b/src/builders/application/build-action.js index 8e75b03a..3515c839 100644 --- a/src/builders/application/build-action.js +++ b/src/builders/application/build-action.js @@ -235,7 +235,7 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa } if (needFile) { // Updates to non-JS files must signal an update with the dev server - if (!/(?:\.js|\.map)?$/.test(file.path)) { + if (!/(?:\.m?js|\.map)?$/.test(file.path)) { incrementalResult.background = false; } incrementalResult.files[file.path] = { diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 9aa723d3..437bb005 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -188,10 +188,6 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context // The initial build will not yet have a server setup !server); } - // Invalidate SSR module graph to ensure that only new rebuild is used and not stale component updates - if (server && browserOptions.ssr && templateUpdates.size > 0) { - server.moduleGraph.invalidateAll(); - } // Clear stale template updates on code rebuilds templateUpdates.clear(); break; @@ -214,13 +210,6 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context case results_1.ResultKind.ComponentUpdate: (0, node_assert_1.default)(serverOptions.hmr, 'Component updates are only supported with HMR enabled.'); (0, node_assert_1.default)(server, 'Builder must provide an initial full build before component update results.'); - // Invalidate SSR module graph to ensure that new component updates are used - // TODO: Use fine-grained invalidation of only the component update modules - if (browserOptions.ssr) { - server.moduleGraph.invalidateAll(); - const { ɵresetCompiledComponents } = (await server.ssrLoadModule('/main.server.mjs')); - ɵresetCompiledComponents(); - } for (const componentUpdate of result.updates) { if (componentUpdate.type === 'template') { templateUpdates.set(componentUpdate.id, componentUpdate.content); @@ -265,8 +254,9 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context ...[...assetFiles.values()].map(({ source }) => source), ]), ]; + const updatedFiles = await invalidateUpdatedFiles(normalizePath, generatedFiles, assetFiles, server); if (needClientUpdate) { - await handleUpdate(normalizePath, generatedFiles, assetFiles, server, serverOptions, context.logger, componentStyles); + handleUpdate(server, serverOptions, context.logger, componentStyles, updatedFiles); } } else { @@ -340,7 +330,13 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context } await new Promise((resolve) => (deferred = resolve)); } -async function handleUpdate(normalizePath, generatedFiles, assetFiles, server, serverOptions, logger, componentStyles) { +/** + * Invalidates any updated asset or generated files and resets their `updated` state. + * This function also clears the server application cache when necessary. + * + * @returns A list of files that were updated and invalidated. + */ +async function invalidateUpdatedFiles(normalizePath, generatedFiles, assetFiles, server) { const updatedFiles = []; // Invalidate any updated asset for (const [file, record] of assetFiles) { @@ -368,13 +364,21 @@ async function handleUpdate(normalizePath, generatedFiles, assetFiles, server, s const updatedModules = server.moduleGraph.getModulesByFile(normalizePath((0, node_path_1.join)(server.config.root, file))); updatedModules?.forEach((m) => server.moduleGraph.invalidateModule(m)); } - if (!updatedFiles.length) { - return; - } if (destroyAngularServerAppCalled) { // Trigger module evaluation before reload to initiate dependency optimization. await server.ssrLoadModule('/main.server.mjs'); } + return updatedFiles; +} +/** + * Handles updates for the client by sending HMR or full page reload commands + * based on the updated files. It also ensures proper tracking of component styles and determines if + * a full reload is needed. + */ +function handleUpdate(server, serverOptions, logger, componentStyles, updatedFiles) { + if (!updatedFiles.length) { + return; + } if (serverOptions.hmr) { if (updatedFiles.every((f) => f.endsWith('.css'))) { let requiresReload = false; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ec9b2d71..5040b6df 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.1+sha-939d161'; +const VERSION = '19.1.1+sha-3040272'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index fdffd57f..4c587a7c 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 16 2025 17:16:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 17 2025 15:30:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From abc909257a724719f4952dc20499122b15c08eb2 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 17 Jan 2025 18:27:41 +0000 Subject: [PATCH 28/91] 148acbd fix(@angular/build): reset component updates on dev-server index request --- package.json | 8 ++++---- src/builders/dev-server/vite-server.js | 1 + src/tools/vite/middlewares/index-html-middleware.d.ts | 2 +- src/tools/vite/middlewares/index-html-middleware.js | 4 +++- src/tools/vite/plugins/setup-middlewares-plugin.d.ts | 1 + src/tools/vite/plugins/setup-middlewares-plugin.js | 4 ++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 3f681312..f3697ce6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.1+sha-3040272", + "version": "19.1.1+sha-148acbd", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3040272", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#148acbd", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#3040272", + "@angular/ssr": "github:angular/angular-ssr-builds#148acbd", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#3040272", + "@angular/ssr": "github:angular/angular-ssr-builds#148acbd", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 437bb005..4cc6aa5f 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -602,6 +602,7 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, componentStyles, templateUpdates, ssrMode, + resetComponentUpdates: () => templateUpdates.clear(), }), (0, plugins_1.createRemoveIdPrefixPlugin)(externalMetadata.explicitBrowser), await (0, plugins_1.createAngularSsrTransformPlugin)(serverOptions.workspaceRoot), diff --git a/src/tools/vite/middlewares/index-html-middleware.d.ts b/src/tools/vite/middlewares/index-html-middleware.d.ts index 74134000..5b21e651 100644 --- a/src/tools/vite/middlewares/index-html-middleware.d.ts +++ b/src/tools/vite/middlewares/index-html-middleware.d.ts @@ -7,4 +7,4 @@ */ import type { Connect, ViteDevServer } from 'vite'; import { AngularMemoryOutputFiles } from '../utils'; -export declare function createAngularIndexHtmlMiddleware(server: ViteDevServer, outputFiles: AngularMemoryOutputFiles, indexHtmlTransformer: ((content: string) => Promise) | undefined): Connect.NextHandleFunction; +export declare function createAngularIndexHtmlMiddleware(server: ViteDevServer, outputFiles: AngularMemoryOutputFiles, resetComponentUpdates: () => void, indexHtmlTransformer: ((content: string) => Promise) | undefined): Connect.NextHandleFunction; diff --git a/src/tools/vite/middlewares/index-html-middleware.js b/src/tools/vite/middlewares/index-html-middleware.js index 967485f4..7e5914bd 100644 --- a/src/tools/vite/middlewares/index-html-middleware.js +++ b/src/tools/vite/middlewares/index-html-middleware.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.createAngularIndexHtmlMiddleware = createAngularIndexHtmlMiddleware; const node_path_1 = require("node:path"); const utils_1 = require("../utils"); -function createAngularIndexHtmlMiddleware(server, outputFiles, indexHtmlTransformer) { +function createAngularIndexHtmlMiddleware(server, outputFiles, resetComponentUpdates, indexHtmlTransformer) { return function angularIndexHtmlMiddleware(req, res, next) { if (!req.url) { next(); @@ -29,6 +29,8 @@ function createAngularIndexHtmlMiddleware(server, outputFiles, indexHtmlTransfor next(); return; } + // A request for the index indicates a full page reload request. + resetComponentUpdates(); server .transformIndexHtml(req.url, Buffer.from(rawHtml).toString('utf-8')) .then(async (processedHtml) => { diff --git a/src/tools/vite/plugins/setup-middlewares-plugin.d.ts b/src/tools/vite/plugins/setup-middlewares-plugin.d.ts index 2b013ea0..e8b66d38 100644 --- a/src/tools/vite/plugins/setup-middlewares-plugin.d.ts +++ b/src/tools/vite/plugins/setup-middlewares-plugin.d.ts @@ -38,6 +38,7 @@ interface AngularSetupMiddlewaresPluginOptions { componentStyles: Map; templateUpdates: Map; ssrMode: ServerSsrMode; + resetComponentUpdates: () => void; } export declare function createAngularSetupMiddlewaresPlugin(options: AngularSetupMiddlewaresPluginOptions): Plugin; export {}; diff --git a/src/tools/vite/plugins/setup-middlewares-plugin.js b/src/tools/vite/plugins/setup-middlewares-plugin.js index 94c437cd..5eaa0f34 100644 --- a/src/tools/vite/plugins/setup-middlewares-plugin.js +++ b/src/tools/vite/plugins/setup-middlewares-plugin.js @@ -46,7 +46,7 @@ function createAngularSetupMiddlewaresPlugin(options) { name: 'vite:angular-setup-middlewares', enforce: 'pre', async configureServer(server) { - const { indexHtmlTransformer, outputFiles, extensionMiddleware, assets, componentStyles, templateUpdates, ssrMode, } = options; + const { indexHtmlTransformer, outputFiles, extensionMiddleware, assets, componentStyles, templateUpdates, ssrMode, resetComponentUpdates, } = options; // Headers, assets and resources get handled first server.middlewares.use((0, middlewares_1.createAngularHeadersMiddleware)(server)); server.middlewares.use((0, middlewares_1.createAngularComponentMiddleware)(templateUpdates)); @@ -64,7 +64,7 @@ function createAngularSetupMiddlewaresPlugin(options) { server.middlewares.use((0, middlewares_1.createAngularSsrInternalMiddleware)(server, indexHtmlTransformer)); } server.middlewares.use(middlewares_1.angularHtmlFallbackMiddleware); - server.middlewares.use((0, middlewares_1.createAngularIndexHtmlMiddleware)(server, outputFiles, indexHtmlTransformer)); + server.middlewares.use((0, middlewares_1.createAngularIndexHtmlMiddleware)(server, outputFiles, resetComponentUpdates, indexHtmlTransformer)); }; }, }; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 5040b6df..0676e035 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.1+sha-3040272'; +const VERSION = '19.1.1+sha-148acbd'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 4c587a7c..7fe29d6b 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 17 2025 15:30:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 17 2025 18:27:41 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 4cd75a74d5eeea9c7eb8cd6c13b058d6c304a2eb Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 17 Jan 2025 21:37:18 +0000 Subject: [PATCH 29/91] f192f15 refactor(@angular/build): add console message to dev server when component HMR is enabled --- package.json | 8 ++++---- src/builders/dev-server/vite-server.js | 6 ++++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f3697ce6..07200786 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.1+sha-148acbd", + "version": "19.1.1+sha-f192f15", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#148acbd", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f192f15", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#148acbd", + "@angular/ssr": "github:angular/angular-ssr-builds#f192f15", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#148acbd", + "@angular/ssr": "github:angular/angular-ssr-builds#f192f15", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 4cc6aa5f..3dae3206 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -110,6 +110,12 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context // This will also replace file-based/inline styles as code if external runtime styles are not enabled. browserOptions.templateUpdates = serverOptions.liveReload && serverOptions.hmr && environment_options_1.useComponentTemplateHmr; + if (browserOptions.templateUpdates) { + context.logger.warn('Component HMR has been enabled.\n' + + 'If you encounter application reload issues, you can manually reload the page to bypass HMR and/or disable this feature with the' + + ' `--no-hmr` command line option.\n' + + 'Please consider reporting any issues you encounter here: https://github.com/angular/angular-cli/issues\n'); + } browserOptions.incrementalResults = true; // Setup the prebundling transformer that will be shared across Vite prebundling requests const prebundleTransformer = new internal_1.JavaScriptTransformer( diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 0676e035..2f025bdd 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.1+sha-148acbd'; +const VERSION = '19.1.1+sha-f192f15'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7fe29d6b..e5aeda02 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 17 2025 18:27:41 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 17 2025 21:37:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 544fe7ab7f42e394dbf23861f2511609e0628e60 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 17 Jan 2025 22:48:52 +0000 Subject: [PATCH 30/91] 910a276 release: cut the v19.1.2 release --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 07200786..9202bd63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.1+sha-f192f15", + "version": "19.1.2+sha-910a276", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f192f15", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#910a276", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#f192f15", + "@angular/ssr": "github:angular/angular-ssr-builds#910a276", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#f192f15", + "@angular/ssr": "github:angular/angular-ssr-builds#910a276", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 2f025bdd..d5dadc3d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.1+sha-f192f15'; +const VERSION = '19.1.2+sha-910a276'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e5aeda02..ea262218 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 17 2025 21:37:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 17 2025 22:48:52 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 500842a0d927954249be300b7f9d2689cf6266a5 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 20 Jan 2025 10:00:55 +0000 Subject: [PATCH 31/91] 7afc051 test(@angular/build): enable i18n localize watch test for dev-server --- package.json | 8 +- src/builders/application/build-action.js | 179 +++++++++--------- .../angular/compilation/aot-compilation.js | 6 +- .../middlewares/component-middleware.d.ts | 4 +- .../vite/middlewares/component-middleware.js | 6 +- .../vite/plugins/angular-memory-plugin.js | 7 +- .../vite/plugins/setup-middlewares-plugin.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 9 files changed, 115 insertions(+), 101 deletions(-) diff --git a/package.json b/package.json index 9202bd63..2a5bba9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.2+sha-910a276", + "version": "19.1.2+sha-7afc051", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#910a276", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7afc051", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#910a276", + "@angular/ssr": "github:angular/angular-ssr-builds#7afc051", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#910a276", + "@angular/ssr": "github:angular/angular-ssr-builds#7afc051", "less": { "optional": true }, diff --git a/src/builders/application/build-action.js b/src/builders/application/build-action.js index 3515c839..a99702ac 100644 --- a/src/builders/application/build-action.js +++ b/src/builders/application/build-action.js @@ -187,30 +187,11 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa }; return; } - // Template updates only exist if no other JS changes have occurred - const hasTemplateUpdates = !!templateUpdates?.size; - if (hasTemplateUpdates) { - const updateResult = { - kind: results_1.ResultKind.ComponentUpdate, - updates: Array.from(templateUpdates, ([id, content]) => ({ - type: 'template', - id, - content, - })), - }; - yield updateResult; - } - // Use an incremental result if previous output information is available - if (rebuildState && changes) { - const { previousAssetsInfo, previousOutputInfo } = rebuildState; - const incrementalResult = { - kind: results_1.ResultKind.Incremental, + // Use a full result if there is no rebuild state (no prior build result) + if (!rebuildState || !changes) { + const result = { + kind: results_1.ResultKind.Full, warnings: warnings, - // These files need to be updated in the dev server but should not signal any updates - background: hasTemplateUpdates, - added: [], - removed: [], - modified: [], files: {}, detail: { externalMetadata, @@ -219,67 +200,37 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa outputOptions, }, }; - // Initially assume all previous output files have been removed - const removedOutputFiles = new Map(previousOutputInfo); - for (const file of outputFiles) { - removedOutputFiles.delete(file.path); - const previousHash = previousOutputInfo.get(file.path)?.hash; - let needFile = false; - if (previousHash === undefined) { - needFile = true; - incrementalResult.added.push(file.path); - } - else if (previousHash !== file.hash) { - needFile = true; - incrementalResult.modified.push(file.path); - } - if (needFile) { - // Updates to non-JS files must signal an update with the dev server - if (!/(?:\.m?js|\.map)?$/.test(file.path)) { - incrementalResult.background = false; - } - incrementalResult.files[file.path] = { - type: file.type, - contents: file.contents, - origin: 'memory', - hash: file.hash, - }; - } - } - // Initially assume all previous assets files have been removed - const removedAssetFiles = new Map(previousAssetsInfo); - for (const { source, destination } of assetFiles) { - removedAssetFiles.delete(source); - if (!previousAssetsInfo.has(source)) { - incrementalResult.added.push(destination); - } - else if (changes.modified.has(source)) { - incrementalResult.modified.push(destination); - } - else { - continue; - } - incrementalResult.files[destination] = { + for (const file of assetFiles) { + result.files[file.destination] = { type: bundler_context_1.BuildOutputFileType.Browser, - inputPath: source, + inputPath: file.source, origin: 'disk', }; } - // Include the removed output and asset files - incrementalResult.removed.push(...Array.from(removedOutputFiles, ([file, { type }]) => ({ - path: file, - type, - })), ...Array.from(removedAssetFiles.values(), (file) => ({ - path: file, - type: bundler_context_1.BuildOutputFileType.Browser, - }))); - yield incrementalResult; + for (const file of outputFiles) { + result.files[file.path] = { + type: file.type, + contents: file.contents, + origin: 'memory', + hash: file.hash, + }; + } + yield result; return; } - // Otherwise, use a full result - const result = { - kind: results_1.ResultKind.Full, + // Template updates only exist if no other JS changes have occurred. + // A full page reload may be required based on the following incremental output change analysis. + const hasTemplateUpdates = !!templateUpdates?.size; + // Use an incremental result if previous output information is available + const { previousAssetsInfo, previousOutputInfo } = rebuildState; + const incrementalResult = { + kind: results_1.ResultKind.Incremental, warnings: warnings, + // Initially attempt to use a background update of files to support component updates. + background: hasTemplateUpdates, + added: [], + removed: [], + modified: [], files: {}, detail: { externalMetadata, @@ -288,20 +239,74 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa outputOptions, }, }; - for (const file of assetFiles) { - result.files[file.destination] = { + // Initially assume all previous output files have been removed + const removedOutputFiles = new Map(previousOutputInfo); + for (const file of outputFiles) { + removedOutputFiles.delete(file.path); + const previousHash = previousOutputInfo.get(file.path)?.hash; + let needFile = false; + if (previousHash === undefined) { + needFile = true; + incrementalResult.added.push(file.path); + } + else if (previousHash !== file.hash) { + needFile = true; + incrementalResult.modified.push(file.path); + } + if (needFile) { + // Updates to non-JS files must signal an update with the dev server + if (!/(?:\.m?js|\.map)$/.test(file.path)) { + incrementalResult.background = false; + } + incrementalResult.files[file.path] = { + type: file.type, + contents: file.contents, + origin: 'memory', + hash: file.hash, + }; + } + } + // Initially assume all previous assets files have been removed + const removedAssetFiles = new Map(previousAssetsInfo); + for (const { source, destination } of assetFiles) { + removedAssetFiles.delete(source); + if (!previousAssetsInfo.has(source)) { + incrementalResult.added.push(destination); + incrementalResult.background = false; + } + else if (changes.modified.has(source)) { + incrementalResult.modified.push(destination); + incrementalResult.background = false; + } + else { + continue; + } + incrementalResult.files[destination] = { type: bundler_context_1.BuildOutputFileType.Browser, - inputPath: file.source, + inputPath: source, origin: 'disk', }; } - for (const file of outputFiles) { - result.files[file.path] = { - type: file.type, - contents: file.contents, - origin: 'memory', - hash: file.hash, + // Include the removed output and asset files + incrementalResult.removed.push(...Array.from(removedOutputFiles, ([file, { type }]) => ({ + path: file, + type, + })), ...Array.from(removedAssetFiles.values(), (file) => ({ + path: file, + type: bundler_context_1.BuildOutputFileType.Browser, + }))); + yield incrementalResult; + // If there are template updates and the incremental update was background only, a component + // update is possible. + if (hasTemplateUpdates && incrementalResult.background) { + const updateResult = { + kind: results_1.ResultKind.ComponentUpdate, + updates: Array.from(templateUpdates, ([id, content]) => ({ + type: 'template', + id, + content, + })), }; + yield updateResult; } - yield result; } diff --git a/src/tools/angular/compilation/aot-compilation.js b/src/tools/angular/compilation/aot-compilation.js index d95688ab..6cd382f4 100644 --- a/src/tools/angular/compilation/aot-compilation.js +++ b/src/tools/angular/compilation/aot-compilation.js @@ -120,7 +120,11 @@ class AotCompilation extends angular_compilation_1.AngularCompilation { relativePath = relativePath.replaceAll('\\', '/'); const updateId = encodeURIComponent(`${host.getCanonicalFileName(relativePath)}@${node.name?.text}`); const updateText = angularCompiler.emitHmrUpdateModule(node); - if (updateText === null) { + // If compiler cannot generate an update for the component, prevent template updates. + // Also prevent template updates if $localize is directly present which also currently + // prevents a template update at runtime. + // TODO: Support localized template update modules and remove this check. + if (updateText === null || updateText.includes('$localize')) { // Build is needed if a template cannot be updated templateUpdates = undefined; break; diff --git a/src/tools/vite/middlewares/component-middleware.d.ts b/src/tools/vite/middlewares/component-middleware.d.ts index d799662c..0cafa7e0 100644 --- a/src/tools/vite/middlewares/component-middleware.d.ts +++ b/src/tools/vite/middlewares/component-middleware.d.ts @@ -5,5 +5,5 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -import type { Connect } from 'vite'; -export declare function createAngularComponentMiddleware(templateUpdates: ReadonlyMap): Connect.NextHandleFunction; +import type { Connect, ViteDevServer } from 'vite'; +export declare function createAngularComponentMiddleware(server: ViteDevServer, templateUpdates: ReadonlyMap): Connect.NextHandleFunction; diff --git a/src/tools/vite/middlewares/component-middleware.js b/src/tools/vite/middlewares/component-middleware.js index 62371c57..f086fde7 100644 --- a/src/tools/vite/middlewares/component-middleware.js +++ b/src/tools/vite/middlewares/component-middleware.js @@ -8,13 +8,15 @@ */ Object.defineProperty(exports, "__esModule", { value: true }); exports.createAngularComponentMiddleware = createAngularComponentMiddleware; +const utils_1 = require("../utils"); const ANGULAR_COMPONENT_PREFIX = '/@ng/component'; -function createAngularComponentMiddleware(templateUpdates) { +function createAngularComponentMiddleware(server, templateUpdates) { return function angularComponentMiddleware(req, res, next) { if (req.url === undefined || res.writableEnded) { return; } - if (!req.url.startsWith(ANGULAR_COMPONENT_PREFIX)) { + const pathname = (0, utils_1.pathnameWithoutBasePath)(req.url, server.config.base); + if (!pathname.includes(ANGULAR_COMPONENT_PREFIX)) { next(); return; } diff --git a/src/tools/vite/plugins/angular-memory-plugin.js b/src/tools/vite/plugins/angular-memory-plugin.js index cbd4a2ce..6d5e9c5e 100644 --- a/src/tools/vite/plugins/angular-memory-plugin.js +++ b/src/tools/vite/plugins/angular-memory-plugin.js @@ -35,8 +35,11 @@ async function createAngularMemoryPlugin(options) { // Vite will resolve these these files example: // `file:///@ng/component?c=src%2Fapp%2Fapp.component.ts%40AppComponent&t=1737017253850` const sourcePath = (0, node_url_1.fileURLToPath)(source); - const { root } = (0, node_path_1.parse)(sourcePath); - const sourceWithoutRoot = normalizePath('/' + sourcePath.slice(root.length)); + const sourceWithoutRoot = sourcePath.startsWith(virtualProjectRoot) + ? normalizePath('/' + (0, node_path_1.relative)(virtualProjectRoot, sourcePath)) + : // TODO: remove once https://github.com/angular/angular/blob/4e6017a9f5cda389c5fbf4f2c1519ce1bba23e11/packages/compiler/src/render3/r3_hmr_compiler.ts#L57 + // is changed from `/@ng` to `./@ng/` + normalizePath('/' + sourcePath.slice((0, node_path_1.parse)(sourcePath).root.length)); if (sourceWithoutRoot.startsWith(ANGULAR_PREFIX)) { const [, query] = source.split('?', 2); return `\0${sourceWithoutRoot}?${query}`; diff --git a/src/tools/vite/plugins/setup-middlewares-plugin.js b/src/tools/vite/plugins/setup-middlewares-plugin.js index 5eaa0f34..7e3695ab 100644 --- a/src/tools/vite/plugins/setup-middlewares-plugin.js +++ b/src/tools/vite/plugins/setup-middlewares-plugin.js @@ -49,7 +49,7 @@ function createAngularSetupMiddlewaresPlugin(options) { const { indexHtmlTransformer, outputFiles, extensionMiddleware, assets, componentStyles, templateUpdates, ssrMode, resetComponentUpdates, } = options; // Headers, assets and resources get handled first server.middlewares.use((0, middlewares_1.createAngularHeadersMiddleware)(server)); - server.middlewares.use((0, middlewares_1.createAngularComponentMiddleware)(templateUpdates)); + server.middlewares.use((0, middlewares_1.createAngularComponentMiddleware)(server, templateUpdates)); server.middlewares.use((0, middlewares_1.createAngularAssetsMiddleware)(server, assets, outputFiles, componentStyles, await createEncapsulateStyle())); extensionMiddleware?.forEach((middleware) => server.middlewares.use(middleware)); // Returning a function, installs middleware after the main transform middleware but diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d5dadc3d..ed0f69f0 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.2+sha-910a276'; +const VERSION = '19.1.2+sha-7afc051'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index ea262218..595e8e0c 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 17 2025 22:48:52 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 20 2025 10:00:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From caed09ee6d7e7f0b5a622a33baf2e5c34b40101b Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 20 Jan 2025 13:37:35 +0000 Subject: [PATCH 32/91] 3ce086a test: improve stability of strategy tests --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2a5bba9d..129a168b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.2+sha-7afc051", + "version": "19.1.2+sha-3ce086a", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7afc051", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3ce086a", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#7afc051", + "@angular/ssr": "github:angular/angular-ssr-builds#3ce086a", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#7afc051", + "@angular/ssr": "github:angular/angular-ssr-builds#3ce086a", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ed0f69f0..10ff0d9a 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.2+sha-7afc051'; +const VERSION = '19.1.2+sha-3ce086a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 595e8e0c..e94a4034 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 20 2025 10:00:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 20 2025 13:37:35 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 4ce1f441fbbfcd5df6a433ad9e43b5a6fa60a391 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 20 Jan 2025 14:28:46 +0000 Subject: [PATCH 33/91] 4508725 release: cut the v19.1.3 release --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 129a168b..5d62df93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.2+sha-3ce086a", + "version": "19.1.3+sha-4508725", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3ce086a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4508725", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#3ce086a", + "@angular/ssr": "github:angular/angular-ssr-builds#4508725", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#3ce086a", + "@angular/ssr": "github:angular/angular-ssr-builds#4508725", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 10ff0d9a..82877c38 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.2+sha-3ce086a'; +const VERSION = '19.1.3+sha-4508725'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e94a4034..5e99f210 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 20 2025 13:37:35 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 20 2025 14:28:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 627ce34827f81f501d8bc732e4937da3dc98f344 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 20 Jan 2025 14:38:28 +0000 Subject: [PATCH 34/91] 4595ca6 build: delete npm archive accidentally committed --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5d62df93..6a433a28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-4508725", + "version": "19.1.3+sha-4595ca6", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4508725", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4595ca6", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#4508725", + "@angular/ssr": "github:angular/angular-ssr-builds#4595ca6", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#4508725", + "@angular/ssr": "github:angular/angular-ssr-builds#4595ca6", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 82877c38..32fa3afe 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-4508725'; +const VERSION = '19.1.3+sha-4595ca6'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 5e99f210..2795ba58 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 20 2025 14:28:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 20 2025 14:38:28 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 70fa50411344b9c54df0af69841e13b6f22c2390 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 20 Jan 2025 15:25:27 +0000 Subject: [PATCH 35/91] bcc5fab fix(@angular/ssr): prevent route matcher error when SSR routing is not used --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 6a433a28..2babee19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-4595ca6", + "version": "19.1.3+sha-bcc5fab", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4595ca6", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bcc5fab", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#4595ca6", + "@angular/ssr": "github:angular/angular-ssr-builds#bcc5fab", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#4595ca6", + "@angular/ssr": "github:angular/angular-ssr-builds#bcc5fab", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 32fa3afe..68f5369b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-4595ca6'; +const VERSION = '19.1.3+sha-bcc5fab'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 2795ba58..95830d9b 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 20 2025 14:38:28 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 20 2025 15:25:27 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ddf5abf312f318a9fb14fd9e07e9a5842e846436 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 20 Jan 2025 17:58:55 +0000 Subject: [PATCH 36/91] 59c7577 fix(@angular/ssr): unblock route extraction with `withEnabledBlockingInitialNavigation` --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2babee19..76c5fa43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-bcc5fab", + "version": "19.1.3+sha-59c7577", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bcc5fab", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#59c7577", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#bcc5fab", + "@angular/ssr": "github:angular/angular-ssr-builds#59c7577", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#bcc5fab", + "@angular/ssr": "github:angular/angular-ssr-builds#59c7577", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 68f5369b..5fb58d96 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-bcc5fab'; +const VERSION = '19.1.3+sha-59c7577'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 95830d9b..cca04461 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 20 2025 15:25:27 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 20 2025 17:58:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ff0d8d0289d01a587f32bb409cb099376cb47514 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 21 Jan 2025 13:17:38 +0000 Subject: [PATCH 37/91] ff8192a fix(@angular/build): correct path for `/@ng/components` on Windows --- package.json | 8 ++++---- src/tools/vite/plugins/angular-memory-plugin.js | 6 +----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 76c5fa43..f0458479 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-59c7577", + "version": "19.1.3+sha-ff8192a", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#59c7577", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ff8192a", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#59c7577", + "@angular/ssr": "github:angular/angular-ssr-builds#ff8192a", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#59c7577", + "@angular/ssr": "github:angular/angular-ssr-builds#ff8192a", "less": { "optional": true }, diff --git a/src/tools/vite/plugins/angular-memory-plugin.js b/src/tools/vite/plugins/angular-memory-plugin.js index 6d5e9c5e..cb8e6b84 100644 --- a/src/tools/vite/plugins/angular-memory-plugin.js +++ b/src/tools/vite/plugins/angular-memory-plugin.js @@ -35,11 +35,7 @@ async function createAngularMemoryPlugin(options) { // Vite will resolve these these files example: // `file:///@ng/component?c=src%2Fapp%2Fapp.component.ts%40AppComponent&t=1737017253850` const sourcePath = (0, node_url_1.fileURLToPath)(source); - const sourceWithoutRoot = sourcePath.startsWith(virtualProjectRoot) - ? normalizePath('/' + (0, node_path_1.relative)(virtualProjectRoot, sourcePath)) - : // TODO: remove once https://github.com/angular/angular/blob/4e6017a9f5cda389c5fbf4f2c1519ce1bba23e11/packages/compiler/src/render3/r3_hmr_compiler.ts#L57 - // is changed from `/@ng` to `./@ng/` - normalizePath('/' + sourcePath.slice((0, node_path_1.parse)(sourcePath).root.length)); + const sourceWithoutRoot = normalizePath('/' + (0, node_path_1.relative)(virtualProjectRoot, sourcePath)); if (sourceWithoutRoot.startsWith(ANGULAR_PREFIX)) { const [, query] = source.split('?', 2); return `\0${sourceWithoutRoot}?${query}`; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 5fb58d96..838c27f6 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-59c7577'; +const VERSION = '19.1.3+sha-ff8192a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index cca04461..da055a68 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 20 2025 17:58:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 21 2025 13:17:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 127965613e3aa0ca8ec07c2bb11213ba7899a690 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 21 Jan 2025 13:36:38 +0000 Subject: [PATCH 38/91] da08259 build: migrate `@angular-devkit/build-webpack` tests to `rules_js` --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f0458479..ce9350bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-ff8192a", + "version": "19.1.3+sha-da08259", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ff8192a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#da08259", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#ff8192a", + "@angular/ssr": "github:angular/angular-ssr-builds#da08259", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#ff8192a", + "@angular/ssr": "github:angular/angular-ssr-builds#da08259", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 838c27f6..81d0855e 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-ff8192a'; +const VERSION = '19.1.3+sha-da08259'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index da055a68..ffa2b171 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 21 2025 13:17:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 21 2025 13:36:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 4b13ac213d2ae097437c7f1bc77b5c46392818d4 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 21 Jan 2025 15:24:56 +0000 Subject: [PATCH 39/91] bce32c1 test: update saucelabs browsers versions --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ce9350bc..c3590aa0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-da08259", + "version": "19.1.3+sha-bce32c1", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#da08259", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bce32c1", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#da08259", + "@angular/ssr": "github:angular/angular-ssr-builds#bce32c1", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#da08259", + "@angular/ssr": "github:angular/angular-ssr-builds#bce32c1", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 81d0855e..6be5d3ce 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-da08259'; +const VERSION = '19.1.3+sha-bce32c1'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index ffa2b171..20eebcff 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 21 2025 13:36:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 21 2025 15:24:56 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 4a8c214bbce09191f5a7a6efa48fe3f7794d0fbf Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 21 Jan 2025 15:51:14 +0000 Subject: [PATCH 40/91] bd2ab46 ci: replace platform linux with windows 11 --- package.json | 8 +-- src/builders/application/index.d.ts | 3 +- src/builders/application/options.js | 2 +- src/builders/application/schema.d.ts | 72 +++++++++++++-------------- src/builders/dev-server/index.d.ts | 3 +- src/builders/dev-server/schema.d.ts | 8 +-- src/builders/extract-i18n/index.d.ts | 3 +- src/builders/extract-i18n/schema.d.ts | 4 +- src/builders/ng-packagr/index.d.ts | 3 +- src/builders/ng-packagr/schema.d.ts | 4 +- src/utils/i18n-options.d.ts | 2 +- src/utils/i18n-options.js | 22 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 14 files changed, 69 insertions(+), 69 deletions(-) diff --git a/package.json b/package.json index c3590aa0..80062793 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-bce32c1", + "version": "19.1.3+sha-bd2ab46", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bce32c1", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bd2ab46", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#bce32c1", + "@angular/ssr": "github:angular/angular-ssr-builds#bd2ab46", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#bce32c1", + "@angular/ssr": "github:angular/angular-ssr-builds#bd2ab46", "less": { "optional": true }, diff --git a/src/builders/application/index.d.ts b/src/builders/application/index.d.ts index 4d5d9b6a..11369ae6 100644 --- a/src/builders/application/index.d.ts +++ b/src/builders/application/index.d.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ import { Builder, BuilderContext, BuilderOutput } from '@angular-devkit/architect'; -import { json } from '@angular-devkit/core'; import { ApplicationBuilderExtensions, ApplicationBuilderInternalOptions } from './options'; import { Result } from './results'; import { Schema as ApplicationBuilderOptions } from './schema'; @@ -29,5 +28,5 @@ export declare function buildApplicationInternal(options: ApplicationBuilderInte * @returns The build output results of the build. */ export declare function buildApplication(options: ApplicationBuilderOptions, context: BuilderContext, extensions?: ApplicationBuilderExtensions): AsyncIterable; -declare const builder: Builder; +declare const builder: Builder; export default builder; diff --git a/src/builders/application/options.js b/src/builders/application/options.js index f40a3273..d12be328 100644 --- a/src/builders/application/options.js +++ b/src/builders/application/options.js @@ -63,7 +63,7 @@ async function normalizeOptions(context, projectName, options, extensions) { // Gather persistent caching option and provide a project specific cache location const cacheOptions = (0, normalize_cache_1.normalizeCacheOptions)(projectMetadata, workspaceRoot); cacheOptions.path = node_path_1.default.join(cacheOptions.path, projectName); - const i18nOptions = (0, i18n_options_1.createI18nOptions)(projectMetadata, options.localize, context.logger); + const i18nOptions = (0, i18n_options_1.createI18nOptions)(projectMetadata, options.localize, context.logger, !!options.ssr); i18nOptions.duplicateTranslationBehavior = options.i18nDuplicateTranslation; i18nOptions.missingTranslationBehavior = options.i18nMissingTranslation; if (options.forceI18nFlatOutput) { diff --git a/src/builders/application/schema.d.ts b/src/builders/application/schema.d.ts index 6965b7f0..ee155991 100644 --- a/src/builders/application/schema.d.ts +++ b/src/builders/application/schema.d.ts @@ -1,7 +1,7 @@ /** * Application builder target options */ -export interface Schema { +export type Schema = { /** * A list of CommonJS or AMD packages that are allowed to be used without a build time * warning. Use `'*'` to allow all. @@ -208,9 +208,9 @@ export interface Schema { * TypeScript configuration for Web Worker modules. */ webWorkerTsConfig?: string; -} +}; export type AssetPattern = AssetPatternClass | string; -export interface AssetPatternClass { +export type AssetPatternClass = { /** * Allow glob patterns to follow symlink directories. This allows subdirectories of the * symlink to be searched. @@ -232,8 +232,8 @@ export interface AssetPatternClass { * Absolute path within the output. */ output?: string; -} -export interface Budget { +}; +export type Budget = { /** * The baseline size for comparison. */ @@ -270,7 +270,7 @@ export interface Budget { * The threshold for warning relative to the baseline (min & max). */ warning?: string; -} +}; /** * The type of budget. */ @@ -291,10 +291,10 @@ export declare enum CrossOrigin { None = "none", UseCredentials = "use-credentials" } -export interface FileReplacement { +export type FileReplacement = { replace: string; with: string; -} +}; /** * How to handle duplicate translations for i18n. * @@ -309,7 +309,7 @@ export declare enum I18NTranslation { * Configures the generation of the application's HTML index. */ export type IndexUnion = boolean | IndexObject | string; -export interface IndexObject { +export type IndexObject = { /** * The path of a file to use for the application's generated HTML index. */ @@ -325,7 +325,7 @@ export interface IndexObject { */ preloadInitial?: boolean; [property: string]: any; -} +}; /** * The stylesheet language to use for the application's inline component styles. */ @@ -346,7 +346,7 @@ export type Localize = string[] | boolean; * https://angular.dev/reference/configs/workspace-config#optimization-configuration. */ export type OptimizationUnion = boolean | OptimizationClass; -export interface OptimizationClass { +export type OptimizationClass = { /** * Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` * environment variable can be used to specify a proxy server. @@ -360,25 +360,25 @@ export interface OptimizationClass { * Enables optimization of the styles output. */ styles?: StylesUnion; -} +}; /** * Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` * environment variable can be used to specify a proxy server. */ export type FontsUnion = boolean | FontsClass; -export interface FontsClass { +export type FontsClass = { /** * Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS * definitions in the application's HTML index file. This option requires internet access. * `HTTPS_PROXY` environment variable can be used to specify a proxy server. */ inline?: boolean; -} +}; /** * Enables optimization of the styles output. */ export type StylesUnion = boolean | StylesClass; -export interface StylesClass { +export type StylesClass = { /** * Extract and inline critical CSS definitions to improve first paint time. */ @@ -393,7 +393,7 @@ export interface StylesClass { * '//!' or '/*!'. */ removeSpecialComments?: boolean; -} +}; /** * Define the output filename cache-busting hashing mode. */ @@ -416,7 +416,7 @@ export declare enum OutputMode { * Specify the output path relative to workspace root. */ export type OutputPathUnion = OutputPathClass | string; -export interface OutputPathClass { +export type OutputPathClass = { /** * Specify the output path relative to workspace root. */ @@ -436,12 +436,12 @@ export interface OutputPathClass { * 'server'. */ server?: string; -} +}; /** * Prerender (SSG) pages of your application during build time. */ export type PrerenderUnion = boolean | PrerenderClass; -export interface PrerenderClass { +export type PrerenderClass = { /** * Whether the builder should process the Angular Router configuration to find all * unparameterized routes and prerender them. @@ -452,9 +452,9 @@ export interface PrerenderClass { * newlines. This option is useful if you want to prerender routes with parameterized URLs. */ routesFile?: string; -} +}; export type ScriptElement = ScriptClass | string; -export interface ScriptClass { +export type ScriptClass = { /** * The bundle name for this extra entry point. */ @@ -467,32 +467,32 @@ export interface ScriptClass { * The file to include. */ input: string; -} +}; /** * Security features to protect against XSS and other common attacks */ -export interface Security { +export type Security = { /** * Enables automatic generation of a hash-based Strict Content Security Policy * (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will * default to true once we are out of experimental/preview phases. */ autoCsp?: AutoCspUnion; -} +}; /** * Enables automatic generation of a hash-based Strict Content Security Policy * (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will * default to true once we are out of experimental/preview phases. */ export type AutoCspUnion = boolean | AutoCspClass; -export interface AutoCspClass { +export type AutoCspClass = { /** * Include the `unsafe-eval` directive (https://web.dev/articles/strict-csp#remove-eval) in * the auto-CSP. Please only enable this if you are absolutely sure that you need to, as * allowing calls to eval will weaken the XSS defenses provided by the auto-CSP. */ unsafeEval?: boolean; -} +}; /** * Generates a service worker configuration. */ @@ -502,7 +502,7 @@ export type ServiceWorker = boolean | string; * https://angular.dev/reference/configs/workspace-config#source-map-configuration. */ export type SourceMapUnion = boolean | SourceMapClass; -export interface SourceMapClass { +export type SourceMapClass = { /** * Output source maps used for error reporting tools. */ @@ -519,12 +519,12 @@ export interface SourceMapClass { * Resolve vendor packages source maps. */ vendor?: boolean; -} +}; /** * Server side render (SSR) pages of your application during runtime. */ export type SsrUnion = boolean | SsrClass; -export interface SsrClass { +export type SsrClass = { /** * The server entry-point that when executed will spawn the web server. */ @@ -543,7 +543,7 @@ export interface SsrClass { * versions. */ experimentalPlatform?: ExperimentalPlatform; -} +}; /** * Specifies the platform for which the server bundle is generated. This affects the APIs * and modules available in the server-side code. @@ -564,7 +564,7 @@ export declare enum ExperimentalPlatform { /** * Options to pass to style preprocessors. */ -export interface StylePreprocessorOptions { +export type StylePreprocessorOptions = { /** * Paths to include. Paths will be resolved to workspace root. */ @@ -573,11 +573,11 @@ export interface StylePreprocessorOptions { * Options to pass to the sass preprocessor. */ sass?: Sass; -} +}; /** * Options to pass to the sass preprocessor. */ -export interface Sass { +export type Sass = { /** * A set of deprecations to treat as fatal. If a deprecation warning of any provided type is * encountered during compilation, the compiler will error instead. If a Version is @@ -595,9 +595,9 @@ export interface Sass { * encountered during compilation, the compiler will ignore it instead. */ silenceDeprecations?: string[]; -} +}; export type StyleElement = StyleClass | string; -export interface StyleClass { +export type StyleClass = { /** * The bundle name for this extra entry point. */ @@ -610,4 +610,4 @@ export interface StyleClass { * The file to include. */ input: string; -} +}; diff --git a/src/builders/dev-server/index.d.ts b/src/builders/dev-server/index.d.ts index 5281f71c..3e860d1e 100644 --- a/src/builders/dev-server/index.d.ts +++ b/src/builders/dev-server/index.d.ts @@ -6,11 +6,10 @@ * found in the LICENSE file at https://angular.dev/license */ import { Builder } from '@angular-devkit/architect'; -import { json } from '@angular-devkit/core'; import { execute } from './builder'; import type { DevServerBuilderOutput } from './output'; import type { Schema as DevServerBuilderOptions } from './schema'; export { type DevServerBuilderOptions, type DevServerBuilderOutput, execute as executeDevServerBuilder, }; -declare const builder: Builder; +declare const builder: Builder; export default builder; export { execute as executeDevServer }; diff --git a/src/builders/dev-server/schema.d.ts b/src/builders/dev-server/schema.d.ts index 59647810..88dce4eb 100644 --- a/src/builders/dev-server/schema.d.ts +++ b/src/builders/dev-server/schema.d.ts @@ -1,7 +1,7 @@ /** * Dev Server target options for Build Facade. */ -export interface Schema { +export type Schema = { /** * A build builder target to serve in the format of `project:target[:configuration]`. You * can also pass in more than one configuration name as a comma-separated list. Example: @@ -78,7 +78,7 @@ export interface Schema { * Rebuild on change. */ watch?: boolean; -} +}; /** * Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are * enabled. @@ -89,10 +89,10 @@ export type Inspect = boolean | string; * enable prebundling, the Angular CLI cache must also be enabled. */ export type PrebundleUnion = boolean | PrebundleClass; -export interface PrebundleClass { +export type PrebundleClass = { /** * List of package imports that should not be prebundled by the development server. The * packages will be bundled into the application code itself. */ exclude: string[]; -} +}; diff --git a/src/builders/extract-i18n/index.d.ts b/src/builders/extract-i18n/index.d.ts index 9c641b08..b8eb54ba 100644 --- a/src/builders/extract-i18n/index.d.ts +++ b/src/builders/extract-i18n/index.d.ts @@ -6,9 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ import { Builder } from '@angular-devkit/architect'; -import { json } from '@angular-devkit/core'; import { execute } from './builder'; import type { Schema as ExtractI18nBuilderOptions } from './schema'; export { ExtractI18nBuilderOptions, execute }; -declare const builder: Builder; +declare const builder: Builder; export default builder; diff --git a/src/builders/extract-i18n/schema.d.ts b/src/builders/extract-i18n/schema.d.ts index c77f0cd2..fa72d336 100644 --- a/src/builders/extract-i18n/schema.d.ts +++ b/src/builders/extract-i18n/schema.d.ts @@ -1,7 +1,7 @@ /** * Extract i18n target options for Build Facade. */ -export interface Schema { +export type Schema = { /** * A builder target to extract i18n messages in the format of * `project:target[:configuration]`. You can also pass in more than one configuration name @@ -24,7 +24,7 @@ export interface Schema { * Log progress to the console. */ progress?: boolean; -} +}; /** * Output format for the generated file. */ diff --git a/src/builders/ng-packagr/index.d.ts b/src/builders/ng-packagr/index.d.ts index 96468079..d0890676 100644 --- a/src/builders/ng-packagr/index.d.ts +++ b/src/builders/ng-packagr/index.d.ts @@ -6,9 +6,8 @@ * found in the LICENSE file at https://angular.dev/license */ import { Builder } from '@angular-devkit/architect'; -import { json } from '@angular-devkit/core'; import { execute } from './builder'; import type { Schema as NgPackagrBuilderOptions } from './schema'; export { type NgPackagrBuilderOptions, execute }; -declare const builder: Builder; +declare const builder: Builder; export default builder; diff --git a/src/builders/ng-packagr/schema.d.ts b/src/builders/ng-packagr/schema.d.ts index 96d571fa..5607385c 100644 --- a/src/builders/ng-packagr/schema.d.ts +++ b/src/builders/ng-packagr/schema.d.ts @@ -1,7 +1,7 @@ /** * ng-packagr target options for Build Architect. Use to build library projects. */ -export interface Schema { +export type Schema = { /** * Enable and define the file watching poll time period in milliseconds. */ @@ -18,4 +18,4 @@ export interface Schema { * Run build when files change. */ watch?: boolean; -} +}; diff --git a/src/utils/i18n-options.d.ts b/src/utils/i18n-options.d.ts index c8a84eac..481a3221 100644 --- a/src/utils/i18n-options.d.ts +++ b/src/utils/i18n-options.d.ts @@ -29,7 +29,7 @@ export declare function createI18nOptions(projectMetadata: { i18n?: unknown; }, inline?: boolean | string[], logger?: { warn(message: string): void; -}): I18nOptions; +}, ssrEnabled?: boolean): I18nOptions; export declare function loadTranslations(locale: string, desc: LocaleDescription, workspaceRoot: string, loader: TranslationLoader, logger: { warn: (message: string) => void; error: (message: string) => void; diff --git a/src/utils/i18n-options.js b/src/utils/i18n-options.js index 6332d8f7..ea381d77 100644 --- a/src/utils/i18n-options.js +++ b/src/utils/i18n-options.js @@ -45,7 +45,7 @@ function ensureValidSubPath(value, name) { throw new Error(`Project field '${name}' is invalid. It can only contain letters, numbers, hyphens, and underscores.`); } } -function createI18nOptions(projectMetadata, inline, logger) { +function createI18nOptions(projectMetadata, inline, logger, ssrEnabled) { const { i18n: metadata = {} } = projectMetadata; ensureObject(metadata, 'i18n'); const i18n = { @@ -71,10 +71,12 @@ function createI18nOptions(projectMetadata, inline, logger) { } if (metadata.sourceLocale.baseHref !== undefined) { ensureString(metadata.sourceLocale.baseHref, 'i18n.sourceLocale.baseHref'); - logger?.warn(`The 'baseHref' field under 'i18n.sourceLocale' is deprecated and will be removed in future versions. ` + - `Please use 'subPath' instead.\nNote: 'subPath' defines the URL segment for the locale, acting ` + - `as both the HTML base HREF and the directory name for output.\nBy default, ` + - `if not specified, 'subPath' uses the locale code.`); + if (ssrEnabled) { + logger?.warn(`'baseHref' in 'i18n.sourceLocale' may lead to undefined behavior when used with SSR. ` + + `Consider using 'subPath' instead.\n\n` + + `Note: 'subPath' specifies the URL segment for the locale, serving as both the HTML base HREF ` + + `and the output directory name.\nBy default, if not explicitly set, 'subPath' defaults to the locale code.`); + } rawSourceLocaleBaseHref = metadata.sourceLocale.baseHref; } if (metadata.sourceLocale.subPath !== undefined) { @@ -104,10 +106,12 @@ function createI18nOptions(projectMetadata, inline, logger) { translationFiles = normalizeTranslationFileOption(options.translation, locale, false); if ('baseHref' in options) { ensureString(options.baseHref, `i18n.locales.${locale}.baseHref`); - logger?.warn(`The 'baseHref' field under 'i18n.locales.${locale}' is deprecated and will be removed in future versions. ` + - `Please use 'subPath' instead.\nNote: 'subPath' defines the URL segment for the locale, acting ` + - `as both the HTML base HREF and the directory name for output.\nBy default, ` + - `if not specified, 'subPath' uses the locale code.`); + if (ssrEnabled) { + logger?.warn(`'baseHref' in 'i18n.locales.${locale}' may lead to undefined behavior when used with SSR. ` + + `Consider using 'subPath' instead.\n\n` + + `Note: 'subPath' specifies the URL segment for the locale, serving as both the HTML base HREF ` + + `and the output directory name.\nBy default, if not explicitly set, 'subPath' defaults to the locale code.`); + } baseHref = options.baseHref; } if ('subPath' in options) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6be5d3ce..b879e26b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-bce32c1'; +const VERSION = '19.1.3+sha-bd2ab46'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 20eebcff..e16927ac 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 21 2025 15:24:56 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 21 2025 15:51:14 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 59c02b451f734a6aac6bec9399809ed53f7723aa Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 21 Jan 2025 20:16:44 +0000 Subject: [PATCH 41/91] 14d2f7c fix(@angular/build): include extracted routes in the manifest during prerendering --- package.json | 8 ++++---- src/utils/i18n-options.js | 22 +++++++++++----------- src/utils/normalize-cache.js | 2 +- src/utils/server-rendering/prerender.js | 7 +++++++ uniqueId | 2 +- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 80062793..14e5b9e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-bd2ab46", + "version": "19.1.3+sha-14d2f7c", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bd2ab46", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#14d2f7c", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#bd2ab46", + "@angular/ssr": "github:angular/angular-ssr-builds#14d2f7c", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#bd2ab46", + "@angular/ssr": "github:angular/angular-ssr-builds#14d2f7c", "less": { "optional": true }, diff --git a/src/utils/i18n-options.js b/src/utils/i18n-options.js index ea381d77..2303b191 100644 --- a/src/utils/i18n-options.js +++ b/src/utils/i18n-options.js @@ -135,17 +135,6 @@ function createI18nOptions(projectMetadata, inline, logger, ssrEnabled) { }; } } - // Check that subPaths are unique. - const localesData = Object.entries(i18n.locales); - for (let i = 0; i < localesData.length; i++) { - const [localeA, { subPath: subPathA }] = localesData[i]; - for (let j = i + 1; j < localesData.length; j++) { - const [localeB, { subPath: subPathB }] = localesData[j]; - if (subPathA === subPathB) { - throw new Error(`Invalid i18n configuration: Locales '${localeA}' and '${localeB}' cannot have the same subPath: '${subPathB}'.`); - } - } - } if (inline === true) { i18n.inlineLocales.add(i18n.sourceLocale); Object.keys(i18n.locales).forEach((locale) => i18n.inlineLocales.add(locale)); @@ -158,6 +147,17 @@ function createI18nOptions(projectMetadata, inline, logger, ssrEnabled) { i18n.inlineLocales.add(locale); } } + // Check that subPaths are unique only the locales that we are inlining. + const localesData = Object.entries(i18n.locales).filter(([locale]) => i18n.inlineLocales.has(locale)); + for (let i = 0; i < localesData.length; i++) { + const [localeA, { subPath: subPathA }] = localesData[i]; + for (let j = i + 1; j < localesData.length; j++) { + const [localeB, { subPath: subPathB }] = localesData[j]; + if (subPathA === subPathB) { + throw new Error(`Invalid i18n configuration: Locales '${localeA}' and '${localeB}' cannot have the same subPath: '${subPathB}'.`); + } + } + } return i18n; } function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedFormats, duplicateTranslation) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index b879e26b..7ef60db8 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-bd2ab46'; +const VERSION = '19.1.3+sha-14d2f7c'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/server-rendering/prerender.js b/src/utils/server-rendering/prerender.js index d1b54e9a..100834ca 100644 --- a/src/utils/server-rendering/prerender.js +++ b/src/utils/server-rendering/prerender.js @@ -16,6 +16,7 @@ const error_1 = require("../error"); const url_1 = require("../url"); const worker_pool_1 = require("../worker-pool"); const utils_1 = require("./esm-in-memory-loader/utils"); +const manifest_1 = require("./manifest"); const models_1 = require("./models"); async function prerenderPages(workspaceRoot, baseHref, appShellOptions, prerenderOptions, outputFiles, assets, outputMode, sourcemap = false, maxThreads = 1) { const outputFilesForWorker = {}; @@ -89,6 +90,12 @@ async function prerenderPages(workspaceRoot, baseHref, appShellOptions, prerende serializableRouteTreeNode, }; } + // Add the extracted routes to the manifest file. + // We could re-generate it from the start, but that would require a number of options to be passed down. + const manifest = outputFilesForWorker[manifest_1.SERVER_APP_MANIFEST_FILENAME]; + if (manifest) { + outputFilesForWorker[manifest_1.SERVER_APP_MANIFEST_FILENAME] = manifest.replace('routes: undefined,', `routes: ${JSON.stringify(serializableRouteTreeNodeForPrerender, undefined, 2)},`); + } // Render routes const { errors: renderingErrors, output } = await renderPages(baseHref, sourcemap, serializableRouteTreeNodeForPrerender, maxThreads, workspaceRoot, outputFilesForWorker, assetsReversed, outputMode, appShellRoute ?? appShellOptions?.route); errors.push(...renderingErrors); diff --git a/uniqueId b/uniqueId index e16927ac..7c2977d2 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 21 2025 15:51:14 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 21 2025 20:16:44 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 38c7aaebedc8eef9cef61becb51f596d2af14f99 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 22 Jan 2025 08:14:10 +0000 Subject: [PATCH 42/91] 9bacf39 fix(@angular/ssr): properly manage catch-all routes with base href --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 14e5b9e6..bc6a0ebd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-14d2f7c", + "version": "19.1.3+sha-9bacf39", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#14d2f7c", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#9bacf39", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#14d2f7c", + "@angular/ssr": "github:angular/angular-ssr-builds#9bacf39", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#14d2f7c", + "@angular/ssr": "github:angular/angular-ssr-builds#9bacf39", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 7ef60db8..2c279614 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-14d2f7c'; +const VERSION = '19.1.3+sha-9bacf39'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7c2977d2..bdbff52b 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 21 2025 20:16:44 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 22 2025 08:14:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ffd553cff2ed3b06430f1ef53c7fa8ee3e6a701e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 22 Jan 2025 10:02:03 +0000 Subject: [PATCH 43/91] c5d9038 refactor(@angular/ssr): update `getPathSegments` to use `stripTrailingSlash` instead of `filter(Boolean)` --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index bc6a0ebd..3600d090 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-9bacf39", + "version": "19.1.3+sha-c5d9038", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#9bacf39", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c5d9038", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#9bacf39", + "@angular/ssr": "github:angular/angular-ssr-builds#c5d9038", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#9bacf39", + "@angular/ssr": "github:angular/angular-ssr-builds#c5d9038", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 2c279614..1d1fb087 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-9bacf39'; +const VERSION = '19.1.3+sha-c5d9038'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index bdbff52b..f8bf2e70 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 22 2025 08:14:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 22 2025 10:02:03 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 77a0ac5f74d88216d931c6716123f84219ff2235 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 22 Jan 2025 20:26:42 +0000 Subject: [PATCH 44/91] ec8f589 release: cut the v19.1.4 release --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3600d090..a1326af7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.3+sha-c5d9038", + "version": "19.1.4+sha-ec8f589", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c5d9038", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ec8f589", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#c5d9038", + "@angular/ssr": "github:angular/angular-ssr-builds#ec8f589", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#c5d9038", + "@angular/ssr": "github:angular/angular-ssr-builds#ec8f589", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 1d1fb087..a5e81b21 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.3+sha-c5d9038'; +const VERSION = '19.1.4+sha-ec8f589'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f8bf2e70..63af7363 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 22 2025 10:02:03 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 22 2025 20:26:42 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 4ce1a7c5d22635f23d50ab00887bbe8b3d04dd55 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 22 Jan 2025 22:06:29 +0000 Subject: [PATCH 45/91] e1c8e05 refactor(@angular/ssr): remove unused `segment` property from metadata --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a1326af7..45c9a80c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-ec8f589", + "version": "19.1.4+sha-e1c8e05", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ec8f589", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#e1c8e05", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#ec8f589", + "@angular/ssr": "github:angular/angular-ssr-builds#e1c8e05", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#ec8f589", + "@angular/ssr": "github:angular/angular-ssr-builds#e1c8e05", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a5e81b21..dcc73b4d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-ec8f589'; +const VERSION = '19.1.4+sha-e1c8e05'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 63af7363..f747ce50 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 22 2025 20:26:42 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 22 2025 22:06:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 045233421702098bf2ad5098a54fc98970058011 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 23 Jan 2025 15:14:22 +0000 Subject: [PATCH 46/91] e73e910 fix(@angular/build): handle empty module case to avoid TypeError --- package.json | 8 ++++---- src/builders/dev-server/vite-server.js | 18 +++++++----------- src/tools/vite/middlewares/ssr-middleware.js | 4 ++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 45c9a80c..a38e5cb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-e1c8e05", + "version": "19.1.4+sha-e73e910", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#e1c8e05", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#e73e910", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#e1c8e05", + "@angular/ssr": "github:angular/angular-ssr-builds#e73e910", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#e1c8e05", + "@angular/ssr": "github:angular/angular-ssr-builds#e73e910", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 3dae3206..fb008ef9 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -353,26 +353,22 @@ async function invalidateUpdatedFiles(normalizePath, generatedFiles, assetFiles, updatedFiles.push(file); } // Invalidate any updated files - let destroyAngularServerAppCalled = false; + let serverApplicationChanged = false; for (const [file, record] of generatedFiles) { if (!record.updated) { continue; } record.updated = false; - if (record.type === internal_1.BuildOutputFileType.ServerApplication && !destroyAngularServerAppCalled) { - // Clear the server app cache - // This must be done before module invalidation. - const { ɵdestroyAngularServerApp } = (await server.ssrLoadModule('/main.server.mjs')); - ɵdestroyAngularServerApp(); - destroyAngularServerAppCalled = true; - } updatedFiles.push(file); + serverApplicationChanged ||= record.type === internal_1.BuildOutputFileType.ServerApplication; const updatedModules = server.moduleGraph.getModulesByFile(normalizePath((0, node_path_1.join)(server.config.root, file))); updatedModules?.forEach((m) => server.moduleGraph.invalidateModule(m)); } - if (destroyAngularServerAppCalled) { - // Trigger module evaluation before reload to initiate dependency optimization. - await server.ssrLoadModule('/main.server.mjs'); + if (serverApplicationChanged) { + // Clear the server app cache and + // trigger module evaluation before reload to initiate dependency optimization. + const { ɵdestroyAngularServerApp } = (await server.ssrLoadModule('/main.server.mjs')); + ɵdestroyAngularServerApp(); } return updatedFiles; } diff --git a/src/tools/vite/middlewares/ssr-middleware.js b/src/tools/vite/middlewares/ssr-middleware.js index 4a553789..40ab7573 100644 --- a/src/tools/vite/middlewares/ssr-middleware.js +++ b/src/tools/vite/middlewares/ssr-middleware.js @@ -22,6 +22,10 @@ function createAngularSsrInternalMiddleware(server, indexHtmlTransformer) { // which must be processed by the runtime linker, even if they are not used. await (0, load_esm_1.loadEsmModule)('@angular/compiler'); const { writeResponseToNodeResponse, createWebRequestFromNodeRequest } = await (0, load_esm_1.loadEsmModule)('@angular/ssr/node'); + // The following is necessary because accessing the module after invalidation may result in an empty module, + // which can trigger a `TypeError: ɵgetOrCreateAngularServerApp is not a function` error. + // TODO: look into why. + await server.ssrLoadModule('/main.server.mjs'); const { ɵgetOrCreateAngularServerApp } = (await server.ssrLoadModule('/main.server.mjs')); const angularServerApp = ɵgetOrCreateAngularServerApp({ allowStaticRouteRender: true, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index dcc73b4d..bc1cd0b2 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-e1c8e05'; +const VERSION = '19.1.4+sha-e73e910'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f747ce50..ddb3940e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 22 2025 22:06:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 23 2025 15:14:22 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From f3c4f92144a146992e4f70713a1a51259168af6d Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 23 Jan 2025 16:06:41 +0000 Subject: [PATCH 47/91] df9865f build: exclude CLI workspace projects from tsconfig to speed up IDE/linting --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a38e5cb6..292209fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-e73e910", + "version": "19.1.4+sha-df9865f", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#e73e910", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#df9865f", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#e73e910", + "@angular/ssr": "github:angular/angular-ssr-builds#df9865f", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#e73e910", + "@angular/ssr": "github:angular/angular-ssr-builds#df9865f", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index bc1cd0b2..fb92985d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-e73e910'; +const VERSION = '19.1.4+sha-df9865f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index ddb3940e..45517ee1 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 23 2025 15:14:22 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 23 2025 16:06:41 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1040b0755b1ab6246e08cd3bc622ede3afcd6fb9 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 24 Jan 2025 10:52:59 +0000 Subject: [PATCH 48/91] 94643d5 fix(@angular/ssr): enhance dynamic route matching for better performance and accuracy --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 292209fb..a09ffed2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-df9865f", + "version": "19.1.4+sha-94643d5", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#df9865f", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#94643d5", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#df9865f", + "@angular/ssr": "github:angular/angular-ssr-builds#94643d5", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#df9865f", + "@angular/ssr": "github:angular/angular-ssr-builds#94643d5", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index fb92985d..d1cae287 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-df9865f'; +const VERSION = '19.1.4+sha-94643d5'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 45517ee1..371504bd 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 23 2025 16:06:41 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 24 2025 10:52:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From b96d7744e6b8386f0b1f8a736ab18070a76cdab9 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 24 Jan 2025 12:28:52 +0000 Subject: [PATCH 49/91] bd9d379 fix(@angular/build): disable TypeScript `removeComments` option --- package.json | 8 ++++---- src/tools/angular/compilation/angular-compilation.js | 3 +++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a09ffed2..953df4ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-94643d5", + "version": "19.1.4+sha-bd9d379", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#94643d5", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bd9d379", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#94643d5", + "@angular/ssr": "github:angular/angular-ssr-builds#bd9d379", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#94643d5", + "@angular/ssr": "github:angular/angular-ssr-builds#bd9d379", "less": { "optional": true }, diff --git a/src/tools/angular/compilation/angular-compilation.js b/src/tools/angular/compilation/angular-compilation.js index 3b835313..53168ea8 100644 --- a/src/tools/angular/compilation/angular-compilation.js +++ b/src/tools/angular/compilation/angular-compilation.js @@ -80,6 +80,9 @@ class AngularCompilation { enableResourceInlining: false, supportTestBed: false, supportJitMode: false, + // Disable removing of comments as TS is quite aggressive with these and can + // remove important annotations, such as /* @__PURE__ */ and comments like /* vite-ignore */. + removeComments: false, })); } async diagnoseFiles(modes = DiagnosticModes.All) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d1cae287..b903a7b9 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-94643d5'; +const VERSION = '19.1.4+sha-bd9d379'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 371504bd..8128146e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 24 2025 10:52:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 24 2025 12:28:52 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 98ab04736e45d806bb4dd8cb5081597673d15ec5 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 24 Jan 2025 15:28:06 +0000 Subject: [PATCH 50/91] 6880199 fix(@angular/build): update vite to version 6.0.11 --- package.json | 10 +++++----- src/builders/dev-server/options.d.ts | 1 + src/builders/dev-server/options.js | 3 ++- src/builders/dev-server/schema.d.ts | 12 ++++++++++++ src/builders/dev-server/schema.json | 17 +++++++++++++++++ src/builders/dev-server/vite-server.js | 1 + src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 8 files changed, 40 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 953df4ac..27103e8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-bd9d379", + "version": "19.1.4+sha-6880199", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bd9d379", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6880199", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -45,7 +45,7 @@ "rollup": "4.30.1", "sass": "1.83.1", "semver": "7.6.3", - "vite": "6.0.7", + "vite": "6.0.11", "watchpack": "2.4.2" }, "optionalDependencies": { @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#bd9d379", + "@angular/ssr": "github:angular/angular-ssr-builds#6880199", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#bd9d379", + "@angular/ssr": "github:angular/angular-ssr-builds#6880199", "less": { "optional": true }, diff --git a/src/builders/dev-server/options.d.ts b/src/builders/dev-server/options.d.ts index 27f9091e..ed8e1021 100644 --- a/src/builders/dev-server/options.d.ts +++ b/src/builders/dev-server/options.d.ts @@ -44,4 +44,5 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s host?: string; port?: number; }; + allowedHosts: true | string[]; }>; diff --git a/src/builders/dev-server/options.js b/src/builders/dev-server/options.js index 3c5222f5..58dc59e6 100644 --- a/src/builders/dev-server/options.js +++ b/src/builders/dev-server/options.js @@ -73,7 +73,7 @@ async function normalizeOptions(context, projectName, options) { } } // Initial options to keep - const { host, port, poll, open, verbose, watch, liveReload, hmr, headers, proxyConfig, servePath, ssl, sslCert, sslKey, prebundle, } = options; + const { host, port, poll, open, verbose, watch, liveReload, hmr, headers, proxyConfig, servePath, ssl, sslCert, sslKey, prebundle, allowedHosts, } = options; // Return all the normalized options return { buildTarget, @@ -97,5 +97,6 @@ async function normalizeOptions(context, projectName, options) { // Prebundling defaults to true but requires caching to function prebundle: cacheOptions.enabled && !optimization.scripts && prebundle, inspect, + allowedHosts: allowedHosts ? allowedHosts : [], }; } diff --git a/src/builders/dev-server/schema.d.ts b/src/builders/dev-server/schema.d.ts index 88dce4eb..78828412 100644 --- a/src/builders/dev-server/schema.d.ts +++ b/src/builders/dev-server/schema.d.ts @@ -2,6 +2,12 @@ * Dev Server target options for Build Facade. */ export type Schema = { + /** + * The hosts that can access the development server. This option sets the Vite option of the + * same name. For further details: + * https://vite.dev/config/server-options.html#server-allowedhosts + */ + allowedHosts?: AllowedHosts; /** * A build builder target to serve in the format of `project:target[:configuration]`. You * can also pass in more than one configuration name as a comma-separated list. Example: @@ -79,6 +85,12 @@ export type Schema = { */ watch?: boolean; }; +/** + * The hosts that can access the development server. This option sets the Vite option of the + * same name. For further details: + * https://vite.dev/config/server-options.html#server-allowedhosts + */ +export type AllowedHosts = string[] | boolean; /** * Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are * enabled. diff --git a/src/builders/dev-server/schema.json b/src/builders/dev-server/schema.json index 2eb16987..3d5cf155 100644 --- a/src/builders/dev-server/schema.json +++ b/src/builders/dev-server/schema.json @@ -36,6 +36,23 @@ "type": "string", "description": "SSL certificate to use for serving HTTPS." }, + "allowedHosts": { + "description": "The hosts that can access the development server. This option sets the Vite option of the same name. For further details: https://vite.dev/config/server-options.html#server-allowedhosts", + "default": [], + "oneOf": [ + { + "type": "array", + "description": "List of hosts that are allowed to access the development server.", + "items": { + "type": "string" + } + }, + { + "type": "boolean", + "description": "Indicates that all hosts are allowed. This is not recommended and a security risk." + } + ] + }, "headers": { "type": "object", "description": "Custom HTTP headers to be added to all responses.", diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index fb008ef9..3c382492 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -541,6 +541,7 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, strictPort: true, host: serverOptions.host, open: serverOptions.open, + allowedHosts: serverOptions.allowedHosts, headers: serverOptions.headers, // Disable the websocket if live reload is disabled (false/undefined are the only valid values) ws: serverOptions.liveReload === false && serverOptions.hmr === false ? false : undefined, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index b903a7b9..6bb57dc4 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-bd9d379'; +const VERSION = '19.1.4+sha-6880199'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 8128146e..f6a0cd23 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 24 2025 12:28:52 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 24 2025 15:28:06 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From a97d569d4a53c1fa3562ec0856d52f872eb75c2d Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 27 Jan 2025 14:58:12 +0000 Subject: [PATCH 51/91] 2011d34 fix(@angular/build): support template updates that also trigger global stylesheet changes --- package.json | 8 ++++---- src/builders/application/build-action.js | 23 +++++++++++++++++++++-- src/builders/dev-server/vite-server.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 27103e8d..46f753c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-6880199", + "version": "19.1.4+sha-2011d34", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6880199", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2011d34", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#6880199", + "@angular/ssr": "github:angular/angular-ssr-builds#2011d34", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#6880199", + "@angular/ssr": "github:angular/angular-ssr-builds#2011d34", "less": { "optional": true }, diff --git a/src/builders/application/build-action.js b/src/builders/application/build-action.js index a99702ac..08dd745e 100644 --- a/src/builders/application/build-action.js +++ b/src/builders/application/build-action.js @@ -239,6 +239,7 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa outputOptions, }, }; + let hasCssUpdates = false; // Initially assume all previous output files have been removed const removedOutputFiles = new Map(previousOutputInfo); for (const file of outputFiles) { @@ -254,8 +255,11 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa incrementalResult.modified.push(file.path); } if (needFile) { - // Updates to non-JS files must signal an update with the dev server - if (!/(?:\.m?js|\.map)$/.test(file.path)) { + if (file.path.endsWith('.css')) { + hasCssUpdates = true; + } + else if (!/(?:\.m?js|\.map)$/.test(file.path)) { + // Updates to non-JS files must signal an update with the dev server incrementalResult.background = false; } incrementalResult.files[file.path] = { @@ -281,6 +285,7 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa else { continue; } + hasCssUpdates ||= destination.endsWith('.css'); incrementalResult.files[destination] = { type: bundler_context_1.BuildOutputFileType.Browser, inputPath: source, @@ -299,6 +304,17 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa // If there are template updates and the incremental update was background only, a component // update is possible. if (hasTemplateUpdates && incrementalResult.background) { + // Template changes may be accompanied by stylesheet changes and these should also be updated hot when possible. + if (hasCssUpdates) { + const styleResult = { + kind: results_1.ResultKind.Incremental, + added: incrementalResult.added.filter(isCssFilePath), + removed: incrementalResult.removed.filter(({ path }) => isCssFilePath(path)), + modified: incrementalResult.modified.filter(isCssFilePath), + files: Object.fromEntries(Object.entries(incrementalResult.files).filter(([path]) => isCssFilePath(path))), + }; + yield styleResult; + } const updateResult = { kind: results_1.ResultKind.ComponentUpdate, updates: Array.from(templateUpdates, ([id, content]) => ({ @@ -310,3 +326,6 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa yield updateResult; } } +function isCssFilePath(filePath) { + return /\.css(?:\.map)?$/i.test(filePath); +} diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 3c382492..7f17e356 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -420,7 +420,7 @@ function handleUpdate(server, serverOptions, logger, componentStyles, updatedFil type: 'update', updates, }); - logger.info('HMR update sent to client(s).'); + logger.info('Stylesheet update sent to client(s).'); return; } } diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6bb57dc4..0cf8b58f 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-6880199'; +const VERSION = '19.1.4+sha-2011d34'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f6a0cd23..594a49e2 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 24 2025 15:28:06 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 27 2025 14:58:12 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e6798d3f2daeda825d3231ae546af88965d0437a Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 27 Jan 2025 18:34:35 +0000 Subject: [PATCH 52/91] d53d25f fix(@angular/build): allow tailwindcss 4.x as a peer dependency --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 46f753c3..4b8c8b55 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-2011d34", + "version": "19.1.4+sha-d53d25f", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2011d34", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d53d25f", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,11 +57,11 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#2011d34", + "@angular/ssr": "github:angular/angular-ssr-builds#d53d25f", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", - "tailwindcss": "^2.0.0 || ^3.0.0", + "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0", "typescript": ">=5.5 <5.8" }, "peerDependenciesMeta": { @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#2011d34", + "@angular/ssr": "github:angular/angular-ssr-builds#d53d25f", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 0cf8b58f..fc4fc882 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-2011d34'; +const VERSION = '19.1.4+sha-d53d25f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 594a49e2..1e17deba 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 27 2025 14:58:12 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Jan 27 2025 18:34:35 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 5e550d759b0dbf0bced3769fa0ae825dcc1588ed Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 28 Jan 2025 08:16:44 +0000 Subject: [PATCH 53/91] 14ab097 docs: fix relative link to README not working on npm repo (#29496) --- README.md | 2 +- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1e0b0acc..5e033985 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,4 @@ npm install git+https://github.com/angular/angular-build-builds.git The sources for this package are in the [Angular CLI](https://github.com/angular/angular-cli) repository. Please file issues and pull requests against that repository. -Usage information and reference details can be found in repository [README](../../../README.md) file. +Usage information and reference details can be found in repository [README](https://github.com/angular/angular-cli/blob/main/README.md) file. diff --git a/package.json b/package.json index 4b8c8b55..72890d3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-d53d25f", + "version": "19.1.4+sha-14ab097", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d53d25f", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#14ab097", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#d53d25f", + "@angular/ssr": "github:angular/angular-ssr-builds#14ab097", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#d53d25f", + "@angular/ssr": "github:angular/angular-ssr-builds#14ab097", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index fc4fc882..545207dd 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-d53d25f'; +const VERSION = '19.1.4+sha-14ab097'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 1e17deba..e7248c6a 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Jan 27 2025 18:34:35 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 28 2025 08:16:44 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 0c22714281d5d87460b70a1a52acfc29cb45e446 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 28 Jan 2025 08:34:30 +0000 Subject: [PATCH 54/91] bbbc1eb fix(@angular/ssr): rename `provideServerRoutesConfig` to `provideServerRouting` --- package.json | 8 ++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 72890d3f..25d1067c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-14ab097", + "version": "19.1.4+sha-bbbc1eb", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,7 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#14ab097", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bbbc1eb", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +57,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#14ab097", + "@angular/ssr": "github:angular/angular-ssr-builds#bbbc1eb", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +74,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#14ab097", + "@angular/ssr": "github:angular/angular-ssr-builds#bbbc1eb", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 545207dd..fd221088 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-14ab097'; +const VERSION = '19.1.4+sha-bbbc1eb'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e7248c6a..3a08e66f 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 28 2025 08:16:44 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 28 2025 08:34:30 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 4deb3fcc10a6df17ce752c9aa32584099e993831 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 28 Jan 2025 15:24:23 +0000 Subject: [PATCH 55/91] 66fa06c build: migrate `@angular/build` tests to `rules_js` --- package.json | 9 +++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 25d1067c..4e20b389 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-bbbc1eb", + "version": "19.1.4+sha-66fa06c", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,7 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bbbc1eb", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#66fa06c", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#66fa06c", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -57,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#bbbc1eb", + "@angular/ssr": "github:angular/angular-ssr-builds#66fa06c", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -74,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#bbbc1eb", + "@angular/ssr": "github:angular/angular-ssr-builds#66fa06c", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index fd221088..dc9b1389 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-bbbc1eb'; +const VERSION = '19.1.4+sha-66fa06c'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 3a08e66f..6a8196ef 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 28 2025 08:34:30 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 28 2025 15:24:23 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 3d3795b0cc046619f51a6f305533614d32ac1108 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 28 Jan 2025 16:45:26 +0000 Subject: [PATCH 56/91] 3cc197c refactor(@angular/build): allow browser client to log console message with dev-server --- package.json | 10 +++++----- src/builders/dev-server/vite-server.js | 17 +++++++++++++++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 4e20b389..c0b9e9a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-66fa06c", + "version": "19.1.4+sha-3cc197c", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#66fa06c", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#66fa06c", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#3cc197c", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3cc197c", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#66fa06c", + "@angular/ssr": "github:angular/angular-ssr-builds#3cc197c", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#66fa06c", + "@angular/ssr": "github:angular/angular-ssr-builds#3cc197c", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 7f17e356..708f1d63 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -304,6 +304,23 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context const serverConfiguration = await setupServer(serverOptions, generatedFiles, assetFiles, browserOptions.preserveSymlinks, externalMetadata, ssrMode, prebundleTransformer, target, (0, internal_1.isZonelessApp)(polyfills), componentStyles, templateUpdates, browserOptions.loader, browserOptions.define, extensions?.middleware, transformers?.indexHtml, thirdPartySourcemaps); server = await createServer(serverConfiguration); await server.listen(); + // Setup builder context logging for browser clients + server.hot.on('angular:log', (data) => { + if (typeof data?.text !== 'string') { + context.logger.warn('Development server client sent invalid internal log event.'); + } + switch (data.kind) { + case 'error': + context.logger.error(`[CLIENT ERROR]: ${data.text}`); + break; + case 'warning': + context.logger.warn(`[CLIENT WARNING]: ${data.text}`); + break; + default: + context.logger.info(`[CLIENT INFO]: ${data.text}`); + break; + } + }); const urls = server.resolvedUrls; if (urls && (urls.local.length || urls.network.length)) { serverUrl = new URL(urls.local[0] ?? urls.network[0]); diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index dc9b1389..8967e204 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-66fa06c'; +const VERSION = '19.1.4+sha-3cc197c'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 6a8196ef..eae8d5f0 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 28 2025 15:24:23 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Jan 28 2025 16:45:26 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 8bb6f2d01ac48b4f15d6ffd68f8d5b1fffd236aa Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 29 Jan 2025 07:25:04 +0000 Subject: [PATCH 57/91] bb41345 fix(@angular/build): keep background referenced HMR update chunks --- package.json | 10 +++++----- src/builders/application/build-action.js | 8 ++++++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c0b9e9a1..4c3c9f3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-3cc197c", + "version": "19.1.4+sha-bb41345", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#3cc197c", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3cc197c", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#bb41345", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bb41345", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#3cc197c", + "@angular/ssr": "github:angular/angular-ssr-builds#bb41345", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#3cc197c", + "@angular/ssr": "github:angular/angular-ssr-builds#bb41345", "less": { "optional": true }, diff --git a/src/builders/application/build-action.js b/src/builders/application/build-action.js index 08dd745e..4eacdbd5 100644 --- a/src/builders/application/build-action.js +++ b/src/builders/application/build-action.js @@ -292,6 +292,14 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa origin: 'disk', }; } + // Do not remove stale files yet if there are template updates. + // Component chunk files may still be referenced in running browser code. + // Module evaluation time component updates will update any of these files. + // This typically occurs when a lazy component is changed that has not yet + // been accessed at runtime. + if (hasTemplateUpdates && incrementalResult.background) { + removedOutputFiles.clear(); + } // Include the removed output and asset files incrementalResult.removed.push(...Array.from(removedOutputFiles, ([file, { type }]) => ({ path: file, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 8967e204..102deeb2 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-3cc197c'; +const VERSION = '19.1.4+sha-bb41345'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index eae8d5f0..f3995049 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Jan 28 2025 16:45:26 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 29 2025 07:25:04 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e24d0e12735f553da04ea172e768a90254112e0f Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 29 Jan 2025 09:58:29 +0000 Subject: [PATCH 58/91] 7532aca build: migrate `@angular-devkit/build-angular` tests to `rules_js` --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- src/utils/service-worker.d.ts | 2 +- src/utils/service-worker.js | 10 +++------- uniqueId | 2 +- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 4c3c9f3a..7dcea6e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-bb41345", + "version": "19.1.4+sha-7532aca", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#bb41345", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bb41345", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#7532aca", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7532aca", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#bb41345", + "@angular/ssr": "github:angular/angular-ssr-builds#7532aca", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#bb41345", + "@angular/ssr": "github:angular/angular-ssr-builds#7532aca", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 102deeb2..ec5c3152 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-bb41345'; +const VERSION = '19.1.4+sha-7532aca'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/service-worker.d.ts b/src/utils/service-worker.d.ts index 28559329..9ad0cc4a 100644 --- a/src/utils/service-worker.d.ts +++ b/src/utils/service-worker.d.ts @@ -9,7 +9,7 @@ import type { Config, Filesystem } from '@angular/service-worker/config'; import { promises as fsPromises } from 'node:fs'; import { BuildOutputFile } from '../tools/esbuild/bundler-context'; import { BuildOutputAsset } from '../tools/esbuild/bundler-execution-result'; -export declare function augmentAppWithServiceWorker(appRoot: string, workspaceRoot: string, outputPath: string, baseHref: string, ngswConfigPath?: string, inputputFileSystem?: typeof fsPromises, outputFileSystem?: typeof fsPromises): Promise; +export declare function augmentAppWithServiceWorker(appRoot: string, workspaceRoot: string, outputPath: string, baseHref: string, ngswConfigPath?: string, inputFileSystem?: typeof fsPromises, outputFileSystem?: typeof fsPromises): Promise; export declare function augmentAppWithServiceWorkerEsbuild(workspaceRoot: string, configPath: string, baseHref: string, indexHtml: string | undefined, outputFiles: BuildOutputFile[], assetFiles: BuildOutputAsset[]): Promise<{ manifest: string; assetFiles: BuildOutputAsset[]; diff --git a/src/utils/service-worker.js b/src/utils/service-worker.js index 08fb5119..ce7e439f 100644 --- a/src/utils/service-worker.js +++ b/src/utils/service-worker.js @@ -133,7 +133,7 @@ class ResultFilesystem { throw new Error('Serviceworker manifest generator should not attempted to write.'); } } -async function augmentAppWithServiceWorker(appRoot, workspaceRoot, outputPath, baseHref, ngswConfigPath, inputputFileSystem = node_fs_1.promises, outputFileSystem = node_fs_1.promises) { +async function augmentAppWithServiceWorker(appRoot, workspaceRoot, outputPath, baseHref, ngswConfigPath, inputFileSystem = node_fs_1.promises, outputFileSystem = node_fs_1.promises) { // Determine the configuration file path const configPath = ngswConfigPath ? path.join(workspaceRoot, ngswConfigPath) @@ -141,7 +141,7 @@ async function augmentAppWithServiceWorker(appRoot, workspaceRoot, outputPath, b // Read the configuration file let config; try { - const configurationData = await inputputFileSystem.readFile(configPath, 'utf-8'); + const configurationData = await inputFileSystem.readFile(configPath, 'utf-8'); config = JSON.parse(configurationData); } catch (error) { @@ -158,11 +158,7 @@ async function augmentAppWithServiceWorker(appRoot, workspaceRoot, outputPath, b const result = await augmentAppWithServiceWorkerCore(config, new CliFilesystem(outputFileSystem, outputPath), baseHref); const copy = async (src, dest) => { const resolvedDest = path.join(outputPath, dest); - return inputputFileSystem === outputFileSystem - ? // Native FS (Builder). - inputputFileSystem.copyFile(src, resolvedDest, node_fs_1.constants.COPYFILE_FICLONE) - : // memfs (Webpack): Read the file from the input FS (disk) and write it to the output FS (memory). - outputFileSystem.writeFile(resolvedDest, await inputputFileSystem.readFile(src)); + return outputFileSystem.writeFile(resolvedDest, await inputFileSystem.readFile(src)); }; await outputFileSystem.writeFile(path.join(outputPath, 'ngsw.json'), result.manifest); for (const { source, destination } of result.assetFiles) { diff --git a/uniqueId b/uniqueId index f3995049..e6fc4776 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 29 2025 07:25:04 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 29 2025 09:58:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From a9b5cc53e7e454c49f5fc457d3997b4ecf3f70b4 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 29 Jan 2025 15:27:23 +0000 Subject: [PATCH 59/91] 747557a fix(@angular/ssr): redirect to locale pathname instead of full URL --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7dcea6e8..1a4ab30d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-7532aca", + "version": "19.1.4+sha-747557a", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#7532aca", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7532aca", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#747557a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#747557a", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#7532aca", + "@angular/ssr": "github:angular/angular-ssr-builds#747557a", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#7532aca", + "@angular/ssr": "github:angular/angular-ssr-builds#747557a", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ec5c3152..d8205e79 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-7532aca'; +const VERSION = '19.1.4+sha-747557a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e6fc4776..5c05f459 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 29 2025 09:58:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 29 2025 15:27:23 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 898ded7cfd2a22ac1d188679251dcb6410d2ed07 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 29 Jan 2025 15:39:01 +0000 Subject: [PATCH 60/91] 5a6f853 release: cut the v19.1.5 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 1a4ab30d..5908e404 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.4+sha-747557a", + "version": "19.1.5+sha-5a6f853", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#747557a", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#747557a", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#5a6f853", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5a6f853", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#747557a", + "@angular/ssr": "github:angular/angular-ssr-builds#5a6f853", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#747557a", + "@angular/ssr": "github:angular/angular-ssr-builds#5a6f853", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d8205e79..d72e1149 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.4+sha-747557a'; +const VERSION = '19.1.5+sha-5a6f853'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 5c05f459..b4010136 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 29 2025 15:27:23 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 29 2025 15:39:01 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 98d65955bfb36632a3f9f31119d2848453aa0521 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 29 Jan 2025 16:40:29 +0000 Subject: [PATCH 61/91] 2b9c00f fix(@angular/build): prevent fallback to serving main.js for unknown requests --- package.json | 10 +++++----- src/builders/dev-server/vite-server.js | 5 ++++- src/tools/vite/plugins/angular-memory-plugin.js | 15 ++------------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 5908e404..33416bc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-5a6f853", + "version": "19.1.5+sha-2b9c00f", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#5a6f853", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5a6f853", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2b9c00f", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2b9c00f", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#5a6f853", + "@angular/ssr": "github:angular/angular-ssr-builds#2b9c00f", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#5a6f853", + "@angular/ssr": "github:angular/angular-ssr-builds#2b9c00f", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 708f1d63..1aea1b40 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -589,7 +589,10 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, }, // This is needed when `externalDependencies` is used to prevent Vite load errors. // NOTE: If Vite adds direct support for externals, this can be removed. - preTransformRequests: externalMetadata.explicitBrowser.length === 0, + // NOTE: Vite breaks the resolution of browser modules in SSR + // when accessing a url with two or more segments (e.g., 'foo/bar'), + // as they are not re-based from the base href. + preTransformRequests: externalMetadata.explicitBrowser.length === 0 && ssrMode === plugins_1.ServerSsrMode.NoSsr, }, ssr: { // Note: `true` and `/.*/` have different sematics. When true, the `external` option is ignored. diff --git a/src/tools/vite/plugins/angular-memory-plugin.js b/src/tools/vite/plugins/angular-memory-plugin.js index cb8e6b84..666c7a06 100644 --- a/src/tools/vite/plugins/angular-memory-plugin.js +++ b/src/tools/vite/plugins/angular-memory-plugin.js @@ -47,24 +47,13 @@ async function createAngularMemoryPlugin(options) { // `/@id/${source}` but is currently closer to a raw external than a resolved file path. return source; } - if (importer) { + if (importer && source[0] === '.') { const normalizedImporter = normalizePath(importer); - if (source[0] === '.' && normalizedImporter.startsWith(virtualProjectRoot)) { + if (normalizedImporter.startsWith(virtualProjectRoot)) { // Remove query if present const [importerFile] = normalizedImporter.split('?', 1); source = '/' + (0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.relative)(virtualProjectRoot, importerFile)), source); } - else if (!ssr && - source[0] === '/' && - importer.endsWith('index.html') && - normalizedImporter.startsWith(virtualProjectRoot)) { - // This is only needed when using SSR and `angularSsrMiddleware` (old style) to correctly resolve - // .js files when using lazy-loading. - // Remove query if present - const [importerFile] = normalizedImporter.split('?', 1); - source = - '/' + (0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.relative)(virtualProjectRoot, importerFile)), (0, node_path_1.basename)(source)); - } } const [file] = source.split('?', 1); if (outputFiles.has(normalizePath(file))) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d72e1149..89f4d511 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-5a6f853'; +const VERSION = '19.1.5+sha-2b9c00f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index b4010136..e5739376 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 29 2025 15:39:01 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 29 2025 16:40:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 17b958b935626704e0efb9a0f5362bb09e009a5c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 29 Jan 2025 19:10:07 +0000 Subject: [PATCH 62/91] 0eea8fc refactor(@angular/build): remove unused import --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 33416bc4..bd1c133a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-2b9c00f", + "version": "19.1.5+sha-0eea8fc", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2b9c00f", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2b9c00f", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#0eea8fc", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#0eea8fc", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#2b9c00f", + "@angular/ssr": "github:angular/angular-ssr-builds#0eea8fc", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#2b9c00f", + "@angular/ssr": "github:angular/angular-ssr-builds#0eea8fc", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 89f4d511..937ad6f0 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-2b9c00f'; +const VERSION = '19.1.5+sha-0eea8fc'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e5739376..d46c9d63 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 29 2025 16:40:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Jan 29 2025 19:10:07 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 988d7bacf704eee7e0496c2940647d9314015085 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 30 Jan 2025 18:49:43 +0000 Subject: [PATCH 63/91] 45abd15 fix(@angular/build): prevent server manifest generation when no server features are enabled --- package.json | 10 +++++----- src/builders/application/execute-post-bundle.js | 4 ++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index bd1c133a..704b91e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-0eea8fc", + "version": "19.1.5+sha-45abd15", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#0eea8fc", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#0eea8fc", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#45abd15", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#45abd15", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#0eea8fc", + "@angular/ssr": "github:angular/angular-ssr-builds#45abd15", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#0eea8fc", + "@angular/ssr": "github:angular/angular-ssr-builds#45abd15", "less": { "optional": true }, diff --git a/src/builders/application/execute-post-bundle.js b/src/builders/application/execute-post-bundle.js index 70291cbd..1d412c64 100644 --- a/src/builders/application/execute-post-bundle.js +++ b/src/builders/application/execute-post-bundle.js @@ -38,7 +38,7 @@ async function executePostBundleSteps(metafile, options, outputFiles, assetFiles const allErrors = []; const allWarnings = []; const prerenderedRoutes = {}; - const { baseHref = '/', serviceWorker, i18nOptions, indexHtmlOptions, optimizationOptions, sourcemapOptions, outputMode, serverEntryPoint, prerenderOptions, appShellOptions, publicPath, workspaceRoot, partialSSRBuild, } = options; + const { baseHref = '/', serviceWorker, ssrOptions, indexHtmlOptions, optimizationOptions, sourcemapOptions, outputMode, serverEntryPoint, prerenderOptions, appShellOptions, publicPath, workspaceRoot, partialSSRBuild, } = options; // Index HTML content without CSS inlining to be used for server rendering (AppShell, SSG and SSR). // NOTE: Critical CSS inlining is deliberately omitted here, as it will be handled during server rendering. // Additionally, when using prerendering or AppShell, the index HTML file may be regenerated. @@ -57,7 +57,7 @@ async function executePostBundleSteps(metafile, options, outputFiles, assetFiles } // Create server manifest const initialFilesPaths = new Set(initialFiles.keys()); - if (serverEntryPoint) { + if (serverEntryPoint && (outputMode || prerenderOptions || appShellOptions || ssrOptions)) { const { manifestContent, serverAssetsChunks } = (0, manifest_1.generateAngularServerAppManifest)(additionalHtmlOutputFiles, outputFiles, optimizationOptions.styles.inlineCritical ?? false, undefined, locale, baseHref, initialFilesPaths, metafile, publicPath); additionalOutputFiles.push(...serverAssetsChunks, (0, utils_1.createOutputFile)(manifest_1.SERVER_APP_MANIFEST_FILENAME, manifestContent, bundler_context_1.BuildOutputFileType.ServerApplication)); } diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 937ad6f0..269a23ca 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-0eea8fc'; +const VERSION = '19.1.5+sha-45abd15'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index d46c9d63..03ce4da7 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Jan 29 2025 19:10:07 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Jan 30 2025 18:49:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 542512a5de3f072e73cb6c69b4c2335ee6ec5d96 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 31 Jan 2025 17:39:31 +0000 Subject: [PATCH 64/91] 5bfbf2e ci: disable evalutations that arecausing codeql timeouts --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 704b91e8..7828c4ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-45abd15", + "version": "19.1.5+sha-5bfbf2e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#45abd15", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#45abd15", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#5bfbf2e", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5bfbf2e", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#45abd15", + "@angular/ssr": "github:angular/angular-ssr-builds#5bfbf2e", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#45abd15", + "@angular/ssr": "github:angular/angular-ssr-builds#5bfbf2e", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 269a23ca..0ce73c5c 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-45abd15'; +const VERSION = '19.1.5+sha-5bfbf2e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 03ce4da7..53321e0c 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Jan 30 2025 18:49:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 31 2025 17:39:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 2e61e2ec32dbf9afeaf0247d2febc22832085e97 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 31 Jan 2025 18:42:38 +0000 Subject: [PATCH 65/91] 2dec1e7 ci: empty default permissions for CodeQL action --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7828c4ae..7dec0d4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-5bfbf2e", + "version": "19.1.5+sha-2dec1e7", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#5bfbf2e", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5bfbf2e", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2dec1e7", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2dec1e7", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#5bfbf2e", + "@angular/ssr": "github:angular/angular-ssr-builds#2dec1e7", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#5bfbf2e", + "@angular/ssr": "github:angular/angular-ssr-builds#2dec1e7", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 0ce73c5c..b254f1ce 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-5bfbf2e'; +const VERSION = '19.1.5+sha-2dec1e7'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 53321e0c..8d694e20 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 31 2025 17:39:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Jan 31 2025 18:42:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 792c57eb4ddfc02e2be4baaf3c225204189cd8e2 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 3 Feb 2025 20:33:33 +0000 Subject: [PATCH 66/91] 3f70426 fix(@schematics/angular): remove additional newline after standalone property --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7dec0d4f..efea6483 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-2dec1e7", + "version": "19.1.5+sha-3f70426", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2dec1e7", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2dec1e7", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#3f70426", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3f70426", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#2dec1e7", + "@angular/ssr": "github:angular/angular-ssr-builds#3f70426", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#2dec1e7", + "@angular/ssr": "github:angular/angular-ssr-builds#3f70426", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index b254f1ce..0fb57569 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-2dec1e7'; +const VERSION = '19.1.5+sha-3f70426'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 8d694e20..ac41a0e0 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Jan 31 2025 18:42:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Feb 03 2025 20:33:33 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 2a516c1a25f418d1f75236ddeae69326ee1a83db Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 3 Feb 2025 22:43:04 +0000 Subject: [PATCH 67/91] 4b4eeca build: Preserve newlines when gathering stdout --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index efea6483..a26e1669 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-3f70426", + "version": "19.1.5+sha-4b4eeca", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#3f70426", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3f70426", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#4b4eeca", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4b4eeca", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#3f70426", + "@angular/ssr": "github:angular/angular-ssr-builds#4b4eeca", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#3f70426", + "@angular/ssr": "github:angular/angular-ssr-builds#4b4eeca", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 0fb57569..d27c5e5b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-3f70426'; +const VERSION = '19.1.5+sha-4b4eeca'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index ac41a0e0..727e1124 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Feb 03 2025 20:33:33 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Feb 03 2025 22:43:04 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 0d089b36552e9f0d215472c5d4a4995b4a9c2b81 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 3 Feb 2025 23:29:32 +0000 Subject: [PATCH 68/91] de66572 refactor(@angular/ssr): simplify preload append logic in metadata --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a26e1669..e8dfb4f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-4b4eeca", + "version": "19.1.5+sha-de66572", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#4b4eeca", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4b4eeca", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#de66572", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#de66572", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#4b4eeca", + "@angular/ssr": "github:angular/angular-ssr-builds#de66572", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#4b4eeca", + "@angular/ssr": "github:angular/angular-ssr-builds#de66572", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d27c5e5b..2664b2de 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-4b4eeca'; +const VERSION = '19.1.5+sha-de66572'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 727e1124..48f2d4d4 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Feb 03 2025 22:43:04 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Feb 03 2025 23:29:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From dcb9e9158ea85b233d38ee7a1aad12299373204d Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 4 Feb 2025 12:20:32 +0000 Subject: [PATCH 69/91] 58c2122 refactor(@angular/build): allow component update invalidation from client --- package.json | 10 +++++----- src/builders/dev-server/vite-server.js | 23 +++++++++++++++++++++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e8dfb4f5..f8f8730f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-de66572", + "version": "19.1.5+sha-58c2122", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#de66572", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#de66572", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#58c2122", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#58c2122", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#de66572", + "@angular/ssr": "github:angular/angular-ssr-builds#58c2122", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#de66572", + "@angular/ssr": "github:angular/angular-ssr-builds#58c2122", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 1aea1b40..d66e8ded 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -321,6 +321,29 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context break; } }); + // Setup component HMR invalidation + // Invalidation occurs when the runtime cannot update a component + server.hot.on('angular:invalidate', (data) => { + if (typeof data?.id !== 'string') { + context.logger.warn('Development server client sent invalid internal invalidate event.'); + } + // Clear invalid template update + templateUpdates.delete(data.id); + // Some cases are expected unsupported update scenarios but some may be errors. + // If an error occurred, log the error in addition to the invalidation. + if (data.error) { + context.logger.error(`Component update failed${data.message ? `: ${data.message}` : '.'}` + + '\nPlease consider reporting the error at https://github.com/angular/angular-cli/issues'); + } + else { + context.logger.warn(`Component update unsupported${data.message ? `: ${data.message}` : '.'}`); + } + server?.ws.send({ + type: 'full-reload', + path: '*', + }); + context.logger.info('Page reload sent to client(s).'); + }); const urls = server.resolvedUrls; if (urls && (urls.local.length || urls.network.length)) { serverUrl = new URL(urls.local[0] ?? urls.network[0]); diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 2664b2de..e570bfdd 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-de66572'; +const VERSION = '19.1.5+sha-58c2122'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 48f2d4d4..689d6b07 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Feb 03 2025 23:29:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Feb 04 2025 12:20:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 5734f60db5915f1382513b09ee9390cb43fa7e42 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 5 Feb 2025 21:25:44 +0000 Subject: [PATCH 70/91] 8f6ee7e fix(@angular/build): ensure full rebuild after initial error build in watch mode --- package.json | 10 +++++----- src/builders/application/build-action.js | 7 ++++++- src/builders/dev-server/vite-server.js | 15 +++++++++------ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index f8f8730f..5d7813fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-58c2122", + "version": "19.1.5+sha-8f6ee7e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#58c2122", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#58c2122", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#8f6ee7e", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8f6ee7e", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#58c2122", + "@angular/ssr": "github:angular/angular-ssr-builds#8f6ee7e", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#58c2122", + "@angular/ssr": "github:angular/angular-ssr-builds#8f6ee7e", "less": { "optional": true }, diff --git a/src/builders/application/build-action.js b/src/builders/application/build-action.js index 4eacdbd5..5b0a7e9c 100644 --- a/src/builders/application/build-action.js +++ b/src/builders/application/build-action.js @@ -127,6 +127,9 @@ async function* runEsBuildBuildAction(action, options) { if (!watcher) { return; } + // Used to force a full result on next rebuild if there were initial errors. + // This ensures at least one full result is emitted. + let hasInitialErrors = result.errors.length > 0; // Wait for changes and rebuild as needed const currentWatchFiles = new Set(result.watchFiles); try { @@ -164,9 +167,11 @@ async function* runEsBuildBuildAction(action, options) { if (staleWatchFiles?.size) { watcher.remove([...staleWatchFiles]); } - for (const outputResult of emitOutputResults(result, outputOptions, changes, incrementalResults ? rebuildState : undefined)) { + for (const outputResult of emitOutputResults(result, outputOptions, changes, incrementalResults && !hasInitialErrors ? rebuildState : undefined)) { yield outputResult; } + // Clear initial build errors flag if no errors are now present + hasInitialErrors &&= result.errors.length > 0; } } finally { diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index d66e8ded..e1bbf8e4 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -161,6 +161,7 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context }, }); } + yield { baseUrl: '', success: false }; continue; } // Clear existing error overlay on successful result @@ -573,6 +574,14 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, mainFields: ['es2020', 'browser', 'module', 'main'], preserveSymlinks, }, + dev: { + // This is needed when `externalDependencies` is used to prevent Vite load errors. + // NOTE: If Vite adds direct support for externals, this can be removed. + // NOTE: Vite breaks the resolution of browser modules in SSR + // when accessing a url with two or more segments (e.g., 'foo/bar'), + // as they are not re-based from the base href. + preTransformRequests: externalMetadata.explicitBrowser.length === 0 && ssrMode === plugins_1.ServerSsrMode.NoSsr, + }, server: { warmup: { ssrFiles, @@ -610,12 +619,6 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, ...[...assets.values()].map(({ source }) => source), ], }, - // This is needed when `externalDependencies` is used to prevent Vite load errors. - // NOTE: If Vite adds direct support for externals, this can be removed. - // NOTE: Vite breaks the resolution of browser modules in SSR - // when accessing a url with two or more segments (e.g., 'foo/bar'), - // as they are not re-based from the base href. - preTransformRequests: externalMetadata.explicitBrowser.length === 0 && ssrMode === plugins_1.ServerSsrMode.NoSsr, }, ssr: { // Note: `true` and `/.*/` have different sematics. When true, the `external` option is ignored. diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index e570bfdd..26cc7c11 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-58c2122'; +const VERSION = '19.1.5+sha-8f6ee7e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 689d6b07..c0af91ee 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Feb 04 2025 12:20:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Feb 05 2025 21:25:44 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ad6c27a8be1a518bceb9391b93a6e671a8d00aa5 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 5 Feb 2025 21:56:09 +0000 Subject: [PATCH 71/91] f4de3d2 release: cut the v19.1.6 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 5d7813fc..3ad83870 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.5+sha-8f6ee7e", + "version": "19.1.6+sha-f4de3d2", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#8f6ee7e", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8f6ee7e", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#f4de3d2", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f4de3d2", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#8f6ee7e", + "@angular/ssr": "github:angular/angular-ssr-builds#f4de3d2", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#8f6ee7e", + "@angular/ssr": "github:angular/angular-ssr-builds#f4de3d2", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 26cc7c11..e71042d4 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.5+sha-8f6ee7e'; +const VERSION = '19.1.6+sha-f4de3d2'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index c0af91ee..a71a6557 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Feb 05 2025 21:25:44 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Feb 05 2025 21:56:09 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 51211ee1207a643bd68b11ac06b9c5f01b9810a8 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 6 Feb 2025 20:00:32 +0000 Subject: [PATCH 72/91] f5d9745 fix(@angular/ssr): accurately calculate content length for static pages with `\r\n` --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- src/utils/server-rendering/manifest.js | 9 +++++++-- uniqueId | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 3ad83870..4a6228f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-f4de3d2", + "version": "19.1.6+sha-f5d9745", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#f4de3d2", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f4de3d2", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#f5d9745", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f5d9745", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#f4de3d2", + "@angular/ssr": "github:angular/angular-ssr-builds#f5d9745", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#f4de3d2", + "@angular/ssr": "github:angular/angular-ssr-builds#f5d9745", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index e71042d4..7d637670 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-f4de3d2'; +const VERSION = '19.1.6+sha-f5d9745'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/server-rendering/manifest.js b/src/utils/server-rendering/manifest.js index 22c114fe..a96c34bf 100644 --- a/src/utils/server-rendering/manifest.js +++ b/src/utils/server-rendering/manifest.js @@ -11,6 +11,7 @@ exports.SERVER_APP_ENGINE_MANIFEST_FILENAME = exports.SERVER_APP_MANIFEST_FILENA exports.generateAngularServerAppEngineManifest = generateAngularServerAppEngineManifest; exports.generateAngularServerAppManifest = generateAngularServerAppManifest; const node_path_1 = require("node:path"); +const node_vm_1 = require("node:vm"); const bundler_context_1 = require("../../tools/esbuild/bundler-context"); const utils_1 = require("../../tools/esbuild/utils"); const environment_options_1 = require("../environment-options"); @@ -115,9 +116,13 @@ function generateAngularServerAppManifest(additionalHtmlOutputFiles, outputFiles const extension = (0, node_path_1.extname)(file.path); if (extension === '.html' || (inlineCriticalCss && extension === '.css')) { const jsChunkFilePath = `assets-chunks/${file.path.replace(/[./]/g, '_')}.mjs`; - serverAssetsChunks.push((0, utils_1.createOutputFile)(jsChunkFilePath, `export default \`${escapeUnsafeChars(file.text)}\`;`, bundler_context_1.BuildOutputFileType.ServerApplication)); + const escapedContent = escapeUnsafeChars(file.text); + serverAssetsChunks.push((0, utils_1.createOutputFile)(jsChunkFilePath, `export default \`${escapedContent}\`;`, bundler_context_1.BuildOutputFileType.ServerApplication)); + // This is needed because JavaScript engines script parser convert `\r\n` to `\n` in template literals, + // which can result in an incorrect byte length. + const size = (0, node_vm_1.runInThisContext)(`new TextEncoder().encode(\`${escapedContent}\`).byteLength`); serverAssets[file.path] = - `{size: ${file.size}, hash: '${file.hash}', text: () => import('./${jsChunkFilePath}').then(m => m.default)}`; + `{size: ${size}, hash: '${file.hash}', text: () => import('./${jsChunkFilePath}').then(m => m.default)}`; } } // When routes have been extracted, mappings are no longer needed, as preloads will be included in the metadata. diff --git a/uniqueId b/uniqueId index a71a6557..2c192882 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Feb 05 2025 21:56:09 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Feb 06 2025 20:00:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 4e7b3d2f43275fe4495fc174c5d421344a75dfdd Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 6 Feb 2025 21:01:58 +0000 Subject: [PATCH 73/91] bf939eb refactor(@angular/build): also add `server.preTransformRequests` --- package.json | 10 +++++----- src/builders/dev-server/vite-server.js | 17 +++++++++++------ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 4a6228f6..b7d3d3c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-f5d9745", + "version": "19.1.6+sha-bf939eb", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#f5d9745", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f5d9745", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#bf939eb", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bf939eb", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#f5d9745", + "@angular/ssr": "github:angular/angular-ssr-builds#bf939eb", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#f5d9745", + "@angular/ssr": "github:angular/angular-ssr-builds#bf939eb", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index e1bbf8e4..2ee9cd85 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -530,6 +530,7 @@ function updateResultRecord(outputPath, file, normalizePath, htmlIndexPath, gene } } } +// eslint-disable-next-line max-lines-per-function async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, externalMetadata, ssrMode, prebundleTransformer, target, zoneless, componentStyles, templateUpdates, prebundleLoaderExtensions, define, extensionMiddleware, indexHtmlTransformer, thirdPartySourcemaps = false) { const proxy = await (0, utils_2.loadProxyConfiguration)(serverOptions.workspaceRoot, serverOptions.proxyConfig); // dynamically import Vite for ESM compatibility @@ -546,6 +547,14 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, ssrFiles = ['./main.server.mjs', './server.mjs']; break; } + /** + * Required when using `externalDependencies` to prevent Vite load errors. + * + * @note Can be removed if Vite introduces native support for externals. + * @note Vite misresolves browser modules in SSR when accessing URLs with multiple segments + * (e.g., 'foo/bar'), as they are not correctly re-based from the base href. + */ + const preTransformRequests = externalMetadata.explicitBrowser.length === 0 && ssrMode === plugins_1.ServerSsrMode.NoSsr; const cacheDir = (0, node_path_1.join)(serverOptions.cacheOptions.path, serverOptions.buildTarget.project, 'vite'); const configuration = { configFile: false, @@ -575,14 +584,10 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, preserveSymlinks, }, dev: { - // This is needed when `externalDependencies` is used to prevent Vite load errors. - // NOTE: If Vite adds direct support for externals, this can be removed. - // NOTE: Vite breaks the resolution of browser modules in SSR - // when accessing a url with two or more segments (e.g., 'foo/bar'), - // as they are not re-based from the base href. - preTransformRequests: externalMetadata.explicitBrowser.length === 0 && ssrMode === plugins_1.ServerSsrMode.NoSsr, + preTransformRequests, }, server: { + preTransformRequests, warmup: { ssrFiles, }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 7d637670..17df437d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-f5d9745'; +const VERSION = '19.1.6+sha-bf939eb'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 2c192882..2a6f95b8 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Feb 06 2025 20:00:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Feb 06 2025 21:01:58 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 66cd75c940c0bf21a2aad50df038b68089f65541 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 10 Feb 2025 15:40:59 +0000 Subject: [PATCH 74/91] a13a49d fix(@angular/build): exclude unmodified files from logs with `--localize` --- package.json | 10 +++++----- src/builders/application/execute-build.js | 2 +- src/tools/esbuild/utils.js | 5 ++++- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b7d3d3c0..8a825fc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-bf939eb", + "version": "19.1.6+sha-a13a49d", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#bf939eb", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#bf939eb", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#a13a49d", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a13a49d", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#bf939eb", + "@angular/ssr": "github:angular/angular-ssr-builds#a13a49d", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#bf939eb", + "@angular/ssr": "github:angular/angular-ssr-builds#a13a49d", "less": { "optional": true }, diff --git a/src/builders/application/execute-build.js b/src/builders/application/execute-build.js index a76618d2..3605a044 100644 --- a/src/builders/application/execute-build.js +++ b/src/builders/application/execute-build.js @@ -148,7 +148,6 @@ async function executeBuild(options, context, rebuildState) { } const { metafile, initialFiles, outputFiles } = bundlingResult; executionResult.outputFiles.push(...outputFiles); - const changedFiles = rebuildState && executionResult.findChangedFiles(rebuildState.previousOutputInfo); // Analyze files for bundle budget failures if present let budgetFailures; if (options.budgets) { @@ -218,6 +217,7 @@ async function executeBuild(options, context, rebuildState) { executionResult.addOutputFile('stats.json', JSON.stringify(metafile, null, 2), bundler_context_1.BuildOutputFileType.Root); } if (!jsonLogs) { + const changedFiles = rebuildState && executionResult.findChangedFiles(rebuildState.previousOutputInfo); executionResult.addLog((0, utils_1.logBuildStats)(metafile, outputFiles, initialFiles, budgetFailures, colors, changedFiles, estimatedTransferSizes, !!ssrOptions, verbose)); } return executionResult; diff --git a/src/tools/esbuild/utils.js b/src/tools/esbuild/utils.js index 1e4cfa2b..4d2af550 100644 --- a/src/tools/esbuild/utils.js +++ b/src/tools/esbuild/utils.js @@ -35,6 +35,9 @@ const manifest_1 = require("../../utils/server-rendering/manifest"); const stats_table_1 = require("../../utils/stats-table"); const bundler_context_1 = require("./bundler-context"); function logBuildStats(metafile, outputFiles, initial, budgetFailures, colors, changedFiles, estimatedTransferSizes, ssrOutputEnabled, verbose) { + // Remove the i18n subpath in case the build is using i18n. + // en-US/main.js -> main.js + const normalizedChangedFiles = new Set([...(changedFiles ?? [])].map((f) => (0, node_path_1.basename)(f))); const browserStats = []; const serverStats = []; let unchangedCount = 0; @@ -45,7 +48,7 @@ function logBuildStats(metafile, outputFiles, initial, budgetFailures, colors, c continue; } // Show only changed files if a changed list is provided - if (changedFiles && !changedFiles.has(file)) { + if (normalizedChangedFiles.size && !normalizedChangedFiles.has(file)) { ++unchangedCount; continue; } diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 17df437d..73012cef 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-bf939eb'; +const VERSION = '19.1.6+sha-a13a49d'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 2a6f95b8..583b1bd9 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Feb 06 2025 21:01:58 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Feb 10 2025 15:40:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 74c6cb5da6dae4f09e0225cd4bd154f1d2ef4c0e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 10 Feb 2025 16:41:01 +0000 Subject: [PATCH 75/91] 0826315 fix(@angular/build): handle unlocalizable files correctly in localized prerender --- package.json | 10 +++++----- src/builders/application/i18n.js | 6 ++++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 8a825fc3..7555eb2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-a13a49d", + "version": "19.1.6+sha-0826315", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#a13a49d", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a13a49d", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#0826315", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#0826315", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#a13a49d", + "@angular/ssr": "github:angular/angular-ssr-builds#0826315", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#a13a49d", + "@angular/ssr": "github:angular/angular-ssr-builds#0826315", "less": { "optional": true }, diff --git a/src/builders/application/i18n.js b/src/builders/application/i18n.js index 4119d902..874cd944 100644 --- a/src/builders/application/i18n.js +++ b/src/builders/application/i18n.js @@ -41,6 +41,8 @@ async function inlineI18n(metafile, options, executionResult, initialFiles) { // For each active locale, use the inliner to process the output files of the build. const updatedOutputFiles = []; const updatedAssetFiles = []; + // Root and SSR entry files are not modified. + const unModifiedOutputFiles = executionResult.outputFiles.filter(({ type }) => type === bundler_context_1.BuildOutputFileType.Root || type === bundler_context_1.BuildOutputFileType.ServerRoot); try { for (const locale of i18nOptions.inlineLocales) { // A locale specific set of files is returned from the inliner. @@ -51,7 +53,7 @@ async function inlineI18n(metafile, options, executionResult, initialFiles) { const { errors, warnings, additionalAssets, additionalOutputFiles, prerenderedRoutes: generatedRoutes, } = await (0, execute_post_bundle_1.executePostBundleSteps)(metafile, { ...options, baseHref: (0, options_1.getLocaleBaseHref)(baseHref, i18nOptions, locale) ?? baseHref, - }, localeOutputFiles, executionResult.assetFiles, initialFiles, locale); + }, [...unModifiedOutputFiles, ...localeOutputFiles], executionResult.assetFiles, initialFiles, locale); localeOutputFiles.push(...additionalOutputFiles); inlineResult.errors.push(...errors); inlineResult.warnings.push(...warnings); @@ -81,7 +83,7 @@ async function inlineI18n(metafile, options, executionResult, initialFiles) { // Update the result with all localized files. executionResult.outputFiles = [ // Root and SSR entry files are not modified. - ...executionResult.outputFiles.filter(({ type }) => type === bundler_context_1.BuildOutputFileType.Root || type === bundler_context_1.BuildOutputFileType.ServerRoot), + ...unModifiedOutputFiles, // Updated files for each locale. ...updatedOutputFiles, ]; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 73012cef..687a9cb2 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-a13a49d'; +const VERSION = '19.1.6+sha-0826315'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 583b1bd9..f8873e51 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Feb 10 2025 15:40:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Feb 10 2025 16:41:01 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 0efdaa43efd32ffd00723fe9053c73cd4c29538c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 10 Feb 2025 23:44:18 +0000 Subject: [PATCH 76/91] c26ea16 fix(@angular/ssr): properly handle baseHref with protocol --- package.json | 10 +++++----- src/builders/dev-server/vite-server.js | 2 +- src/tools/vite/plugins/angular-memory-plugin.d.ts | 2 +- src/tools/vite/plugins/angular-memory-plugin.js | 12 +++++++++--- src/utils/normalize-cache.js | 2 +- src/utils/server-rendering/prerender.js | 6 +++--- uniqueId | 2 +- 7 files changed, 21 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 7555eb2f..c8e615c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-0826315", + "version": "19.1.6+sha-c26ea16", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#0826315", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#0826315", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c26ea16", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c26ea16", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#0826315", + "@angular/ssr": "github:angular/angular-ssr-builds#c26ea16", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#0826315", + "@angular/ssr": "github:angular/angular-ssr-builds#c26ea16", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 2ee9cd85..a173c250 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -665,7 +665,7 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, outputFiles, templateUpdates, external: externalMetadata.explicitBrowser, - skipViteClient: serverOptions.liveReload === false && serverOptions.hmr === false, + disableViteTransport: !serverOptions.liveReload, }), ], // Browser only optimizeDeps. (This does not run for SSR dependencies). diff --git a/src/tools/vite/plugins/angular-memory-plugin.d.ts b/src/tools/vite/plugins/angular-memory-plugin.d.ts index d1b5fbfc..a1c69320 100644 --- a/src/tools/vite/plugins/angular-memory-plugin.d.ts +++ b/src/tools/vite/plugins/angular-memory-plugin.d.ts @@ -12,7 +12,7 @@ interface AngularMemoryPluginOptions { outputFiles: AngularMemoryOutputFiles; templateUpdates?: ReadonlyMap; external?: string[]; - skipViteClient?: boolean; + disableViteTransport?: boolean; } export declare function createAngularMemoryPlugin(options: AngularMemoryPluginOptions): Promise; export {}; diff --git a/src/tools/vite/plugins/angular-memory-plugin.js b/src/tools/vite/plugins/angular-memory-plugin.js index 666c7a06..8bfd134d 100644 --- a/src/tools/vite/plugins/angular-memory-plugin.js +++ b/src/tools/vite/plugins/angular-memory-plugin.js @@ -73,7 +73,7 @@ async function createAngularMemoryPlugin(options) { const codeContents = outputFiles.get(relativeFile)?.contents; if (codeContents === undefined) { if (relativeFile.endsWith('/node_modules/vite/dist/client/client.mjs')) { - return options.skipViteClient ? '' : loadViteClientCode(file); + return loadViteClientCode(file, options.disableViteTransport); } return undefined; } @@ -96,9 +96,9 @@ async function createAngularMemoryPlugin(options) { * @param file The absolute path to the Vite client code. * @returns */ -async function loadViteClientCode(file) { +async function loadViteClientCode(file, disableViteTransport = false) { const originalContents = await (0, promises_1.readFile)(file, 'utf-8'); - const updatedContents = originalContents.replace(`"You can also disable this overlay by setting ", + let updatedContents = originalContents.replace(`"You can also disable this overlay by setting ", h("code", { part: "config-option-name" }, "server.hmr.overlay"), " to ", h("code", { part: "config-option-value" }, "false"), @@ -106,5 +106,11 @@ async function loadViteClientCode(file) { h("code", { part: "config-file-name" }, hmrConfigName), "."`, ''); (0, node_assert_1.default)(originalContents !== updatedContents, 'Failed to update Vite client error overlay text.'); + if (disableViteTransport) { + const previousUpdatedContents = updatedContents; + updatedContents = updatedContents.replace('transport.connect(handleMessage)', ''); + (0, node_assert_1.default)(previousUpdatedContents !== updatedContents, 'Failed to update Vite client WebSocket disable.'); + updatedContents = updatedContents.replace('console.debug("[vite] connecting...")', ''); + } return updatedContents; } diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 687a9cb2..77fc6e3b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-0826315'; +const VERSION = '19.1.6+sha-c26ea16'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/server-rendering/prerender.js b/src/utils/server-rendering/prerender.js index 100834ca..e51d7f3b 100644 --- a/src/utils/server-rendering/prerender.js +++ b/src/utils/server-rendering/prerender.js @@ -128,11 +128,11 @@ async function renderPages(baseHref, sourcemap, serializableRouteTreeNode, maxTh try { const renderingPromises = []; const appShellRouteWithLeadingSlash = appShellRoute && addLeadingSlash(appShellRoute); - const baseHrefWithLeadingSlash = addLeadingSlash(baseHref); + const baseHrefPathnameWithLeadingSlash = new URL(baseHref, 'http://localhost').pathname; for (const { route, redirectTo } of serializableRouteTreeNode) { // Remove the base href from the file output path. - const routeWithoutBaseHref = addTrailingSlash(route).startsWith(baseHrefWithLeadingSlash) - ? addLeadingSlash(route.slice(baseHrefWithLeadingSlash.length)) + const routeWithoutBaseHref = addTrailingSlash(route).startsWith(baseHrefPathnameWithLeadingSlash) + ? addLeadingSlash(route.slice(baseHrefPathnameWithLeadingSlash.length)) : route; const outPath = node_path_1.posix.join(removeLeadingSlash(routeWithoutBaseHref), 'index.html'); if (typeof redirectTo === 'string') { diff --git a/uniqueId b/uniqueId index f8873e51..1f380730 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Feb 10 2025 16:41:01 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Feb 10 2025 23:44:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 60fd2c024960ddacd6ca5c33cf56fb4b405bf9bd Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 11 Feb 2025 16:33:59 +0000 Subject: [PATCH 77/91] 36afdf5 refactor(@angular/build): remove outdated `allowedHosts` warning --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c8e615c1..a29810e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-c26ea16", + "version": "19.1.6+sha-36afdf5", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c26ea16", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c26ea16", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#36afdf5", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#36afdf5", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#c26ea16", + "@angular/ssr": "github:angular/angular-ssr-builds#36afdf5", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#c26ea16", + "@angular/ssr": "github:angular/angular-ssr-builds#36afdf5", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 77fc6e3b..8bc09f11 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-c26ea16'; +const VERSION = '19.1.6+sha-36afdf5'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 1f380730..c69bb408 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Feb 10 2025 23:44:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Feb 11 2025 16:33:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 0da4819ed59459a2df9fa015ef775dd34ece5dd8 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 11 Feb 2025 19:30:25 +0000 Subject: [PATCH 78/91] d2e1c8e perf(@angular/build): cache translated i18n bundles for faster builds --- package.json | 10 +-- src/builders/application/i18n.js | 3 +- src/tools/esbuild/i18n-inliner.d.ts | 9 ++ src/tools/esbuild/i18n-inliner.js | 131 +++++++++++++++++++++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 6 files changed, 128 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index a29810e7..0811508c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-36afdf5", + "version": "19.1.6+sha-d2e1c8e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#36afdf5", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#36afdf5", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#d2e1c8e", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d2e1c8e", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#36afdf5", + "@angular/ssr": "github:angular/angular-ssr-builds#d2e1c8e", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#36afdf5", + "@angular/ssr": "github:angular/angular-ssr-builds#d2e1c8e", "less": { "optional": true }, diff --git a/src/builders/application/i18n.js b/src/builders/application/i18n.js index 874cd944..b299c6c2 100644 --- a/src/builders/application/i18n.js +++ b/src/builders/application/i18n.js @@ -26,12 +26,13 @@ const options_1 = require("./options"); * @param initialFiles A map containing initial file information for the executed build. */ async function inlineI18n(metafile, options, executionResult, initialFiles) { - const { i18nOptions, optimizationOptions, baseHref } = options; + const { i18nOptions, optimizationOptions, baseHref, cacheOptions } = options; // Create the multi-threaded inliner with common options and the files generated from the build. const inliner = new i18n_inliner_1.I18nInliner({ missingTranslation: i18nOptions.missingTranslationBehavior ?? 'warning', outputFiles: executionResult.outputFiles, shouldOptimize: optimizationOptions.scripts, + persistentCachePath: cacheOptions.enabled ? cacheOptions.path : undefined, }, environment_options_1.maxWorkers); const inlineResult = { errors: [], diff --git a/src/tools/esbuild/i18n-inliner.d.ts b/src/tools/esbuild/i18n-inliner.d.ts index 26c211df..47c2d11d 100644 --- a/src/tools/esbuild/i18n-inliner.d.ts +++ b/src/tools/esbuild/i18n-inliner.d.ts @@ -13,6 +13,7 @@ export interface I18nInlinerOptions { missingTranslation: 'error' | 'warning' | 'ignore'; outputFiles: BuildOutputFile[]; shouldOptimize?: boolean; + persistentCachePath?: string; } /** * A class that performs i18n translation inlining of JavaScript code. @@ -22,6 +23,7 @@ export interface I18nInlinerOptions { */ export declare class I18nInliner { #private; + private readonly options; constructor(options: I18nInlinerOptions, maxThreads?: number); /** * Performs inlining of translations for the provided locale and translations. The files that @@ -41,4 +43,11 @@ export declare class I18nInliner { * @returns A void promise that resolves when closing is complete. */ close(): Promise; + /** + * Initializes the cache for storing translated bundles. + * If the cache is already initialized, it does nothing. + * + * @returns A promise that resolves once the cache initialization process is complete. + */ + private initCache; } diff --git a/src/tools/esbuild/i18n-inliner.js b/src/tools/esbuild/i18n-inliner.js index d0c2dcdc..b4e7b167 100644 --- a/src/tools/esbuild/i18n-inliner.js +++ b/src/tools/esbuild/i18n-inliner.js @@ -6,12 +6,47 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.I18nInliner = void 0; const node_assert_1 = __importDefault(require("node:assert")); +const node_crypto_1 = require("node:crypto"); +const node_path_1 = require("node:path"); const worker_pool_1 = require("../../utils/worker-pool"); const bundler_context_1 = require("./bundler-context"); const utils_1 = require("./utils"); @@ -27,37 +62,37 @@ const LOCALIZE_KEYWORD = '$localize'; * localize function (`$localize`). */ class I18nInliner { + options; + #cacheInitFailed = false; #workerPool; + #cache; #localizeFiles; #unmodifiedFiles; - #fileToType = new Map(); constructor(options, maxThreads) { + this.options = options; this.#unmodifiedFiles = []; + const { outputFiles, shouldOptimize, missingTranslation } = options; const files = new Map(); const pendingMaps = []; - for (const file of options.outputFiles) { + for (const file of outputFiles) { if (file.type === bundler_context_1.BuildOutputFileType.Root || file.type === bundler_context_1.BuildOutputFileType.ServerRoot) { // Skip also the server entry-point. // Skip stats and similar files. continue; } - this.#fileToType.set(file.path, file.type); - if (file.path.endsWith('.js') || file.path.endsWith('.mjs')) { + const fileExtension = (0, node_path_1.extname)(file.path); + if (fileExtension === '.js' || fileExtension === '.mjs') { // Check if localizations are present const contentBuffer = Buffer.isBuffer(file.contents) ? file.contents : Buffer.from(file.contents.buffer, file.contents.byteOffset, file.contents.byteLength); const hasLocalize = contentBuffer.includes(LOCALIZE_KEYWORD); if (hasLocalize) { - // A Blob is an immutable data structure that allows sharing the data between workers - // without copying until the data is actually used within a Worker. This is useful here - // since each file may not actually be processed in each Worker and the Blob avoids - // unneeded repeat copying of potentially large JavaScript files. - files.set(file.path, new Blob([file.contents])); + files.set(file.path, file); continue; } } - else if (file.path.endsWith('.js.map')) { + else if (fileExtension === '.map') { // The related JS file may not have been checked yet. To ensure that map files are not // missed, store any pending map files and check them after all output files. pendingMaps.push(file); @@ -68,7 +103,7 @@ class I18nInliner { // Check if any pending map files should be processed by checking if the parent JS file is present for (const file of pendingMaps) { if (files.has(file.path.slice(0, -4))) { - files.set(file.path, new Blob([file.contents])); + files.set(file.path, file); } else { this.#unmodifiedFiles.push(file); @@ -80,9 +115,13 @@ class I18nInliner { maxThreads, // Extract options to ensure only the named options are serialized and sent to the worker workerData: { - missingTranslation: options.missingTranslation, - shouldOptimize: options.shouldOptimize, - files, + missingTranslation, + shouldOptimize, + // A Blob is an immutable data structure that allows sharing the data between workers + // without copying until the data is actually used within a Worker. This is useful here + // since each file may not actually be processed in each Worker and the Blob avoids + // unneeded repeat copying of potentially large JavaScript files. + files: new Map(Array.from(files, ([name, file]) => [name, new Blob([file.contents])])), }, }); } @@ -95,18 +134,41 @@ class I18nInliner { * @returns A promise that resolves to an array of OutputFiles representing a translated result. */ async inlineForLocale(locale, translation) { + await this.initCache(); + const { shouldOptimize, missingTranslation } = this.options; // Request inlining for each file that contains localize calls const requests = []; - for (const filename of this.#localizeFiles.keys()) { + let fileCacheKeyBase; + for (const [filename, file] of this.#localizeFiles) { + let cacheKey; if (filename.endsWith('.map')) { continue; } - const fileRequest = this.#workerPool.run({ - filename, - locale, - translation, + let cacheResultPromise = Promise.resolve(null); + if (this.#cache) { + fileCacheKeyBase ??= Buffer.from(JSON.stringify({ locale, translation, missingTranslation, shouldOptimize }), 'utf-8'); + // NOTE: If additional options are added, this may need to be updated. + // TODO: Consider xxhash or similar instead of SHA256 + cacheKey = (0, node_crypto_1.createHash)('sha256') + .update(file.hash) + .update(filename) + .update(fileCacheKeyBase) + .digest('hex'); + // Failure to get the value should not fail the transform + cacheResultPromise = this.#cache.get(cacheKey).catch(() => null); + } + const fileResult = cacheResultPromise.then(async (cachedResult) => { + if (cachedResult) { + return cachedResult; + } + const result = await this.#workerPool.run({ filename, locale, translation }); + if (this.#cache && cacheKey) { + // Failure to set the value should not fail the transform + await this.#cache.set(cacheKey, result).catch(() => { }); + } + return result; }); - requests.push(fileRequest); + requests.push(fileResult); } // Wait for all file requests to complete const rawResults = await Promise.all(requests); @@ -115,7 +177,7 @@ class I18nInliner { const warnings = []; const outputFiles = [ ...rawResults.flatMap(({ file, code, map, messages }) => { - const type = this.#fileToType.get(file); + const type = this.#localizeFiles.get(file)?.type; (0, node_assert_1.default)(type !== undefined, 'localized file should always have a type' + file); const resultFiles = [(0, utils_1.createOutputFile)(file, code, type)]; if (map) { @@ -146,5 +208,32 @@ class I18nInliner { close() { return this.#workerPool.destroy(); } + /** + * Initializes the cache for storing translated bundles. + * If the cache is already initialized, it does nothing. + * + * @returns A promise that resolves once the cache initialization process is complete. + */ + async initCache() { + if (this.#cache || this.#cacheInitFailed) { + return; + } + const { persistentCachePath } = this.options; + // Webcontainers currently do not support this persistent cache store. + if (!persistentCachePath || process.versions.webcontainer) { + return; + } + // Initialize a persistent cache for i18n transformations. + try { + const { LmbdCacheStore } = await Promise.resolve().then(() => __importStar(require('./lmdb-cache-store'))); + this.#cache = new LmbdCacheStore((0, node_path_1.join)(persistentCachePath, 'angular-i18n.db')); + } + catch { + this.#cacheInitFailed = true; + // eslint-disable-next-line no-console + console.warn('Unable to initialize JavaScript cache storage.\n' + + 'This will not affect the build output content but may result in slower builds.'); + } + } } exports.I18nInliner = I18nInliner; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 8bc09f11..6f68666f 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-36afdf5'; +const VERSION = '19.1.6+sha-d2e1c8e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index c69bb408..c0d048fa 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Feb 11 2025 16:33:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Feb 11 2025 19:30:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1c2c9acae2b4501898629dc8435e4bee0b72f86b Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 12 Feb 2025 09:53:00 +0000 Subject: [PATCH 79/91] df1d388 fix(@angular/build): configure Vite CORS option --- package.json | 10 +++++----- src/builders/dev-server/schema.d.ts | 8 ++++---- src/builders/dev-server/schema.json | 4 ++-- src/builders/dev-server/vite-server.js | 3 +++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 0811508c..6dc73c4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-d2e1c8e", + "version": "19.1.6+sha-df1d388", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#d2e1c8e", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d2e1c8e", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#df1d388", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#df1d388", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#d2e1c8e", + "@angular/ssr": "github:angular/angular-ssr-builds#df1d388", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#d2e1c8e", + "@angular/ssr": "github:angular/angular-ssr-builds#df1d388", "less": { "optional": true }, diff --git a/src/builders/dev-server/schema.d.ts b/src/builders/dev-server/schema.d.ts index 78828412..cb68a19f 100644 --- a/src/builders/dev-server/schema.d.ts +++ b/src/builders/dev-server/schema.d.ts @@ -3,8 +3,8 @@ */ export type Schema = { /** - * The hosts that can access the development server. This option sets the Vite option of the - * same name. For further details: + * The hosts that the development server will respond to. This option sets the Vite option + * of the same name. For further details: * https://vite.dev/config/server-options.html#server-allowedhosts */ allowedHosts?: AllowedHosts; @@ -86,8 +86,8 @@ export type Schema = { watch?: boolean; }; /** - * The hosts that can access the development server. This option sets the Vite option of the - * same name. For further details: + * The hosts that the development server will respond to. This option sets the Vite option + * of the same name. For further details: * https://vite.dev/config/server-options.html#server-allowedhosts */ export type AllowedHosts = string[] | boolean; diff --git a/src/builders/dev-server/schema.json b/src/builders/dev-server/schema.json index 3d5cf155..c36d8614 100644 --- a/src/builders/dev-server/schema.json +++ b/src/builders/dev-server/schema.json @@ -37,12 +37,12 @@ "description": "SSL certificate to use for serving HTTPS." }, "allowedHosts": { - "description": "The hosts that can access the development server. This option sets the Vite option of the same name. For further details: https://vite.dev/config/server-options.html#server-allowedhosts", + "description": "The hosts that the development server will respond to. This option sets the Vite option of the same name. For further details: https://vite.dev/config/server-options.html#server-allowedhosts", "default": [], "oneOf": [ { "type": "array", - "description": "List of hosts that are allowed to access the development server.", + "description": "A list of hosts that the development server will respond to.", "items": { "type": "string" } diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index a173c250..a6576e80 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -608,6 +608,9 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, ? (proxy ?? {}) : proxy, cors: { + // This will add the header `Access-Control-Allow-Origin: http://example.com`, + // where `http://example.com` is the requesting origin. + origin: true, // Allow preflight requests to be proxied. preflightContinue: true, }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6f68666f..ea1c243e 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-d2e1c8e'; +const VERSION = '19.1.6+sha-df1d388'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index c0d048fa..99188419 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Feb 11 2025 19:30:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Feb 12 2025 09:53:00 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From c2a8caed3864faa2f2c705e3f1415430cf8a09e2 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 12 Feb 2025 20:35:12 +0000 Subject: [PATCH 80/91] 90cf0f8 release: cut the v19.1.7 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6dc73c4b..d918de56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.6+sha-df1d388", + "version": "19.1.7+sha-90cf0f8", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#df1d388", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#df1d388", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#90cf0f8", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#90cf0f8", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#df1d388", + "@angular/ssr": "github:angular/angular-ssr-builds#90cf0f8", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#df1d388", + "@angular/ssr": "github:angular/angular-ssr-builds#90cf0f8", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ea1c243e..46b732a6 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.6+sha-df1d388'; +const VERSION = '19.1.7+sha-90cf0f8'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 99188419..d344ede7 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Feb 12 2025 09:53:00 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Feb 12 2025 20:35:12 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e188d77135ccbf4a39eb0980206179b5e52b442f Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 13 Feb 2025 15:17:53 +0000 Subject: [PATCH 81/91] 5c56cdb refactor(@angular/cli): handle undefined `ng add` collection name --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d918de56..c0670d02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-90cf0f8", + "version": "19.1.7+sha-5c56cdb", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#90cf0f8", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#90cf0f8", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#5c56cdb", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5c56cdb", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#90cf0f8", + "@angular/ssr": "github:angular/angular-ssr-builds#5c56cdb", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#90cf0f8", + "@angular/ssr": "github:angular/angular-ssr-builds#5c56cdb", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 46b732a6..d4863d8f 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-90cf0f8'; +const VERSION = '19.1.7+sha-5c56cdb'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index d344ede7..5a93359b 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Feb 12 2025 20:35:12 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Feb 13 2025 15:17:53 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From f8647b0a1148b5fbd13f5732f5b902ad5f4b742b Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 13 Feb 2025 20:48:10 +0000 Subject: [PATCH 82/91] ceba773 fix(@angular/cli): prefer installed package as fallback when listing package groups --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c0670d02..67b81ab9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-5c56cdb", + "version": "19.1.7+sha-ceba773", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#5c56cdb", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5c56cdb", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#ceba773", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ceba773", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#5c56cdb", + "@angular/ssr": "github:angular/angular-ssr-builds#ceba773", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#5c56cdb", + "@angular/ssr": "github:angular/angular-ssr-builds#ceba773", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d4863d8f..18e70c18 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-5c56cdb'; +const VERSION = '19.1.7+sha-ceba773'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 5a93359b..d1337a23 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Feb 13 2025 15:17:53 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Feb 13 2025 20:48:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From dea7f59e29aaeefe4108d924b7be559d68762b90 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 14 Feb 2025 12:29:58 +0000 Subject: [PATCH 83/91] a70c3dc test: reduce flakiness of `reuse-dep-optimization-cache` e2e test --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 67b81ab9..7f9b5bfd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-ceba773", + "version": "19.1.7+sha-a70c3dc", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#ceba773", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ceba773", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#a70c3dc", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a70c3dc", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#ceba773", + "@angular/ssr": "github:angular/angular-ssr-builds#a70c3dc", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#ceba773", + "@angular/ssr": "github:angular/angular-ssr-builds#a70c3dc", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 18e70c18..81dc9f1d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-ceba773'; +const VERSION = '19.1.7+sha-a70c3dc'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index d1337a23..71c444a1 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Feb 13 2025 20:48:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Feb 14 2025 12:29:58 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 377d13187b5f5715655f049dd93ce79e30da7ea6 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 14 Feb 2025 13:43:48 +0000 Subject: [PATCH 84/91] 2f60a24 fix(@angular/build): suppress asset missing warning for `/index.html` requests --- package.json | 10 +++++----- src/tools/vite/middlewares/html-fallback-middleware.js | 3 ++- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7f9b5bfd..41641049 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-a70c3dc", + "version": "19.1.7+sha-2f60a24", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#a70c3dc", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a70c3dc", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2f60a24", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2f60a24", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#a70c3dc", + "@angular/ssr": "github:angular/angular-ssr-builds#2f60a24", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#a70c3dc", + "@angular/ssr": "github:angular/angular-ssr-builds#2f60a24", "less": { "optional": true }, diff --git a/src/tools/vite/middlewares/html-fallback-middleware.js b/src/tools/vite/middlewares/html-fallback-middleware.js index cf697e5b..a2225bb2 100644 --- a/src/tools/vite/middlewares/html-fallback-middleware.js +++ b/src/tools/vite/middlewares/html-fallback-middleware.js @@ -20,7 +20,8 @@ function angularHtmlFallbackMiddleware(req, _res, next) { } if (req.url) { const mimeType = (0, utils_1.lookupMimeTypeFromRequest)(req.url); - if (mimeType === 'text/html' || mimeType === 'application/xhtml+xml') { + if ((mimeType === 'text/html' || mimeType === 'application/xhtml+xml') && + !/^\/index\.(?:csr\.)?html/.test(req.url)) { // eslint-disable-next-line no-console console.warn(`Request for HTML file "${req.url}" was received but no asset found. Asset may be missing from build.`); } diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 81dc9f1d..811fdf6e 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-a70c3dc'; +const VERSION = '19.1.7+sha-2f60a24'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 71c444a1..4e6cac96 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Feb 14 2025 12:29:58 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Feb 14 2025 13:43:48 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From a6ae287525d33c408917597b91a4a8382500e459 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 14 Feb 2025 15:42:43 +0000 Subject: [PATCH 85/91] c54b999 fix(@angular-devkit/build-angular): pass missing options to Karma esbuild builder --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 41641049..1362906f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-2f60a24", + "version": "19.1.7+sha-c54b999", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2f60a24", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2f60a24", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c54b999", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c54b999", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#2f60a24", + "@angular/ssr": "github:angular/angular-ssr-builds#c54b999", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#2f60a24", + "@angular/ssr": "github:angular/angular-ssr-builds#c54b999", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 811fdf6e..6bb3b773 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-2f60a24'; +const VERSION = '19.1.7+sha-c54b999'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 4e6cac96..4fae3abc 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Feb 14 2025 13:43:48 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Feb 14 2025 15:42:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From b3451aa9bf38b53ab2826d2a2d8c336debedc18c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 14 Feb 2025 19:20:10 +0000 Subject: [PATCH 86/91] 415c02e refactor: move builtin module imports to use node: prefix imports --- package.json | 10 +++++----- src/tools/esbuild/angular/compiler-plugin.js | 2 +- src/utils/error.js | 4 ++-- src/utils/load-translations.js | 6 +++--- src/utils/normalize-asset-patterns.js | 6 +++--- src/utils/normalize-cache.js | 2 +- .../esm-in-memory-loader/loader-hooks.js | 3 +-- src/utils/server-rendering/render-worker.js | 4 ++-- src/utils/server-rendering/routes-extractor-worker.js | 4 ++-- src/utils/service-worker.js | 4 ++-- uniqueId | 2 +- 11 files changed, 23 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 1362906f..fa4a1882 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-c54b999", + "version": "19.1.7+sha-415c02e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c54b999", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c54b999", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#415c02e", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#415c02e", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#c54b999", + "@angular/ssr": "github:angular/angular-ssr-builds#415c02e", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#c54b999", + "@angular/ssr": "github:angular/angular-ssr-builds#415c02e", "less": { "optional": true }, diff --git a/src/tools/esbuild/angular/compiler-plugin.js b/src/tools/esbuild/angular/compiler-plugin.js index 0af0f275..9e35394f 100644 --- a/src/tools/esbuild/angular/compiler-plugin.js +++ b/src/tools/esbuild/angular/compiler-plugin.js @@ -402,7 +402,7 @@ function createCompilerPlugin(pluginOptions, compilationOrFactory, stylesheetBun const replacement = pluginOptions.fileReplacements?.[path.normalize(args.path)]; if (replacement) { return { - contents: await Promise.resolve().then(() => __importStar(require('fs/promises'))).then(({ readFile }) => readFile(path.normalize(replacement))), + contents: await Promise.resolve().then(() => __importStar(require('node:fs/promises'))).then(({ readFile }) => readFile(path.normalize(replacement))), loader: 'json', watchFiles: [replacement], }; diff --git a/src/utils/error.js b/src/utils/error.js index 61d1b55a..7e103212 100644 --- a/src/utils/error.js +++ b/src/utils/error.js @@ -11,10 +11,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertIsError = assertIsError; -const assert_1 = __importDefault(require("assert")); +const node_assert_1 = __importDefault(require("node:assert")); function assertIsError(value) { const isError = value instanceof Error || // The following is needing to identify errors coming from RxJs. (typeof value === 'object' && value && 'name' in value && 'message' in value); - (0, assert_1.default)(isError, 'catch clause variable is not an Error instance'); + (0, node_assert_1.default)(isError, 'catch clause variable is not an Error instance'); } diff --git a/src/utils/load-translations.js b/src/utils/load-translations.js index 84ee06d7..dc5e605c 100644 --- a/src/utils/load-translations.js +++ b/src/utils/load-translations.js @@ -41,8 +41,8 @@ var __importStar = (this && this.__importStar) || (function () { })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.createTranslationLoader = createTranslationLoader; -const crypto_1 = require("crypto"); -const fs = __importStar(require("fs")); +const node_crypto_1 = require("node:crypto"); +const fs = __importStar(require("node:fs")); const load_esm_1 = require("./load-esm"); async function createTranslationLoader() { const { parsers, diagnostics } = await importParsers(); @@ -55,7 +55,7 @@ async function createTranslationLoader() { // Types don't overlap here so we need to use any. // eslint-disable-next-line @typescript-eslint/no-explicit-any const { locale, translations } = parser.parse(path, content, analysis.hint); - const integrity = 'sha256-' + (0, crypto_1.createHash)('sha256').update(content).digest('base64'); + const integrity = 'sha256-' + (0, node_crypto_1.createHash)('sha256').update(content).digest('base64'); return { format, locale, translations, diagnostics, integrity }; } else { diff --git a/src/utils/normalize-asset-patterns.js b/src/utils/normalize-asset-patterns.js index 5fe6f293..c7716c44 100644 --- a/src/utils/normalize-asset-patterns.js +++ b/src/utils/normalize-asset-patterns.js @@ -45,9 +45,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.MissingAssetSourceRootException = void 0; exports.normalizeAssetPatterns = normalizeAssetPatterns; -const fs_1 = require("fs"); const node_assert_1 = __importDefault(require("node:assert")); -const path = __importStar(require("path")); +const node_fs_1 = require("node:fs"); +const path = __importStar(require("node:path")); class MissingAssetSourceRootException extends Error { constructor(path) { super(`The ${path} asset path must start with the project source root.`); @@ -73,7 +73,7 @@ function normalizeAssetPatterns(assetPatterns, workspaceRoot, projectRoot, proje let glob, input; let isDirectory = false; try { - isDirectory = (0, fs_1.statSync)(resolvedAssetPath).isDirectory(); + isDirectory = (0, node_fs_1.statSync)(resolvedAssetPath).isDirectory(); } catch { isDirectory = true; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6bb3b773..392abeb1 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-c54b999'; +const VERSION = '19.1.7+sha-415c02e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js b/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js index 6f43298c..33caae9d 100644 --- a/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js +++ b/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js @@ -17,7 +17,6 @@ const node_assert_1 = __importDefault(require("node:assert")); const node_crypto_1 = require("node:crypto"); const node_path_1 = require("node:path"); const node_url_1 = require("node:url"); -const url_1 = require("url"); const javascript_transformer_1 = require("../../../tools/esbuild/javascript-transformer"); /** * @note For some unknown reason, setting `globalThis.ngServerMode = true` does not work when using ESM loader hooks. @@ -110,7 +109,7 @@ async function load(url, context, nextLoad) { // Only module files potentially require transformation. Angular libraries that would // need linking are ESM only. if (format === 'module' && isFileProtocol(url)) { - const filePath = (0, url_1.fileURLToPath)(url); + const filePath = (0, node_url_1.fileURLToPath)(url); let source = await javascriptTransformer.transformFile(filePath); if (filePath.includes('@angular/')) { // Prepend 'var ngServerMode=true;' to the source. diff --git a/src/utils/server-rendering/render-worker.js b/src/utils/server-rendering/render-worker.js index 13153b7d..6f5b1835 100644 --- a/src/utils/server-rendering/render-worker.js +++ b/src/utils/server-rendering/render-worker.js @@ -7,14 +7,14 @@ * found in the LICENSE file at https://angular.dev/license */ Object.defineProperty(exports, "__esModule", { value: true }); -const worker_threads_1 = require("worker_threads"); +const node_worker_threads_1 = require("node:worker_threads"); const fetch_patch_1 = require("./fetch-patch"); const launch_server_1 = require("./launch-server"); const load_esm_from_memory_1 = require("./load-esm-from-memory"); /** * This is passed as workerData when setting up the worker via the `piscina` package. */ -const { outputMode, hasSsrEntry } = worker_threads_1.workerData; +const { outputMode, hasSsrEntry } = node_worker_threads_1.workerData; let serverURL = launch_server_1.DEFAULT_URL; /** * Renders each route in routes and writes them to //index.html. diff --git a/src/utils/server-rendering/routes-extractor-worker.js b/src/utils/server-rendering/routes-extractor-worker.js index 54db931a..b855aa05 100644 --- a/src/utils/server-rendering/routes-extractor-worker.js +++ b/src/utils/server-rendering/routes-extractor-worker.js @@ -7,7 +7,7 @@ * found in the LICENSE file at https://angular.dev/license */ Object.defineProperty(exports, "__esModule", { value: true }); -const worker_threads_1 = require("worker_threads"); +const node_worker_threads_1 = require("node:worker_threads"); const schema_1 = require("../../builders/application/schema"); const fetch_patch_1 = require("./fetch-patch"); const launch_server_1 = require("./launch-server"); @@ -15,7 +15,7 @@ const load_esm_from_memory_1 = require("./load-esm-from-memory"); /** * This is passed as workerData when setting up the worker via the `piscina` package. */ -const { outputMode, hasSsrEntry } = worker_threads_1.workerData; +const { outputMode, hasSsrEntry } = node_worker_threads_1.workerData; /** Renders an application based on a provided options. */ async function extractRoutes() { const serverURL = outputMode !== undefined && hasSsrEntry ? await (0, launch_server_1.launchServer)() : launch_server_1.DEFAULT_URL; diff --git a/src/utils/service-worker.js b/src/utils/service-worker.js index ce7e439f..212b7779 100644 --- a/src/utils/service-worker.js +++ b/src/utils/service-worker.js @@ -43,9 +43,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.augmentAppWithServiceWorker = augmentAppWithServiceWorker; exports.augmentAppWithServiceWorkerEsbuild = augmentAppWithServiceWorkerEsbuild; exports.augmentAppWithServiceWorkerCore = augmentAppWithServiceWorkerCore; -const crypto = __importStar(require("crypto")); +const crypto = __importStar(require("node:crypto")); const node_fs_1 = require("node:fs"); -const path = __importStar(require("path")); +const path = __importStar(require("node:path")); const bundler_context_1 = require("../tools/esbuild/bundler-context"); const error_1 = require("./error"); const load_esm_1 = require("./load-esm"); diff --git a/uniqueId b/uniqueId index 4fae3abc..913e9a16 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Feb 14 2025 15:42:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Feb 14 2025 19:20:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From c88e1e26871217f9b9fc066b54c933041d308738 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 14 Feb 2025 22:05:23 +0000 Subject: [PATCH 87/91] b8f7952 fix(@angular/build): update critical CSS inlining to support `autoCsp` --- package.json | 10 +++++----- src/builders/application/execute-build.js | 4 ---- src/builders/application/options.d.ts | 6 +++++- src/builders/application/options.js | 10 +++++++++- src/builders/dev-server/vite-server.js | 4 ++++ src/tools/esbuild/index-html-generator.js | 9 +-------- src/utils/index-file/auto-csp.js | 2 +- src/utils/index-file/index-html-generator.js | 5 +++-- src/utils/index-file/inline-critical-css.d.ts | 1 + src/utils/index-file/inline-critical-css.js | 18 +++++++++++------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 12 files changed, 42 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index fa4a1882..d7edb285 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-415c02e", + "version": "19.1.7+sha-b8f7952", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#415c02e", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#415c02e", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#b8f7952", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#b8f7952", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#415c02e", + "@angular/ssr": "github:angular/angular-ssr-builds#b8f7952", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#415c02e", + "@angular/ssr": "github:angular/angular-ssr-builds#b8f7952", "less": { "optional": true }, diff --git a/src/builders/application/execute-build.js b/src/builders/application/execute-build.js index 3605a044..1c1d7526 100644 --- a/src/builders/application/execute-build.js +++ b/src/builders/application/execute-build.js @@ -190,10 +190,6 @@ async function executeBuild(options, context, rebuildState) { if (serverEntryPoint) { executionResult.addOutputFile(manifest_1.SERVER_APP_ENGINE_MANIFEST_FILENAME, (0, manifest_1.generateAngularServerAppEngineManifest)(i18nOptions, baseHref), bundler_context_1.BuildOutputFileType.ServerRoot); } - // Override auto-CSP settings if we are serving through Vite middleware. - if (context.builder.builderName === 'dev-server' && options.security) { - options.security.autoCsp = false; - } // Perform i18n translation inlining if enabled if (i18nOptions.shouldInline) { const result = await (0, i18n_1.inlineI18n)(metafile, options, executionResult, initialFiles); diff --git a/src/builders/application/options.d.ts b/src/builders/application/options.d.ts index 6ad2ab01..ed7e118f 100644 --- a/src/builders/application/options.d.ts +++ b/src/builders/application/options.d.ts @@ -196,7 +196,11 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s partialSSRBuild: boolean; externalRuntimeStyles: boolean | undefined; instrumentForCoverage: ((filename: string) => boolean) | undefined; - security: import("./schema").Security | undefined; + security: { + autoCsp: { + unsafeEval: boolean; + } | undefined; + }; templateUpdates: boolean; incrementalResults: boolean; }>; diff --git a/src/builders/application/options.js b/src/builders/application/options.js index d12be328..06d26f11 100644 --- a/src/builders/application/options.js +++ b/src/builders/application/options.js @@ -236,8 +236,16 @@ async function normalizeOptions(context, projectName, options, extensions) { throw new Error('The "index" option cannot be set to false when enabling "ssr", "prerender" or "app-shell".'); } } + const autoCsp = options.security?.autoCsp; + const security = { + autoCsp: autoCsp + ? { + unsafeEval: autoCsp === true ? false : !!autoCsp.unsafeEval, + } + : undefined, + }; // Initial options to keep - const { allowedCommonJsDependencies, aot = true, baseHref, crossOrigin, externalDependencies, extractLicenses, inlineStyleLanguage = 'css', outExtension, serviceWorker, poll, polyfills, statsJson, outputMode, stylePreprocessorOptions, subresourceIntegrity, verbose, watch, progress = true, externalPackages, namedChunks, budgets, deployUrl, clearScreen, define, partialSSRBuild = false, externalRuntimeStyles, instrumentForCoverage, security, } = options; + const { allowedCommonJsDependencies, aot = true, baseHref, crossOrigin, externalDependencies, extractLicenses, inlineStyleLanguage = 'css', outExtension, serviceWorker, poll, polyfills, statsJson, outputMode, stylePreprocessorOptions, subresourceIntegrity, verbose, watch, progress = true, externalPackages, namedChunks, budgets, deployUrl, clearScreen, define, partialSSRBuild = false, externalRuntimeStyles, instrumentForCoverage, } = options; // Return all the normalized options return { advancedOptimizations: !!aot && optimizationOptions.scripts, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index a6576e80..d3676fdc 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -82,6 +82,10 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context browserOptions.prerender = undefined; browserOptions.ssr ||= true; } + // Disable auto CSP. + browserOptions.security = { + autoCsp: false, + }; // Set all packages as external to support Vite's prebundle caching browserOptions.externalPackages = serverOptions.prebundle; // Disable generating a full manifest with routes. diff --git a/src/tools/esbuild/index-html-generator.js b/src/tools/esbuild/index-html-generator.js index 6a82406c..d37f6ad1 100644 --- a/src/tools/esbuild/index-html-generator.js +++ b/src/tools/esbuild/index-html-generator.js @@ -59,13 +59,6 @@ async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang) } throw new Error(`Output file does not exist: ${relativefilePath}`); }; - // Read the Auto CSP options. - const autoCsp = buildOptions.security?.autoCsp; - const autoCspOptions = autoCsp === true - ? { unsafeEval: false } - : autoCsp - ? { unsafeEval: !!autoCsp.unsafeEval } - : undefined; // Create an index HTML generator that reads from the in-memory output files const indexHtmlGenerator = new index_html_generator_1.IndexHtmlGenerator({ indexPath: indexHtmlOptions.input, @@ -78,7 +71,7 @@ async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang) generateDedicatedSSRContent: !!(buildOptions.ssrOptions || buildOptions.prerenderOptions || buildOptions.appShellOptions), - autoCsp: autoCspOptions, + autoCsp: buildOptions.security.autoCsp, }); indexHtmlGenerator.readAsset = readAsset; return indexHtmlGenerator.process({ diff --git a/src/utils/index-file/auto-csp.js b/src/utils/index-file/auto-csp.js index a6fb6aed..822aad22 100644 --- a/src/utils/index-file/auto-csp.js +++ b/src/utils/index-file/auto-csp.js @@ -112,7 +112,7 @@ async function autoCsp(html, unsafeEval = false) { rewriter.emitRaw(``); scriptContent = []; } - rewriter.on('startTag', (tag, html) => { + rewriter.on('startTag', (tag) => { if (tag.tagName === 'script') { openedScriptTag = tag; const src = getScriptAttributeValue(tag, 'src'); diff --git a/src/utils/index-file/index-html-generator.js b/src/utils/index-file/index-html-generator.js index dcaec3ec..d2e05419 100644 --- a/src/utils/index-file/index-html-generator.js +++ b/src/utils/index-file/index-html-generator.js @@ -32,7 +32,7 @@ class IndexHtmlGenerator { this.plugins = [augmentIndexHtmlPlugin(this), ...extraCommonPlugins, postTransformPlugin(this)]; // CSR plugins if (options?.optimization?.styles?.inlineCritical) { - this.csrPlugins.push(inlineCriticalCssPlugin(this)); + this.csrPlugins.push(inlineCriticalCssPlugin(this, !!options.autoCsp)); } this.csrPlugins.push(addNoncePlugin()); // SSR plugins @@ -127,11 +127,12 @@ function inlineFontsPlugin({ options }) { }); return async (html) => inlineFontsProcessor.process(html); } -function inlineCriticalCssPlugin(generator) { +function inlineCriticalCssPlugin(generator, autoCsp) { const inlineCriticalCssProcessor = new inline_critical_css_1.InlineCriticalCssProcessor({ minify: generator.options.optimization?.styles.minify, deployUrl: generator.options.deployUrl, readAsset: (filePath) => generator.readAsset(filePath), + autoCsp, }); return async (html, options) => inlineCriticalCssProcessor.process(html, { outputPath: options.outputPath }); } diff --git a/src/utils/index-file/inline-critical-css.d.ts b/src/utils/index-file/inline-critical-css.d.ts index 4fa9fba8..2b43e715 100644 --- a/src/utils/index-file/inline-critical-css.d.ts +++ b/src/utils/index-file/inline-critical-css.d.ts @@ -12,6 +12,7 @@ export interface InlineCriticalCssProcessorOptions { minify?: boolean; deployUrl?: string; readAsset?: (path: string) => Promise; + autoCsp?: boolean; } export declare class InlineCriticalCssProcessor { protected readonly options: InlineCriticalCssProcessorOptions; diff --git a/src/utils/index-file/inline-critical-css.js b/src/utils/index-file/inline-critical-css.js index db993337..d0d8c9e2 100644 --- a/src/utils/index-file/inline-critical-css.js +++ b/src/utils/index-file/inline-critical-css.js @@ -113,7 +113,7 @@ class BeastiesExtended extends BeastiesBase { } const returnValue = await super.embedLinkedStylesheet(link, document); const cspNonce = this.findCspNonce(document); - if (cspNonce) { + if (cspNonce || this.optionsExtended.autoCsp) { const beastiesMedia = link.getAttribute('onload')?.match(MEDIA_SET_HANDLER_PATTERN); if (beastiesMedia) { // If there's a Beasties-generated `onload` handler and the file has an Angular CSP nonce, @@ -128,11 +128,13 @@ class BeastiesExtended extends BeastiesBase { // a way of doing that at the moment so we fall back to doing it any time a `link` tag is // inserted. We mitigate it by only iterating the direct children of the `` which // should be pretty shallow. - document.head.children.forEach((child) => { - if (child.tagName === 'style' && !child.hasAttribute('nonce')) { - child.setAttribute('nonce', cspNonce); - } - }); + if (cspNonce) { + document.head.children.forEach((child) => { + if (child.tagName === 'style' && !child.hasAttribute('nonce')) { + child.setAttribute('nonce', cspNonce); + } + }); + } } return returnValue; } @@ -159,8 +161,10 @@ class BeastiesExtended extends BeastiesBase { return; } const script = document.createElement('script'); - script.setAttribute('nonce', nonce); script.textContent = LINK_LOAD_SCRIPT_CONTENT; + if (nonce) { + script.setAttribute('nonce', nonce); + } // Prepend the script to the head since it needs to // run as early as possible, before the `link` tags. document.head.insertBefore(script, link); diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 392abeb1..d501ed00 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-415c02e'; +const VERSION = '19.1.7+sha-b8f7952'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 913e9a16..67341c45 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Feb 14 2025 19:20:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Feb 14 2025 22:05:23 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From a692aee76aa459d3214cbd11f90935d912dd54db Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 19 Feb 2025 18:23:40 +0000 Subject: [PATCH 88/91] c2cbc0f build: add @types/node to assorted locations where node types are being relied on and currently obtained transitively. --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d7edb285..ba291b3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-b8f7952", + "version": "19.1.7+sha-c2cbc0f", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#b8f7952", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#b8f7952", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c2cbc0f", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c2cbc0f", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#b8f7952", + "@angular/ssr": "github:angular/angular-ssr-builds#c2cbc0f", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#b8f7952", + "@angular/ssr": "github:angular/angular-ssr-builds#c2cbc0f", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d501ed00..0bbd931f 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-b8f7952'; +const VERSION = '19.1.7+sha-c2cbc0f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 67341c45..3285cb87 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Feb 14 2025 22:05:23 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Feb 19 2025 18:23:40 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1334d6e8566c6da353fb5a96f6602b1c4a714734 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 19 Feb 2025 20:30:16 +0000 Subject: [PATCH 89/91] 6020803 build: disable failing strict_deps targets --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ba291b3c..e004be2d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.7+sha-c2cbc0f", + "version": "19.1.8+sha-6020803", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c2cbc0f", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c2cbc0f", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#6020803", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6020803", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#c2cbc0f", + "@angular/ssr": "github:angular/angular-ssr-builds#6020803", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#c2cbc0f", + "@angular/ssr": "github:angular/angular-ssr-builds#6020803", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 0bbd931f..c65b277b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.7+sha-c2cbc0f'; +const VERSION = '19.1.8+sha-6020803'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 3285cb87..028eec1c 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Feb 19 2025 18:23:40 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Feb 19 2025 20:30:16 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From aa688f2eb0ac1dc3e7159813332d3d9140bb2728 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 25 Feb 2025 18:29:51 +0000 Subject: [PATCH 90/91] 2d361e9 fix(@angular/build): always disable JSON stats with dev-server --- package.json | 10 +++++----- src/builders/dev-server/vite-server.js | 7 +++++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e004be2d..6f1debc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.8+sha-6020803", + "version": "19.1.8+sha-2d361e9", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#6020803", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6020803", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2d361e9", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2d361e9", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#6020803", + "@angular/ssr": "github:angular/angular-ssr-builds#2d361e9", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#6020803", + "@angular/ssr": "github:angular/angular-ssr-builds#2d361e9", "less": { "optional": true }, diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index d3676fdc..09f6e661 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -86,6 +86,13 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context browserOptions.security = { autoCsp: false, }; + // Disable JSON build stats. + // These are not accessible with the dev server and can cause HMR fallbacks. + if (browserOptions.statsJson === true) { + context.logger.warn('Build JSON statistics output (`statsJson` option) has been disabled.' + + ' The development server does not support this option.'); + } + browserOptions.statsJson = false; // Set all packages as external to support Vite's prebundle caching browserOptions.externalPackages = serverOptions.prebundle; // Disable generating a full manifest with routes. diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c65b277b..a745bd2a 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.8+sha-6020803'; +const VERSION = '19.1.8+sha-2d361e9'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 028eec1c..db1f048c 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Feb 19 2025 20:30:16 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Feb 25 2025 18:29:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 24652cf772394d75f63af229b241323aa4848bf5 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 26 Feb 2025 22:02:32 +0000 Subject: [PATCH 91/91] d7747ed release: cut the v19.1.9 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6f1debc1..0ebb4d52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "19.1.8+sha-2d361e9", + "version": "19.1.9+sha-d7747ed", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -23,8 +23,8 @@ "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2d361e9", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2d361e9", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#d7747ed", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d7747ed", "@babel/core": "7.26.0", "@babel/helper-annotate-as-pure": "7.25.9", "@babel/helper-split-export-declaration": "7.24.7", @@ -58,7 +58,7 @@ "@angular/localize": "^19.0.0", "@angular/platform-server": "^19.0.0", "@angular/service-worker": "^19.0.0", - "@angular/ssr": "github:angular/angular-ssr-builds#2d361e9", + "@angular/ssr": "github:angular/angular-ssr-builds#d7747ed", "less": "^4.2.0", "ng-packagr": "^19.0.0", "postcss": "^8.4.0", @@ -75,7 +75,7 @@ "@angular/service-worker": { "optional": true }, - "@angular/ssr": "github:angular/angular-ssr-builds#2d361e9", + "@angular/ssr": "github:angular/angular-ssr-builds#d7747ed", "less": { "optional": true }, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a745bd2a..72fdabfc 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '19.1.8+sha-2d361e9'; +const VERSION = '19.1.9+sha-d7747ed'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index db1f048c..c5a409b6 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Feb 25 2025 18:29:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Feb 26 2025 22:02:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file