@angular/build 22.3.0-next.0 → 22.3.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/builders/application/chunk-optimizer.js +2 -1
- package/src/builders/application/chunk-optimizer.js.map +1 -1
- package/src/builders/application/options.js +1 -2
- package/src/builders/application/options.js.map +1 -1
- package/src/builders/dev-server/options.js +1 -1
- package/src/builders/dev-server/options.js.map +1 -1
- package/src/builders/dev-server/vite/server.js +1 -1
- package/src/builders/dev-server/vite/server.js.map +1 -1
- package/src/builders/library/builder.js +22 -16
- package/src/builders/library/builder.js.map +1 -1
- package/src/builders/library/options.js +2 -11
- package/src/builders/library/options.js.map +1 -1
- package/src/builders/library/pipeline/assets.d.ts +2 -13
- package/src/builders/library/pipeline/assets.js +4 -43
- package/src/builders/library/pipeline/assets.js.map +1 -1
- package/src/builders/library/pipeline/build-action.d.ts +25 -4
- package/src/builders/library/pipeline/build-action.js +8 -7
- package/src/builders/library/pipeline/build-action.js.map +1 -1
- package/src/builders/library/pipeline/bundler.d.ts +2 -0
- package/src/builders/library/pipeline/bundler.js +74 -16
- package/src/builders/library/pipeline/bundler.js.map +1 -1
- package/src/builders/library/pipeline/entry-points.d.ts +1 -1
- package/src/builders/library/pipeline/entry-points.js +2 -2
- package/src/builders/library/pipeline/entry-points.js.map +1 -1
- package/src/builders/ng-packagr/builder.js +2 -2
- package/src/builders/ng-packagr/builder.js.map +1 -1
- package/src/builders/unit-test/builder.js +1 -1
- package/src/builders/unit-test/builder.js.map +1 -1
- package/src/builders/unit-test/options.js +1 -2
- package/src/builders/unit-test/options.js.map +1 -1
- package/src/utils/load-proxy-config.js +12 -10
- package/src/utils/load-proxy-config.js.map +1 -1
- package/src/utils/load-rolldown.d.ts +27 -0
- package/src/utils/load-rolldown.js +79 -0
- package/src/utils/load-rolldown.js.map +1 -0
- package/src/utils/normalize-cache.d.ts +14 -1
- package/src/utils/normalize-cache.js +18 -4
- package/src/utils/normalize-cache.js.map +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Dynamically loads the `rolldown` module while configuring its embedded
|
|
10
|
+
* mimalloc v3 allocator to immediately purge freed arena memory.
|
|
11
|
+
*
|
|
12
|
+
* Rolldown's native binding statically links mimalloc v3, which defaults to a
|
|
13
|
+
* 4-second arena purge delay (`MIMALLOC_PURGE_DELAY=1000` * `MIMALLOC_ARENA_PURGE_MULT=4`)
|
|
14
|
+
* and only triggers purges cooperatively during subsequent allocations. In single-run
|
|
15
|
+
* CLI builds where Rolldown is not invoked again after bundling completes, non-zero
|
|
16
|
+
* purge delays prevent freed arena pages from being decommitted back to the OS,
|
|
17
|
+
* leading to high peak RSS during post-bundle stages.
|
|
18
|
+
*
|
|
19
|
+
* Because mimalloc reads and caches environment options synchronously when the native
|
|
20
|
+
* `.node` addon is first loaded (`mi_process_init` -> `_mi_options_init`), temporarily
|
|
21
|
+
* setting `MIMALLOC_PURGE_DELAY=0` during the initial `import('rolldown')` call
|
|
22
|
+
* configures Rolldown's allocator without leaving the environment variable set for
|
|
23
|
+
* subsequent code or child processes.
|
|
24
|
+
*
|
|
25
|
+
* @returns A promise that resolves to the `rolldown` module namespace.
|
|
26
|
+
*/
|
|
27
|
+
export declare function loadRolldown(): Promise<typeof import('rolldown')>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.loadRolldown = loadRolldown;
|
|
44
|
+
const MIMALLOC_PURGE_DELAY = 'MIMALLOC_PURGE_DELAY';
|
|
45
|
+
let rolldownPromise;
|
|
46
|
+
/**
|
|
47
|
+
* Dynamically loads the `rolldown` module while configuring its embedded
|
|
48
|
+
* mimalloc v3 allocator to immediately purge freed arena memory.
|
|
49
|
+
*
|
|
50
|
+
* Rolldown's native binding statically links mimalloc v3, which defaults to a
|
|
51
|
+
* 4-second arena purge delay (`MIMALLOC_PURGE_DELAY=1000` * `MIMALLOC_ARENA_PURGE_MULT=4`)
|
|
52
|
+
* and only triggers purges cooperatively during subsequent allocations. In single-run
|
|
53
|
+
* CLI builds where Rolldown is not invoked again after bundling completes, non-zero
|
|
54
|
+
* purge delays prevent freed arena pages from being decommitted back to the OS,
|
|
55
|
+
* leading to high peak RSS during post-bundle stages.
|
|
56
|
+
*
|
|
57
|
+
* Because mimalloc reads and caches environment options synchronously when the native
|
|
58
|
+
* `.node` addon is first loaded (`mi_process_init` -> `_mi_options_init`), temporarily
|
|
59
|
+
* setting `MIMALLOC_PURGE_DELAY=0` during the initial `import('rolldown')` call
|
|
60
|
+
* configures Rolldown's allocator without leaving the environment variable set for
|
|
61
|
+
* subsequent code or child processes.
|
|
62
|
+
*
|
|
63
|
+
* @returns A promise that resolves to the `rolldown` module namespace.
|
|
64
|
+
*/
|
|
65
|
+
function loadRolldown() {
|
|
66
|
+
if (!rolldownPromise) {
|
|
67
|
+
const hasCustomPurgeDelay = Object.hasOwn(process.env, MIMALLOC_PURGE_DELAY);
|
|
68
|
+
if (!hasCustomPurgeDelay) {
|
|
69
|
+
process.env[MIMALLOC_PURGE_DELAY] = '0';
|
|
70
|
+
}
|
|
71
|
+
rolldownPromise = Promise.resolve().then(() => __importStar(require('rolldown'))).finally(() => {
|
|
72
|
+
if (!hasCustomPurgeDelay) {
|
|
73
|
+
delete process.env[MIMALLOC_PURGE_DELAY];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return rolldownPromise;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=load-rolldown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-rolldown.js","sourceRoot":"","sources":["load-rolldown.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBH,oCAeC;AAtCD,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAEpD,IAAI,eAA+D,CAAC;AAEpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,YAAY;IAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;QAC7E,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,GAAG,CAAC;QAC1C,CAAC;QAED,eAAe,GAAG,kDAAO,UAAU,IAAE,OAAO,CAAC,GAAG,EAAE;YAChD,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBACzB,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -23,4 +23,17 @@ export interface NormalizedCachedOptions {
|
|
|
23
23
|
*/
|
|
24
24
|
localBasePath?: string;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Normalizes the persistent disk cache configuration for a project or workspace.
|
|
28
|
+
*
|
|
29
|
+
* Resolves whether disk caching is enabled based on the CLI cache metadata, current runtime
|
|
30
|
+
* environment (local vs. CI, or WebContainers), and computes the versioned cache directory paths
|
|
31
|
+
* (resolving shared Git worktree paths when applicable).
|
|
32
|
+
*
|
|
33
|
+
* @param projectMetadata The project or workspace metadata object containing optional `cli.cache` settings.
|
|
34
|
+
* @param workspaceRoot The absolute path to the workspace root directory.
|
|
35
|
+
* @param projectName Optional name of the project used to scope the resolved cache path.
|
|
36
|
+
* @param builderName Optional name of the builder or tool used to further scope the resolved cache path.
|
|
37
|
+
* @returns The normalized disk cache options including enabled state and resolved directory paths.
|
|
38
|
+
*/
|
|
39
|
+
export declare function normalizeCacheOptions(projectMetadata: unknown, workspaceRoot: string, projectName?: string, builderName?: string): NormalizedCachedOptions;
|
|
@@ -11,7 +11,7 @@ exports.normalizeCacheOptions = normalizeCacheOptions;
|
|
|
11
11
|
const node_fs_1 = require("node:fs");
|
|
12
12
|
const node_path_1 = require("node:path");
|
|
13
13
|
/** Version placeholder is replaced during the build process with actual package version */
|
|
14
|
-
const VERSION = '22.3.0-next.
|
|
14
|
+
const VERSION = '22.3.0-next.1';
|
|
15
15
|
function hasCacheMetadata(value) {
|
|
16
16
|
return (!!value &&
|
|
17
17
|
typeof value === 'object' &&
|
|
@@ -62,7 +62,20 @@ function getCacheBasePath(workspaceRoot, cachePathSetting) {
|
|
|
62
62
|
catch { }
|
|
63
63
|
return (0, node_path_1.resolve)(workspaceRoot, cachePathSetting);
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Normalizes the persistent disk cache configuration for a project or workspace.
|
|
67
|
+
*
|
|
68
|
+
* Resolves whether disk caching is enabled based on the CLI cache metadata, current runtime
|
|
69
|
+
* environment (local vs. CI, or WebContainers), and computes the versioned cache directory paths
|
|
70
|
+
* (resolving shared Git worktree paths when applicable).
|
|
71
|
+
*
|
|
72
|
+
* @param projectMetadata The project or workspace metadata object containing optional `cli.cache` settings.
|
|
73
|
+
* @param workspaceRoot The absolute path to the workspace root directory.
|
|
74
|
+
* @param projectName Optional name of the project used to scope the resolved cache path.
|
|
75
|
+
* @param builderName Optional name of the builder or tool used to further scope the resolved cache path.
|
|
76
|
+
* @returns The normalized disk cache options including enabled state and resolved directory paths.
|
|
77
|
+
*/
|
|
78
|
+
function normalizeCacheOptions(projectMetadata, workspaceRoot, projectName = '', builderName = '') {
|
|
66
79
|
const cacheMetadata = hasCacheMetadata(projectMetadata) ? projectMetadata.cli.cache : {};
|
|
67
80
|
const {
|
|
68
81
|
// Webcontainers do not currently benefit from persistent disk caching and can lead to increased browser memory usage
|
|
@@ -81,12 +94,13 @@ function normalizeCacheOptions(projectMetadata, workspaceRoot) {
|
|
|
81
94
|
}
|
|
82
95
|
const cacheBasePath = getCacheBasePath(workspaceRoot, path);
|
|
83
96
|
const localCacheBasePath = (0, node_path_1.isAbsolute)(path) ? path : (0, node_path_1.resolve)(workspaceRoot, path);
|
|
97
|
+
const normalizedBuilderName = builderName.replaceAll(':', '-');
|
|
84
98
|
return {
|
|
85
99
|
enabled: cacheEnabled,
|
|
86
100
|
basePath: cacheBasePath,
|
|
87
|
-
path: (0, node_path_1.join)(cacheBasePath, VERSION),
|
|
101
|
+
path: (0, node_path_1.join)(cacheBasePath, VERSION, projectName, normalizedBuilderName),
|
|
88
102
|
localBasePath: localCacheBasePath,
|
|
89
|
-
localPath: (0, node_path_1.join)(localCacheBasePath, VERSION),
|
|
103
|
+
localPath: (0, node_path_1.join)(localCacheBasePath, VERSION, projectName, normalizedBuilderName),
|
|
90
104
|
};
|
|
91
105
|
}
|
|
92
106
|
//# sourceMappingURL=normalize-cache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-cache.js","sourceRoot":"","sources":["normalize-cache.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;
|
|
1
|
+
{"version":3,"file":"normalize-cache.js","sourceRoot":"","sources":["normalize-cache.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA0GH,sDAuCC;AA/ID,qCAA6D;AAC7D,yCAAyE;AAEzE,2FAA2F;AAC3F,MAAM,OAAO,GAAG,mBAAmB,CAAC;AA+BpC,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,CACL,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,IAAI,KAAK;QACd,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;QACd,OAAO,KAAK,CAAC,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