@angular/core 19.2.0 → 19.2.2
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/fesm2022/core.mjs +317 -1646
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +45 -0
- package/fesm2022/primitives/di.mjs.map +1 -0
- package/fesm2022/primitives/event-dispatch.mjs +3 -590
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +19 -9
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +8 -12
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +387 -241
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/weak_ref-DrMdAIDh.mjs +12 -0
- package/fesm2022/weak_ref-DrMdAIDh.mjs.map +1 -0
- package/index.d.ts +14138 -14924
- package/navigation_types.d-u4EOrrdZ.d.ts +121 -0
- package/package.json +5 -1
- package/primitives/di/index.d.ts +91 -0
- package/primitives/event-dispatch/index.d.ts +206 -310
- package/primitives/signals/index.d.ts +159 -196
- package/rxjs-interop/index.d.ts +73 -92
- package/schematics/bundles/{apply_import_manager-a4e62ded.js → apply_import_manager-C8MABThs.js} +13 -17
- package/schematics/bundles/{checker-2eecc677.js → checker-DP-zos5Q.js} +2961 -1060
- package/schematics/bundles/cleanup-unused-imports.js +22 -28
- package/schematics/bundles/{compiler_host-f313eac9.js → compiler_host-DzM2hemp.js} +20 -24
- package/schematics/bundles/control-flow-migration.js +82 -39
- package/schematics/bundles/explicit-standalone-flag.js +27 -33
- package/schematics/bundles/{imports-31a38653.js → imports-CIX-JgAN.js} +10 -15
- package/schematics/bundles/{index-afc3f749.js → index-CEdDCtp8.js} +56 -60
- package/schematics/bundles/{index-3891dd55.js → index-CrKEaRj_.js} +5 -5
- package/schematics/bundles/inject-migration.js +122 -128
- package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-D9nQ8UQC.js} +2 -2
- package/schematics/bundles/{migrate_ts_type_references-1abf1f5f.js → migrate_ts_type_references-C0325A9V.js} +107 -112
- package/schematics/bundles/{ng_decorators-6878e227.js → ng_decorators-DznZ5jMl.js} +5 -9
- package/schematics/bundles/{nodes-ffdce442.js → nodes-B16H9JUd.js} +3 -7
- package/schematics/bundles/output-migration.js +40 -46
- package/schematics/bundles/pending-tasks.js +14 -20
- package/schematics/bundles/{program-24da9092.js → program-CRYsSwIq.js} +769 -2634
- package/schematics/bundles/{project_paths-64bc3947.js → project_paths-BoRVJPjW.js} +26 -24
- package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-CDVxT6Ov.js} +2 -2
- package/schematics/bundles/{property_name-42030525.js → property_name-BBwFuqMe.js} +4 -8
- package/schematics/bundles/provide-initializer.js +14 -20
- package/schematics/bundles/route-lazy-loading.js +36 -42
- package/schematics/bundles/self-closing-tags-migration.js +55 -45
- package/schematics/bundles/signal-input-migration.js +61 -68
- package/schematics/bundles/signal-queries-migration.js +48 -55
- package/schematics/bundles/signals.js +10 -12
- package/schematics/bundles/standalone-migration.js +179 -185
- package/testing/index.d.ts +309 -471
- package/weak_ref.d-ttyj86RV.d.ts +9 -0
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
4
|
-
* (c) 2010-
|
|
3
|
+
* @license Angular v19.2.2
|
|
4
|
+
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
|
-
|
|
11
9
|
var schematics = require('@angular-devkit/schematics');
|
|
12
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
13
|
-
var project_paths = require('./project_paths-
|
|
10
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
11
|
+
var project_paths = require('./project_paths-BoRVJPjW.js');
|
|
14
12
|
require('os');
|
|
15
13
|
var ts = require('typescript');
|
|
16
|
-
var checker = require('./checker-
|
|
17
|
-
var program = require('./program-
|
|
14
|
+
var checker = require('./checker-DP-zos5Q.js');
|
|
15
|
+
var program = require('./program-CRYsSwIq.js');
|
|
18
16
|
require('path');
|
|
19
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
20
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
17
|
+
var apply_import_manager = require('./apply_import_manager-C8MABThs.js');
|
|
18
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-C0325A9V.js');
|
|
21
19
|
var assert = require('assert');
|
|
22
|
-
var index = require('./index-
|
|
20
|
+
var index = require('./index-CEdDCtp8.js');
|
|
23
21
|
require('@angular-devkit/core');
|
|
24
22
|
require('node:path/posix');
|
|
25
23
|
require('fs');
|
|
26
24
|
require('module');
|
|
27
25
|
require('url');
|
|
28
|
-
require('./leading_space-
|
|
29
|
-
|
|
30
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
31
|
-
|
|
32
|
-
var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
|
|
33
|
-
var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
|
|
26
|
+
require('./leading_space-D9nQ8UQC.js');
|
|
34
27
|
|
|
35
28
|
/**
|
|
36
29
|
* Phase that migrates Angular host binding references to
|
|
@@ -106,14 +99,14 @@ function migrateTemplateReferences(host, references) {
|
|
|
106
99
|
*/
|
|
107
100
|
function extractQueryListType(node) {
|
|
108
101
|
// Initializer variant of `new QueryList<T>()`.
|
|
109
|
-
if (
|
|
110
|
-
|
|
102
|
+
if (ts.isNewExpression(node) &&
|
|
103
|
+
ts.isIdentifier(node.expression) &&
|
|
111
104
|
node.expression.text === 'QueryList') {
|
|
112
105
|
return node.typeArguments?.[0];
|
|
113
106
|
}
|
|
114
107
|
// Type variant of `: QueryList<T>`.
|
|
115
|
-
if (
|
|
116
|
-
|
|
108
|
+
if (ts.isTypeReferenceNode(node) &&
|
|
109
|
+
ts.isIdentifier(node.typeName) &&
|
|
117
110
|
node.typeName.text === 'QueryList') {
|
|
118
111
|
return node.typeArguments?.[0];
|
|
119
112
|
}
|
|
@@ -166,14 +159,14 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
166
159
|
}
|
|
167
160
|
}
|
|
168
161
|
if (metadata.queryInfo.read !== null) {
|
|
169
|
-
|
|
170
|
-
optionProperties.push(
|
|
162
|
+
assert(metadata.queryInfo.read instanceof checker.WrappedNodeExpr);
|
|
163
|
+
optionProperties.push(ts.factory.createPropertyAssignment('read', metadata.queryInfo.read.node));
|
|
171
164
|
}
|
|
172
165
|
if (metadata.queryInfo.descendants !== defaultDescendants) {
|
|
173
|
-
optionProperties.push(
|
|
166
|
+
optionProperties.push(ts.factory.createPropertyAssignment('descendants', metadata.queryInfo.descendants ? ts.factory.createTrue() : ts.factory.createFalse()));
|
|
174
167
|
}
|
|
175
168
|
if (optionProperties.length > 0) {
|
|
176
|
-
args.push(
|
|
169
|
+
args.push(ts.factory.createObjectLiteralExpression(optionProperties));
|
|
177
170
|
}
|
|
178
171
|
const strictNullChecksEnabled = options.strict === true || options.strictNullChecks === true;
|
|
179
172
|
const strictPropertyInitialization = options.strict === true || options.strictPropertyInitialization === true;
|
|
@@ -196,12 +189,12 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
196
189
|
if (isRequired && metadata.queryInfo.first) {
|
|
197
190
|
// If the query is required already via some indicators, and this is a "single"
|
|
198
191
|
// query, use the available `.required` method.
|
|
199
|
-
newQueryFn =
|
|
192
|
+
newQueryFn = ts.factory.createPropertyAccessExpression(newQueryFn, 'required');
|
|
200
193
|
}
|
|
201
194
|
// If this query is still nullable (i.e. not required), attempt to remove
|
|
202
195
|
// explicit `undefined` types if possible.
|
|
203
|
-
if (!isRequired && type !== undefined &&
|
|
204
|
-
type = migrate_ts_type_references.removeFromUnionIfPossible(type, (v) => v.kind !==
|
|
196
|
+
if (!isRequired && type !== undefined && ts.isUnionTypeNode(type)) {
|
|
197
|
+
type = migrate_ts_type_references.removeFromUnionIfPossible(type, (v) => v.kind !== ts.SyntaxKind.UndefinedKeyword);
|
|
205
198
|
}
|
|
206
199
|
let locatorType = Array.isArray(metadata.queryInfo.predicate)
|
|
207
200
|
? null
|
|
@@ -211,23 +204,23 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
211
204
|
// on the TS inference, instead of repeating types, like in `viewChild<Button>(Button)`.
|
|
212
205
|
if (type !== undefined &&
|
|
213
206
|
resolvedReadType instanceof checker.WrappedNodeExpr &&
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
207
|
+
ts.isIdentifier(resolvedReadType.node) &&
|
|
208
|
+
ts.isTypeReferenceNode(type) &&
|
|
209
|
+
ts.isIdentifier(type.typeName) &&
|
|
217
210
|
type.typeName.text === resolvedReadType.node.text) {
|
|
218
211
|
locatorType = null;
|
|
219
212
|
}
|
|
220
|
-
const call =
|
|
213
|
+
const call = ts.factory.createCallExpression(newQueryFn,
|
|
221
214
|
// If there is no resolved `ReadT` (e.g. string predicate), we use the
|
|
222
215
|
// original type explicitly as generic. Otherwise, query API is smart
|
|
223
216
|
// enough to always infer.
|
|
224
217
|
resolvedReadType === null && type !== undefined ? [type] : undefined, args);
|
|
225
|
-
const updated =
|
|
218
|
+
const updated = ts.factory.createPropertyDeclaration([ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword)], node.name, undefined, undefined, call);
|
|
226
219
|
return [
|
|
227
220
|
new project_paths.Replacement(project_paths.projectFile(node.getSourceFile(), info), new project_paths.TextUpdate({
|
|
228
221
|
position: node.getStart(),
|
|
229
222
|
end: node.getEnd(),
|
|
230
|
-
toInsert: printer.printNode(
|
|
223
|
+
toInsert: printer.printNode(ts.EmitHint.Unspecified, updated, sf),
|
|
231
224
|
})),
|
|
232
225
|
];
|
|
233
226
|
}
|
|
@@ -238,7 +231,7 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
238
231
|
*/
|
|
239
232
|
function getClassFieldDescriptorForSymbol(symbol, info) {
|
|
240
233
|
if (symbol?.valueDeclaration === undefined ||
|
|
241
|
-
!
|
|
234
|
+
!ts.isPropertyDeclaration(symbol.valueDeclaration)) {
|
|
242
235
|
return null;
|
|
243
236
|
}
|
|
244
237
|
const key = getUniqueIDForClassProperty(symbol.valueDeclaration, info);
|
|
@@ -259,7 +252,7 @@ function getClassFieldDescriptorForSymbol(symbol, info) {
|
|
|
259
252
|
* would then match identity.
|
|
260
253
|
*/
|
|
261
254
|
function getUniqueIDForClassProperty(property, info) {
|
|
262
|
-
if (!
|
|
255
|
+
if (!ts.isClassDeclaration(property.parent) || property.parent.name === undefined) {
|
|
263
256
|
return null;
|
|
264
257
|
}
|
|
265
258
|
if (property.name === undefined) {
|
|
@@ -279,14 +272,14 @@ function getUniqueIDForClassProperty(property, info) {
|
|
|
279
272
|
* returns its resolved metadata if possible.
|
|
280
273
|
*/
|
|
281
274
|
function extractSourceQueryDefinition(node, reflector, evaluator, info) {
|
|
282
|
-
if ((!
|
|
283
|
-
!
|
|
275
|
+
if ((!ts.isPropertyDeclaration(node) && !ts.isAccessor(node)) ||
|
|
276
|
+
!ts.isClassDeclaration(node.parent) ||
|
|
284
277
|
node.parent.name === undefined ||
|
|
285
|
-
!
|
|
278
|
+
!ts.isIdentifier(node.name)) {
|
|
286
279
|
return null;
|
|
287
280
|
}
|
|
288
281
|
const decorators = reflector.getDecoratorsOfDeclaration(node) ?? [];
|
|
289
|
-
const ngDecorators = checker.getAngularDecorators(decorators,
|
|
282
|
+
const ngDecorators = checker.getAngularDecorators(decorators, checker.queryDecoratorNames, /* isCore */ false);
|
|
290
283
|
if (ngDecorators.length === 0) {
|
|
291
284
|
return null;
|
|
292
285
|
}
|
|
@@ -313,7 +306,7 @@ function extractSourceQueryDefinition(node, reflector, evaluator, info) {
|
|
|
313
306
|
}
|
|
314
307
|
let queryInfo = null;
|
|
315
308
|
try {
|
|
316
|
-
queryInfo =
|
|
309
|
+
queryInfo = checker.extractDecoratorQueryMetadata(node, decorator.name, decorator.args ?? [], node.name.text, reflector, evaluator);
|
|
317
310
|
}
|
|
318
311
|
catch (e) {
|
|
319
312
|
if (!(e instanceof checker.FatalDiagnosticError)) {
|
|
@@ -412,7 +405,7 @@ class KnownQueries {
|
|
|
412
405
|
return this.classToQueryFields.get(clazz);
|
|
413
406
|
}
|
|
414
407
|
getAllClassesWithQueries() {
|
|
415
|
-
return Array.from(this.classToQueryFields.keys()).filter((c) =>
|
|
408
|
+
return Array.from(this.classToQueryFields.keys()).filter((c) => ts.isClassDeclaration(c));
|
|
416
409
|
}
|
|
417
410
|
captureKnownFieldInheritanceRelationship(derived, parent) {
|
|
418
411
|
// Note: The edge problematic pattern recognition is not as good as the one
|
|
@@ -505,8 +498,8 @@ function queryFunctionNameToDecorator(name) {
|
|
|
505
498
|
function checkTsReferenceAccessesField(ref, fieldName) {
|
|
506
499
|
const accessNode = index.traverseAccess(ref.from.node);
|
|
507
500
|
// Check if the reference is part of a property access.
|
|
508
|
-
if (!
|
|
509
|
-
!
|
|
501
|
+
if (!ts.isPropertyAccessExpression(accessNode.parent) ||
|
|
502
|
+
!ts.isIdentifier(accessNode.parent.name)) {
|
|
510
503
|
return null;
|
|
511
504
|
}
|
|
512
505
|
// Check if the reference is refers to the given field name.
|
|
@@ -543,7 +536,7 @@ function checkTsReferenceCallsField(ref, fieldName) {
|
|
|
543
536
|
if (propertyAccess === null) {
|
|
544
537
|
return null;
|
|
545
538
|
}
|
|
546
|
-
if (
|
|
539
|
+
if (ts.isCallExpression(propertyAccess.parent) &&
|
|
547
540
|
propertyAccess.parent.expression === propertyAccess) {
|
|
548
541
|
return propertyAccess.parent;
|
|
549
542
|
}
|
|
@@ -769,17 +762,17 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
769
762
|
fieldName: extractedQuery.queryInfo.propertyName,
|
|
770
763
|
isMulti: extractedQuery.queryInfo.first === false,
|
|
771
764
|
};
|
|
772
|
-
if (
|
|
765
|
+
if (ts.isAccessor(queryNode)) {
|
|
773
766
|
markFieldIncompatibleInMetadata(res.potentialProblematicQueries, extractedQuery.id, migrate_ts_type_references.FieldIncompatibilityReason.Accessor);
|
|
774
767
|
}
|
|
775
768
|
// Detect queries with union types that are uncommon to be
|
|
776
769
|
// automatically migrate-able. E.g. `refs: ElementRef|null`,
|
|
777
770
|
// or `ElementRef|SomeOtherType`.
|
|
778
771
|
if (queryNode.type !== undefined &&
|
|
779
|
-
|
|
772
|
+
ts.isUnionTypeNode(queryNode.type) &&
|
|
780
773
|
// Either too large union, or doesn't match `T|undefined`.
|
|
781
774
|
(queryNode.type.types.length > 2 ||
|
|
782
|
-
!queryNode.type.types.some((t) => t.kind ===
|
|
775
|
+
!queryNode.type.types.some((t) => t.kind === ts.SyntaxKind.UndefinedKeyword))) {
|
|
783
776
|
markFieldIncompatibleInMetadata(res.potentialProblematicQueries, extractedQuery.id, migrate_ts_type_references.FieldIncompatibilityReason.SignalQueries__IncompatibleMultiUnionType);
|
|
784
777
|
}
|
|
785
778
|
// Migrating fields with `@HostBinding` is incompatible as
|
|
@@ -927,7 +920,7 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
927
920
|
const evaluator = new program.PartialEvaluator(reflector, checker$1, null);
|
|
928
921
|
const replacements = [];
|
|
929
922
|
const importManager = new checker.ImportManager();
|
|
930
|
-
const printer =
|
|
923
|
+
const printer = ts.createPrinter();
|
|
931
924
|
const filesWithSourceQueries = new Map();
|
|
932
925
|
const filesWithIncompleteMigration = new Map();
|
|
933
926
|
const filesWithQueryListOutsideOfDeclarations = new WeakSet();
|
|
@@ -944,8 +937,8 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
944
937
|
return;
|
|
945
938
|
}
|
|
946
939
|
// Detect OTHER queries, inside `.d.ts`. Needed for reference resolution below.
|
|
947
|
-
if (
|
|
948
|
-
(
|
|
940
|
+
if (ts.isPropertyDeclaration(node) ||
|
|
941
|
+
(ts.isAccessor(node) && ts.isClassDeclaration(node.parent))) {
|
|
949
942
|
const classFieldID = getUniqueIDForClassProperty(node, info);
|
|
950
943
|
if (classFieldID !== null && globalMetadata.knownQueryFields[classFieldID] !== undefined) {
|
|
951
944
|
knownQueries.registerQueryField(node, classFieldID);
|
|
@@ -954,15 +947,15 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
954
947
|
}
|
|
955
948
|
// Detect potential usages of `QueryList` outside of queries or imports.
|
|
956
949
|
// Those prevent us from removing the import later.
|
|
957
|
-
if (
|
|
950
|
+
if (ts.isIdentifier(node) &&
|
|
958
951
|
node.text === 'QueryList' &&
|
|
959
|
-
|
|
952
|
+
ts.findAncestor(node, ts.isImportDeclaration) === undefined) {
|
|
960
953
|
filesWithQueryListOutsideOfDeclarations.add(node.getSourceFile());
|
|
961
954
|
}
|
|
962
|
-
|
|
955
|
+
ts.forEachChild(node, queryWholeProgramVisitor);
|
|
963
956
|
};
|
|
964
957
|
for (const sf of info.fullProgramSourceFiles) {
|
|
965
|
-
|
|
958
|
+
ts.forEachChild(sf, queryWholeProgramVisitor);
|
|
966
959
|
}
|
|
967
960
|
// Set of all queries in the program. Useful for speeding up reference
|
|
968
961
|
// lookups below.
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
4
|
-
* (c) 2010-
|
|
3
|
+
* @license Angular v19.2.2
|
|
4
|
+
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
|
-
|
|
11
9
|
var schematics = require('@angular-devkit/schematics');
|
|
12
10
|
var signalQueriesMigration = require('./signal-queries-migration.js');
|
|
13
11
|
var signalInputMigration = require('./signal-input-migration.js');
|
|
14
12
|
var outputMigration = require('./output-migration.js');
|
|
15
|
-
require('./project_tsconfig_paths-
|
|
13
|
+
require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
16
14
|
require('@angular-devkit/core');
|
|
17
|
-
require('./project_paths-
|
|
15
|
+
require('./project_paths-BoRVJPjW.js');
|
|
18
16
|
require('node:path/posix');
|
|
19
17
|
require('os');
|
|
20
18
|
require('typescript');
|
|
21
|
-
require('./checker-
|
|
19
|
+
require('./checker-DP-zos5Q.js');
|
|
22
20
|
require('fs');
|
|
23
21
|
require('module');
|
|
24
22
|
require('path');
|
|
25
23
|
require('url');
|
|
26
|
-
require('./program-
|
|
27
|
-
require('./apply_import_manager-
|
|
28
|
-
require('./migrate_ts_type_references-
|
|
24
|
+
require('./program-CRYsSwIq.js');
|
|
25
|
+
require('./apply_import_manager-C8MABThs.js');
|
|
26
|
+
require('./migrate_ts_type_references-C0325A9V.js');
|
|
29
27
|
require('assert');
|
|
30
|
-
require('./index-
|
|
31
|
-
require('./leading_space-
|
|
28
|
+
require('./index-CEdDCtp8.js');
|
|
29
|
+
require('./leading_space-D9nQ8UQC.js');
|
|
32
30
|
|
|
33
31
|
function migrate(options) {
|
|
34
32
|
// The migrations are independent so we can run them in any order, but we sort them here
|