@angular/build 20.3.2 → 20.3.4
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 +5 -5
- package/src/builders/application/chunk-optimizer.js +3 -3
- package/src/tools/babel/plugins/pure-toplevel-functions.d.ts +0 -1
- package/src/tools/babel/plugins/pure-toplevel-functions.js +21 -5
- package/src/tools/esbuild/javascript-transformer-worker.js +2 -8
- package/src/utils/normalize-cache.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/build",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.4",
|
|
4
4
|
"description": "Official build system for Angular",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Angular CLI",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"builders": "builders.json",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@ampproject/remapping": "2.3.0",
|
|
26
|
-
"@angular-devkit/architect": "0.2003.
|
|
26
|
+
"@angular-devkit/architect": "0.2003.4",
|
|
27
27
|
"@babel/core": "7.28.3",
|
|
28
28
|
"@babel/helper-annotate-as-pure": "7.27.3",
|
|
29
29
|
"@babel/helper-split-export-declaration": "7.24.7",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"parse5-html-rewriting-stream": "8.0.0",
|
|
42
42
|
"picomatch": "4.0.3",
|
|
43
43
|
"piscina": "5.1.3",
|
|
44
|
-
"
|
|
44
|
+
"rollup": "4.52.3",
|
|
45
45
|
"sass": "1.90.0",
|
|
46
46
|
"semver": "7.7.2",
|
|
47
47
|
"source-map-support": "0.5.21",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@angular/platform-browser": "^20.0.0",
|
|
61
61
|
"@angular/platform-server": "^20.0.0",
|
|
62
62
|
"@angular/service-worker": "^20.0.0",
|
|
63
|
-
"@angular/ssr": "^20.3.
|
|
63
|
+
"@angular/ssr": "^20.3.4",
|
|
64
64
|
"karma": "^6.4.0",
|
|
65
65
|
"less": "^4.2.0",
|
|
66
66
|
"ng-packagr": "^20.0.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"type": "git",
|
|
113
113
|
"url": "https://github.com/angular/angular-cli.git"
|
|
114
114
|
},
|
|
115
|
-
"packageManager": "pnpm@10.17.
|
|
115
|
+
"packageManager": "pnpm@10.17.1",
|
|
116
116
|
"engines": {
|
|
117
117
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
118
118
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.optimizeChunks = optimizeChunks;
|
|
14
14
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
|
-
const
|
|
15
|
+
const rollup_1 = require("rollup");
|
|
16
16
|
const bundler_context_1 = require("../../tools/esbuild/bundler-context");
|
|
17
17
|
const utils_1 = require("../../tools/esbuild/utils");
|
|
18
18
|
const error_1 = require("../../utils/error");
|
|
@@ -171,7 +171,7 @@ async function optimizeChunks(original, sourcemap) {
|
|
|
171
171
|
let bundle;
|
|
172
172
|
let optimizedOutput;
|
|
173
173
|
try {
|
|
174
|
-
bundle = await (0,
|
|
174
|
+
bundle = await (0, rollup_1.rollup)({
|
|
175
175
|
input: mainFile,
|
|
176
176
|
plugins: [
|
|
177
177
|
{
|
|
@@ -198,7 +198,7 @@ async function optimizeChunks(original, sourcemap) {
|
|
|
198
198
|
],
|
|
199
199
|
});
|
|
200
200
|
const result = await bundle.generate({
|
|
201
|
-
|
|
201
|
+
compact: true,
|
|
202
202
|
sourcemap,
|
|
203
203
|
chunkFileNames: (chunkInfo) => `${chunkInfo.name.replace(/-[a-zA-Z0-9]{8}$/, '')}-[hash].js`,
|
|
204
204
|
});
|
|
@@ -47,7 +47,11 @@ exports.default = default_1;
|
|
|
47
47
|
const helper_annotate_as_pure_1 = __importDefault(require("@babel/helper-annotate-as-pure"));
|
|
48
48
|
const tslib = __importStar(require("tslib"));
|
|
49
49
|
/**
|
|
50
|
-
* A
|
|
50
|
+
* A set of constructor names that are considered to be side-effect free.
|
|
51
|
+
*/
|
|
52
|
+
const sideEffectFreeConstructors = new Set(['InjectionToken']);
|
|
53
|
+
/**
|
|
54
|
+
* A set of TypeScript helper function names used by the helper name matcher utility function.
|
|
51
55
|
*/
|
|
52
56
|
const tslibHelpers = new Set(Object.keys(tslib).filter((h) => h.startsWith('__')));
|
|
53
57
|
/**
|
|
@@ -76,13 +80,16 @@ function isBabelHelperName(name) {
|
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
78
82
|
* A babel plugin factory function for adding the PURE annotation to top-level new and call expressions.
|
|
79
|
-
*
|
|
80
83
|
* @returns A babel plugin object instance.
|
|
81
84
|
*/
|
|
82
85
|
function default_1() {
|
|
83
86
|
return {
|
|
84
87
|
visitor: {
|
|
85
|
-
CallExpression(path) {
|
|
88
|
+
CallExpression(path, state) {
|
|
89
|
+
const { topLevelSafeMode = false } = state.opts;
|
|
90
|
+
if (topLevelSafeMode) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
86
93
|
// If the expression has a function parent, it is not top-level
|
|
87
94
|
if (path.getFunctionParent()) {
|
|
88
95
|
return;
|
|
@@ -100,9 +107,18 @@ function default_1() {
|
|
|
100
107
|
}
|
|
101
108
|
(0, helper_annotate_as_pure_1.default)(path);
|
|
102
109
|
},
|
|
103
|
-
NewExpression(path) {
|
|
110
|
+
NewExpression(path, state) {
|
|
104
111
|
// If the expression has a function parent, it is not top-level
|
|
105
|
-
if (
|
|
112
|
+
if (path.getFunctionParent()) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const { topLevelSafeMode = false } = state.opts;
|
|
116
|
+
if (!topLevelSafeMode) {
|
|
117
|
+
(0, helper_annotate_as_pure_1.default)(path);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const callee = path.get('callee');
|
|
121
|
+
if (callee.isIdentifier() && sideEffectFreeConstructors.has(callee.node.name)) {
|
|
106
122
|
(0, helper_annotate_as_pure_1.default)(path);
|
|
107
123
|
}
|
|
108
124
|
},
|
|
@@ -84,16 +84,10 @@ async function transformWithBabel(filename, data, options) {
|
|
|
84
84
|
plugins.push(linkerPlugin);
|
|
85
85
|
}
|
|
86
86
|
if (options.advancedOptimizations) {
|
|
87
|
+
const { adjustStaticMembers, adjustTypeScriptEnums, elideAngularMetadata, markTopLevelPure } = await Promise.resolve().then(() => __importStar(require('../babel/plugins')));
|
|
87
88
|
const sideEffectFree = options.sideEffects === false;
|
|
88
89
|
const safeAngularPackage = sideEffectFree && /[\\/]node_modules[\\/]@angular[\\/]/.test(filename);
|
|
89
|
-
|
|
90
|
-
if (safeAngularPackage) {
|
|
91
|
-
plugins.push(markTopLevelPure);
|
|
92
|
-
}
|
|
93
|
-
plugins.push(elideAngularMetadata, adjustTypeScriptEnums, [
|
|
94
|
-
adjustStaticMembers,
|
|
95
|
-
{ wrapDecorators: sideEffectFree },
|
|
96
|
-
]);
|
|
90
|
+
plugins.push([markTopLevelPure, { topLevelSafeMode: !safeAngularPackage }], elideAngularMetadata, adjustTypeScriptEnums, [adjustStaticMembers, { wrapDecorators: sideEffectFree }]);
|
|
97
91
|
}
|
|
98
92
|
// If no additional transformations are needed, return the data directly
|
|
99
93
|
if (plugins.length === 0) {
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.normalizeCacheOptions = normalizeCacheOptions;
|
|
11
11
|
const node_path_1 = require("node:path");
|
|
12
12
|
/** Version placeholder is replaced during the build process with actual package version */
|
|
13
|
-
const VERSION = '20.3.
|
|
13
|
+
const VERSION = '20.3.4';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|