@angular/core 20.2.0-next.2 → 20.2.0-next.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/api.d.d.ts +2 -2
- package/chrome_dev_tools_performance.d.d.ts +1 -1
- package/discovery.d.d.ts +8 -1
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/core.mjs +35 -10
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +254 -141
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/resource.mjs +12 -3
- package/fesm2022/resource.mjs.map +1 -1
- package/fesm2022/root_effect_scheduler.mjs +1 -1
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/signal.mjs +154 -118
- package/fesm2022/signal.mjs.map +1 -1
- package/fesm2022/testing.mjs +19 -2
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked.mjs +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/graph.d.d.ts +20 -33
- package/index.d.ts +32 -7
- package/package.json +2 -2
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/{apply_import_manager-Bkosyy2x.cjs → apply_import_manager-Doo9rveC.cjs} +4 -4
- package/schematics/bundles/cleanup-unused-imports.cjs +7 -8
- package/schematics/bundles/{compiler_host-CSrf1kFh.cjs → compiler_host-Dtf8fsIr.cjs} +3 -3
- package/schematics/bundles/control-flow-migration.cjs +18 -19
- package/schematics/bundles/document-core.cjs +6 -7
- package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
- package/schematics/bundles/{index-DwmX8Ifa.cjs → index-B10puRUY.cjs} +49 -49
- package/schematics/bundles/{index-DYbdsCUu.cjs → index-DHoQSprx.cjs} +1268 -1264
- package/schematics/bundles/inject-flags.cjs +6 -7
- package/schematics/bundles/inject-migration.cjs +6 -7
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-C7NB9fZH.cjs → migrate_ts_type_references-Cr2742bs.cjs} +14 -14
- package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +20 -21
- package/schematics/bundles/{project_paths-5CoqAjNK.cjs → project_paths-CrqHneU0.cjs} +16 -17
- package/schematics/bundles/{checker-Cfq29XaS.cjs → project_tsconfig_paths-BGhHq5-d.cjs} +166 -30
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +6 -7
- package/schematics/bundles/self-closing-tags-migration.cjs +10 -11
- package/schematics/bundles/signal-input-migration.cjs +21 -22
- package/schematics/bundles/signal-queries-migration.cjs +31 -32
- package/schematics/bundles/signals.cjs +8 -9
- package/schematics/bundles/standalone-migration.cjs +10 -11
- package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
- package/schematics/bundles/test-bed-get.cjs +4 -5
- package/signal.d.d.ts +1 -1
- package/testing/index.d.ts +6 -1
- package/weak_ref.d.d.ts +1 -1
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.cjs +0 -90
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
9
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-Cr2742bs.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
|
-
var
|
|
13
|
-
var index$1 = require('./index-
|
|
12
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-BGhHq5-d.cjs');
|
|
13
|
+
var index$1 = require('./index-DHoQSprx.cjs');
|
|
14
14
|
require('path');
|
|
15
15
|
require('node:path');
|
|
16
|
-
var project_paths = require('./project_paths-
|
|
17
|
-
var index = require('./index-
|
|
16
|
+
var project_paths = require('./project_paths-CrqHneU0.cjs');
|
|
17
|
+
var index = require('./index-B10puRUY.cjs');
|
|
18
18
|
var assert = require('assert');
|
|
19
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
19
|
+
var apply_import_manager = require('./apply_import_manager-Doo9rveC.cjs');
|
|
20
20
|
require('@angular-devkit/core');
|
|
21
21
|
require('node:path/posix');
|
|
22
22
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
@@ -24,7 +24,6 @@ require('fs');
|
|
|
24
24
|
require('module');
|
|
25
25
|
require('url');
|
|
26
26
|
require('@angular-devkit/schematics');
|
|
27
|
-
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
29
|
* Class that holds information about a given directive and its input fields.
|
|
@@ -275,7 +274,7 @@ function prepareAnalysisInfo(userProgram, compiler, programAbsoluteRootPaths) {
|
|
|
275
274
|
state.templateTypeChecker.generateAllTypeCheckBlocks();
|
|
276
275
|
}
|
|
277
276
|
const typeChecker = userProgram.getTypeChecker();
|
|
278
|
-
const reflector = new
|
|
277
|
+
const reflector = new project_tsconfig_paths.TypeScriptReflectionHost(typeChecker);
|
|
279
278
|
const evaluator = new index$1.PartialEvaluator(reflector, typeChecker, null);
|
|
280
279
|
const dtsMetadataReader = new index$1.DtsMetadataReader(typeChecker, reflector);
|
|
281
280
|
return {
|
|
@@ -338,7 +337,7 @@ function extractDtsInput(node, metadataReader) {
|
|
|
338
337
|
// in the `.d.ts` aren't resolvable. This seems to be unexpected and shouldn't
|
|
339
338
|
// result in the entire migration to be failing.
|
|
340
339
|
try {
|
|
341
|
-
directiveMetadata = metadataReader.getDirectiveMetadata(new
|
|
340
|
+
directiveMetadata = metadataReader.getDirectiveMetadata(new project_tsconfig_paths.Reference(node.parent));
|
|
342
341
|
}
|
|
343
342
|
catch (e) {
|
|
344
343
|
console.error('Unexpected error. Gracefully ignoring.');
|
|
@@ -374,7 +373,7 @@ function extractSourceCodeInput(node, host, reflector, evaluator) {
|
|
|
374
373
|
if (decorators === null) {
|
|
375
374
|
return null;
|
|
376
375
|
}
|
|
377
|
-
const ngDecorators =
|
|
376
|
+
const ngDecorators = project_tsconfig_paths.getAngularDecorators(decorators, ['Input'], host.isMigratingCore);
|
|
378
377
|
if (ngDecorators.length === 0) {
|
|
379
378
|
return null;
|
|
380
379
|
}
|
|
@@ -418,27 +417,27 @@ function extractSourceCodeInput(node, host, reflector, evaluator) {
|
|
|
418
417
|
*/
|
|
419
418
|
function parseTransformOfInput(evaluatedInputOpts, node, reflector) {
|
|
420
419
|
const transformValue = evaluatedInputOpts.get('transform');
|
|
421
|
-
if (!(transformValue instanceof
|
|
420
|
+
if (!(transformValue instanceof project_tsconfig_paths.DynamicValue) && !(transformValue instanceof project_tsconfig_paths.Reference)) {
|
|
422
421
|
return null;
|
|
423
422
|
}
|
|
424
423
|
// For parsing the transform, we don't need a real reference emitter, as
|
|
425
424
|
// the emitter is only used for verifying that the transform type could be
|
|
426
425
|
// copied into e.g. an `ngInputAccept` class member.
|
|
427
|
-
const noopRefEmitter = new
|
|
426
|
+
const noopRefEmitter = new project_tsconfig_paths.ReferenceEmitter([
|
|
428
427
|
{
|
|
429
428
|
emit: () => ({
|
|
430
|
-
kind:
|
|
431
|
-
expression:
|
|
429
|
+
kind: project_tsconfig_paths.ReferenceEmitKind.Success,
|
|
430
|
+
expression: project_tsconfig_paths.NULL_EXPR,
|
|
432
431
|
importedFile: null,
|
|
433
432
|
}),
|
|
434
433
|
},
|
|
435
434
|
]);
|
|
436
435
|
try {
|
|
437
|
-
return
|
|
436
|
+
return project_tsconfig_paths.parseDecoratorInputTransformFunction(node.parent, node.name.text, transformValue, reflector, noopRefEmitter, project_tsconfig_paths.CompilationMode.FULL,
|
|
438
437
|
/* emitDeclarationOnly */ false);
|
|
439
438
|
}
|
|
440
439
|
catch (e) {
|
|
441
|
-
if (!(e instanceof
|
|
440
|
+
if (!(e instanceof project_tsconfig_paths.FatalDiagnosticError)) {
|
|
442
441
|
throw e;
|
|
443
442
|
}
|
|
444
443
|
// TODO: implement error handling.
|
|
@@ -646,10 +645,10 @@ function pass1__IdentifySourceFileAndDeclarationInputs(sf, host, checker, reflec
|
|
|
646
645
|
* In addition, spying onto an input may be problematic- so we skip migrating
|
|
647
646
|
* such.
|
|
648
647
|
*/
|
|
649
|
-
function pass3__checkIncompatiblePatterns(host, inheritanceGraph, checker
|
|
650
|
-
migrate_ts_type_references.checkIncompatiblePatterns(inheritanceGraph, checker
|
|
648
|
+
function pass3__checkIncompatiblePatterns(host, inheritanceGraph, checker, groupedTsAstVisitor, knownInputs) {
|
|
649
|
+
migrate_ts_type_references.checkIncompatiblePatterns(inheritanceGraph, checker, groupedTsAstVisitor, knownInputs, () => knownInputs.getAllInputContainingClasses());
|
|
651
650
|
for (const input of knownInputs.knownInputIds.values()) {
|
|
652
|
-
const hostBindingDecorators =
|
|
651
|
+
const hostBindingDecorators = project_tsconfig_paths.getAngularDecorators(input.metadata.fieldDecorators, ['HostBinding'], host.isMigratingCore);
|
|
653
652
|
if (hostBindingDecorators.length > 0) {
|
|
654
653
|
knownInputs.markFieldIncompatible(input.descriptor, {
|
|
655
654
|
context: hostBindingDecorators[0].node,
|
|
@@ -687,7 +686,7 @@ function executeAnalysisPhase(host, knownInputs, result, { sourceFiles, fullProg
|
|
|
687
686
|
fullProgramSourceFiles.forEach((sf) =>
|
|
688
687
|
// Shim shim files. Those are unnecessary and might cause unexpected slowness.
|
|
689
688
|
// e.g. `ngtypecheck` files.
|
|
690
|
-
!
|
|
689
|
+
!project_tsconfig_paths.isShim(sf) &&
|
|
691
690
|
pass1__IdentifySourceFileAndDeclarationInputs(sf, host, typeChecker, reflector, dtsMetadataReader, evaluator, knownInputs, result));
|
|
692
691
|
const fieldNamesToConsiderForReferenceLookup = new Set();
|
|
693
692
|
for (const input of knownInputs.knownInputIds.values()) {
|
|
@@ -1235,7 +1234,7 @@ function pass9__migrateTypeScriptTypeReferences(host, references, importManager,
|
|
|
1235
1234
|
*/
|
|
1236
1235
|
function executeMigrationPhase(host, knownInputs, result, info) {
|
|
1237
1236
|
const { typeChecker, sourceFiles } = info;
|
|
1238
|
-
const importManager = new
|
|
1237
|
+
const importManager = new project_tsconfig_paths.ImportManager({
|
|
1239
1238
|
// For the purpose of this migration, we always use `input` and don't alias
|
|
1240
1239
|
// it to e.g. `input_1`.
|
|
1241
1240
|
generateUniqueIdentifier: () => null,
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-BGhHq5-d.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
|
-
var index$1 = require('./index-
|
|
12
|
+
var index$1 = require('./index-DHoQSprx.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
16
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
17
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
15
|
+
var project_paths = require('./project_paths-CrqHneU0.cjs');
|
|
16
|
+
var apply_import_manager = require('./apply_import_manager-Doo9rveC.cjs');
|
|
17
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-Cr2742bs.cjs');
|
|
18
18
|
var assert = require('assert');
|
|
19
|
-
var index = require('./index-
|
|
19
|
+
var index = require('./index-B10puRUY.cjs');
|
|
20
20
|
require('@angular-devkit/core');
|
|
21
21
|
require('node:path/posix');
|
|
22
22
|
require('fs');
|
|
23
23
|
require('module');
|
|
24
24
|
require('url');
|
|
25
25
|
require('@angular-devkit/schematics');
|
|
26
|
-
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
27
26
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
28
27
|
|
|
29
28
|
/**
|
|
@@ -135,7 +134,7 @@ function extractQueryListType(node) {
|
|
|
135
134
|
* --> read stays
|
|
136
135
|
* --> emitDistinctChangesOnly is gone!
|
|
137
136
|
*/
|
|
138
|
-
function computeReplacementsToMigrateQuery(node, metadata, importManager, info, printer, options, checker
|
|
137
|
+
function computeReplacementsToMigrateQuery(node, metadata, importManager, info, printer, options, checker) {
|
|
139
138
|
const sf = node.getSourceFile();
|
|
140
139
|
let newQueryFn = importManager.addImport({
|
|
141
140
|
requestedFile: sf,
|
|
@@ -160,7 +159,7 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
161
|
if (metadata.queryInfo.read !== null) {
|
|
163
|
-
assert(metadata.queryInfo.read instanceof
|
|
162
|
+
assert(metadata.queryInfo.read instanceof project_tsconfig_paths.WrappedNodeExpr);
|
|
164
163
|
optionProperties.push(ts.factory.createPropertyAssignment('read', metadata.queryInfo.read.node));
|
|
165
164
|
}
|
|
166
165
|
if (metadata.queryInfo.descendants !== defaultDescendants) {
|
|
@@ -184,7 +183,7 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
184
183
|
node.initializer === undefined &&
|
|
185
184
|
node.questionToken === undefined &&
|
|
186
185
|
type !== undefined &&
|
|
187
|
-
!checker
|
|
186
|
+
!checker.isTypeAssignableTo(checker.getUndefinedType(), checker.getTypeFromTypeNode(type))) {
|
|
188
187
|
isRequired = true;
|
|
189
188
|
}
|
|
190
189
|
if (isRequired && metadata.queryInfo.first) {
|
|
@@ -204,7 +203,7 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
204
203
|
// If the original property type and the read type are matching, we can rely
|
|
205
204
|
// on the TS inference, instead of repeating types, like in `viewChild<Button>(Button)`.
|
|
206
205
|
if (type !== undefined &&
|
|
207
|
-
resolvedReadType instanceof
|
|
206
|
+
resolvedReadType instanceof project_tsconfig_paths.WrappedNodeExpr &&
|
|
208
207
|
ts.isIdentifier(resolvedReadType.node) &&
|
|
209
208
|
ts.isTypeReferenceNode(type) &&
|
|
210
209
|
ts.isIdentifier(type.typeName) &&
|
|
@@ -292,7 +291,7 @@ function extractSourceQueryDefinition(node, reflector, evaluator, info) {
|
|
|
292
291
|
return null;
|
|
293
292
|
}
|
|
294
293
|
const decorators = reflector.getDecoratorsOfDeclaration(node) ?? [];
|
|
295
|
-
const ngDecorators =
|
|
294
|
+
const ngDecorators = project_tsconfig_paths.getAngularDecorators(decorators, project_tsconfig_paths.queryDecoratorNames, /* isCore */ false);
|
|
296
295
|
if (ngDecorators.length === 0) {
|
|
297
296
|
return null;
|
|
298
297
|
}
|
|
@@ -319,10 +318,10 @@ function extractSourceQueryDefinition(node, reflector, evaluator, info) {
|
|
|
319
318
|
}
|
|
320
319
|
let queryInfo = null;
|
|
321
320
|
try {
|
|
322
|
-
queryInfo =
|
|
321
|
+
queryInfo = project_tsconfig_paths.extractDecoratorQueryMetadata(node, decorator.name, decorator.args ?? [], node.name.text, reflector, evaluator);
|
|
323
322
|
}
|
|
324
323
|
catch (e) {
|
|
325
|
-
if (!(e instanceof
|
|
324
|
+
if (!(e instanceof project_tsconfig_paths.FatalDiagnosticError)) {
|
|
326
325
|
throw e;
|
|
327
326
|
}
|
|
328
327
|
console.error(`Skipping query: ${e.node.getSourceFile().fileName}: ${e.toString()}`);
|
|
@@ -533,7 +532,7 @@ function checkNonTsReferenceAccessesField(ref, fieldName) {
|
|
|
533
532
|
if (ref.from.read !== readFromPath) {
|
|
534
533
|
return null;
|
|
535
534
|
}
|
|
536
|
-
if (!(parentRead instanceof
|
|
535
|
+
if (!(parentRead instanceof project_tsconfig_paths.PropertyRead) || parentRead.name !== fieldName) {
|
|
537
536
|
return null;
|
|
538
537
|
}
|
|
539
538
|
return parentRead;
|
|
@@ -571,7 +570,7 @@ function checkNonTsReferenceCallsField(ref, fieldName) {
|
|
|
571
570
|
return null;
|
|
572
571
|
}
|
|
573
572
|
const potentialCall = ref.from.readAstPath[accessIdx - 1];
|
|
574
|
-
if (potentialCall === undefined || !(potentialCall instanceof
|
|
573
|
+
if (potentialCall === undefined || !(potentialCall instanceof project_tsconfig_paths.Call)) {
|
|
575
574
|
return null;
|
|
576
575
|
}
|
|
577
576
|
return potentialCall;
|
|
@@ -740,9 +739,9 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
740
739
|
templateTypeChecker.generateAllTypeCheckBlocks();
|
|
741
740
|
}
|
|
742
741
|
const { sourceFiles, program } = info;
|
|
743
|
-
const checker
|
|
744
|
-
const reflector = new
|
|
745
|
-
const evaluator = new index$1.PartialEvaluator(reflector, checker
|
|
742
|
+
const checker = program.getTypeChecker();
|
|
743
|
+
const reflector = new project_tsconfig_paths.TypeScriptReflectionHost(checker);
|
|
744
|
+
const evaluator = new index$1.PartialEvaluator(reflector, checker, null);
|
|
746
745
|
const res = {
|
|
747
746
|
knownQueryFields: {},
|
|
748
747
|
potentialProblematicQueries: {},
|
|
@@ -790,7 +789,7 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
790
789
|
}
|
|
791
790
|
// Migrating fields with `@HostBinding` is incompatible as
|
|
792
791
|
// the host binding decorator does not invoke the signal.
|
|
793
|
-
const hostBindingDecorators =
|
|
792
|
+
const hostBindingDecorators = project_tsconfig_paths.getAngularDecorators(extractedQuery.fieldDecorators, ['HostBinding'],
|
|
794
793
|
/* isCore */ false);
|
|
795
794
|
if (hostBindingDecorators.length > 0) {
|
|
796
795
|
markFieldIncompatibleInMetadata(res.potentialProblematicQueries, extractedQuery.id, migrate_ts_type_references.FieldIncompatibilityReason.SignalIncompatibleWithHostBinding);
|
|
@@ -820,15 +819,15 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
820
819
|
return descriptor;
|
|
821
820
|
},
|
|
822
821
|
};
|
|
823
|
-
groupedAstVisitor.register(index.createFindAllSourceFileReferencesVisitor(info, checker
|
|
822
|
+
groupedAstVisitor.register(index.createFindAllSourceFileReferencesVisitor(info, checker, reflector, resourceLoader, evaluator, templateTypeChecker, allFieldsOrKnownQueries,
|
|
824
823
|
// In non-batch mode, we know what inputs exist and can optimize the reference
|
|
825
824
|
// resolution significantly (for e.g. VSCode integration)— as we know what
|
|
826
825
|
// field names may be used to reference potential queries.
|
|
827
826
|
this.config.assumeNonBatch
|
|
828
827
|
? new Set(Array.from(filteredQueriesForCompilationUnit.values()).map((f) => f.fieldName))
|
|
829
828
|
: null, referenceResult).visitor);
|
|
830
|
-
const inheritanceGraph = new migrate_ts_type_references.InheritanceGraph(checker
|
|
831
|
-
migrate_ts_type_references.checkIncompatiblePatterns(inheritanceGraph, checker
|
|
829
|
+
const inheritanceGraph = new migrate_ts_type_references.InheritanceGraph(checker).expensivePopulate(info.sourceFiles);
|
|
830
|
+
migrate_ts_type_references.checkIncompatiblePatterns(inheritanceGraph, checker, groupedAstVisitor, {
|
|
832
831
|
...allFieldsOrKnownQueries,
|
|
833
832
|
isFieldIncompatible: (f) => res.potentialProblematicQueries[f.key]?.fieldReason !== null ||
|
|
834
833
|
res.potentialProblematicQueries[f.key]?.classReason !== null,
|
|
@@ -928,11 +927,11 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
928
927
|
};
|
|
929
928
|
const resourceLoader = info.ngCompiler?.['resourceManager'] ?? null;
|
|
930
929
|
const { program, sourceFiles } = info;
|
|
931
|
-
const checker
|
|
932
|
-
const reflector = new
|
|
933
|
-
const evaluator = new index$1.PartialEvaluator(reflector, checker
|
|
930
|
+
const checker = program.getTypeChecker();
|
|
931
|
+
const reflector = new project_tsconfig_paths.TypeScriptReflectionHost(checker);
|
|
932
|
+
const evaluator = new index$1.PartialEvaluator(reflector, checker, null);
|
|
934
933
|
const replacements = [];
|
|
935
|
-
const importManager = new
|
|
934
|
+
const importManager = new project_tsconfig_paths.ImportManager();
|
|
936
935
|
const printer = ts.createPrinter();
|
|
937
936
|
const filesWithSourceQueries = new Map();
|
|
938
937
|
const filesWithIncompleteMigration = new Map();
|
|
@@ -981,13 +980,13 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
981
980
|
referenceResult.references = globalMetadata.reusableAnalysisReferences;
|
|
982
981
|
}
|
|
983
982
|
else {
|
|
984
|
-
groupedAstVisitor.register(index.createFindAllSourceFileReferencesVisitor(info, checker
|
|
983
|
+
groupedAstVisitor.register(index.createFindAllSourceFileReferencesVisitor(info, checker, reflector, resourceLoader, evaluator, templateTypeChecker, knownQueries, fieldNamesToConsiderForReferenceLookup, referenceResult).visitor);
|
|
985
984
|
}
|
|
986
985
|
// Check inheritance.
|
|
987
986
|
// NOTE: Inheritance is only checked in the migrate stage as we cannot reliably
|
|
988
987
|
// check during analyze— where we don't know what fields from foreign `.d.ts`
|
|
989
988
|
// files refer to queries or not.
|
|
990
|
-
const inheritanceGraph = new migrate_ts_type_references.InheritanceGraph(checker
|
|
989
|
+
const inheritanceGraph = new migrate_ts_type_references.InheritanceGraph(checker).expensivePopulate(info.sourceFiles);
|
|
991
990
|
migrate_ts_type_references.checkInheritanceOfKnownFields(inheritanceGraph, metaReader, knownQueries, {
|
|
992
991
|
getFieldsForClass: (n) => knownQueries.getQueryFieldsOfClass(n) ?? [],
|
|
993
992
|
isClassWithKnownFields: (clazz) => knownQueries.getQueryFieldsOfClass(clazz) !== undefined,
|
|
@@ -1016,7 +1015,7 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
1016
1015
|
updateFileState(filesWithIncompleteMigration, sf, extractedQuery.kind);
|
|
1017
1016
|
continue;
|
|
1018
1017
|
}
|
|
1019
|
-
replacements.push(...computeReplacementsToMigrateQuery(node, extractedQuery, importManager, info, printer, info.userOptions, checker
|
|
1018
|
+
replacements.push(...computeReplacementsToMigrateQuery(node, extractedQuery, importManager, info, printer, info.userOptions, checker));
|
|
1020
1019
|
}
|
|
1021
1020
|
// Migrate references.
|
|
1022
1021
|
const referenceMigrationHost = {
|
|
@@ -1027,7 +1026,7 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
1027
1026
|
.getQueryFieldsOfClass(clazz)
|
|
1028
1027
|
?.some((q) => !knownQueries.isFieldIncompatible(q)),
|
|
1029
1028
|
};
|
|
1030
|
-
migrate_ts_type_references.migrateTypeScriptReferences(referenceMigrationHost, referenceResult.references, checker
|
|
1029
|
+
migrate_ts_type_references.migrateTypeScriptReferences(referenceMigrationHost, referenceResult.references, checker, info);
|
|
1031
1030
|
migrateTemplateReferences(referenceMigrationHost, referenceResult.references);
|
|
1032
1031
|
migrateHostBindings(referenceMigrationHost, referenceResult.references, info);
|
|
1033
1032
|
migrate_ts_type_references.migrateTypeScriptTypeReferences(referenceMigrationHost, referenceResult.references, importManager, info);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,23 +10,22 @@ var schematics = require('@angular-devkit/schematics');
|
|
|
10
10
|
var signalQueriesMigration = require('./signal-queries-migration.cjs');
|
|
11
11
|
var signalInputMigration = require('./signal-input-migration.cjs');
|
|
12
12
|
var outputMigration = require('./output-migration.cjs');
|
|
13
|
-
require('./
|
|
13
|
+
require('./project_tsconfig_paths-BGhHq5-d.cjs');
|
|
14
14
|
require('typescript');
|
|
15
15
|
require('os');
|
|
16
16
|
require('fs');
|
|
17
17
|
require('module');
|
|
18
18
|
require('path');
|
|
19
19
|
require('url');
|
|
20
|
-
require('./index-DYbdsCUu.cjs');
|
|
21
|
-
require('node:path');
|
|
22
|
-
require('./project_paths-5CoqAjNK.cjs');
|
|
23
20
|
require('@angular-devkit/core');
|
|
21
|
+
require('./index-DHoQSprx.cjs');
|
|
22
|
+
require('node:path');
|
|
23
|
+
require('./project_paths-CrqHneU0.cjs');
|
|
24
24
|
require('node:path/posix');
|
|
25
|
-
require('./
|
|
26
|
-
require('./
|
|
27
|
-
require('./migrate_ts_type_references-C7NB9fZH.cjs');
|
|
25
|
+
require('./apply_import_manager-Doo9rveC.cjs');
|
|
26
|
+
require('./migrate_ts_type_references-Cr2742bs.cjs');
|
|
28
27
|
require('assert');
|
|
29
|
-
require('./index-
|
|
28
|
+
require('./index-B10puRUY.cjs');
|
|
30
29
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
31
30
|
|
|
32
31
|
function migrate(options) {
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
|
-
var index = require('./index-
|
|
10
|
+
var index = require('./index-DHoQSprx.cjs');
|
|
11
11
|
var fs = require('fs');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
var ts = require('typescript');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
15
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
+
var compiler_host = require('./compiler_host-Dtf8fsIr.cjs');
|
|
15
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-BGhHq5-d.cjs');
|
|
16
16
|
var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
|
|
17
17
|
var nodes = require('./nodes-B16H9JUd.cjs');
|
|
18
18
|
var symbol = require('./symbol-VPWguRxr.cjs');
|
|
19
19
|
var imports = require('./imports-CIX-JgAN.cjs');
|
|
20
|
-
var checker = require('./checker-Cfq29XaS.cjs');
|
|
21
20
|
require('os');
|
|
22
|
-
require('@angular-devkit/core');
|
|
23
21
|
require('module');
|
|
24
22
|
require('url');
|
|
23
|
+
require('@angular-devkit/core');
|
|
25
24
|
|
|
26
25
|
function createProgram({ rootNames, options, host, oldProgram, }) {
|
|
27
26
|
return new index.NgtscProgram(rootNames, options, host, oldProgram);
|
|
@@ -401,8 +400,8 @@ function getComponentImportExpressions(decl, allDeclarations, tracker, typeCheck
|
|
|
401
400
|
const resolvedDependencies = [];
|
|
402
401
|
for (const dep of templateDependencies) {
|
|
403
402
|
const importLocation = findImportLocation(dep, decl, usedDependenciesInMigration.has(dep)
|
|
404
|
-
?
|
|
405
|
-
:
|
|
403
|
+
? project_tsconfig_paths.PotentialImportMode.ForceDirect
|
|
404
|
+
: project_tsconfig_paths.PotentialImportMode.Normal, typeChecker);
|
|
406
405
|
if (importLocation && !seenImports.has(importLocation.symbolName)) {
|
|
407
406
|
seenImports.add(importLocation.symbolName);
|
|
408
407
|
resolvedDependencies.push(importLocation);
|
|
@@ -622,13 +621,13 @@ function findImportLocation(target, inContext, importMode, typeChecker) {
|
|
|
622
621
|
for (const location of importLocations) {
|
|
623
622
|
// Prefer a standalone import, if we can find one.
|
|
624
623
|
// Otherwise fall back to the first module-based import.
|
|
625
|
-
if (location.kind ===
|
|
624
|
+
if (location.kind === project_tsconfig_paths.PotentialImportKind.Standalone) {
|
|
626
625
|
return location;
|
|
627
626
|
}
|
|
628
627
|
if (!location.moduleSpecifier && !firstSameFileImport) {
|
|
629
628
|
firstSameFileImport = location;
|
|
630
629
|
}
|
|
631
|
-
if (location.kind ===
|
|
630
|
+
if (location.kind === project_tsconfig_paths.PotentialImportKind.NgModule &&
|
|
632
631
|
!firstModuleImport &&
|
|
633
632
|
// ɵ is used for some internal Angular modules that we want to skip over.
|
|
634
633
|
!location.symbolName.startsWith('ɵ')) {
|
|
@@ -1149,7 +1148,7 @@ function replaceModulesInImportsArray(array, replacements, tracker, templateType
|
|
|
1149
1148
|
}
|
|
1150
1149
|
const potentialImports = [];
|
|
1151
1150
|
for (const ref of replacementRefs) {
|
|
1152
|
-
const importLocation = findImportLocation(ref, array,
|
|
1151
|
+
const importLocation = findImportLocation(ref, array, project_tsconfig_paths.PotentialImportMode.Normal, templateTypeChecker);
|
|
1153
1152
|
if (importLocation) {
|
|
1154
1153
|
potentialImports.push(importLocation);
|
|
1155
1154
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
require('./
|
|
12
|
-
require('./index-
|
|
11
|
+
require('./project_tsconfig_paths-BGhHq5-d.cjs');
|
|
12
|
+
require('./index-DHoQSprx.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
15
|
+
var project_paths = require('./project_paths-CrqHneU0.cjs');
|
|
16
16
|
var imports = require('./imports-CIX-JgAN.cjs');
|
|
17
17
|
var symbol = require('./symbol-VPWguRxr.cjs');
|
|
18
18
|
require('@angular-devkit/core');
|
|
@@ -21,7 +21,6 @@ require('fs');
|
|
|
21
21
|
require('module');
|
|
22
22
|
require('url');
|
|
23
23
|
require('@angular-devkit/schematics');
|
|
24
|
-
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
25
24
|
|
|
26
25
|
/** Name of the method being replaced. */
|
|
27
26
|
const METHOD_NAME = 'get';
|
package/signal.d.d.ts
CHANGED
package/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.2.0-next.
|
|
2
|
+
* @license Angular v20.2.0-next.4
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -346,6 +346,11 @@ interface TestModuleMetadata {
|
|
|
346
346
|
* Otherwise `div` will be used as the tag name for test components.
|
|
347
347
|
*/
|
|
348
348
|
inferTagName?: boolean;
|
|
349
|
+
/**
|
|
350
|
+
* Whether animate.enter / animate.leave should trigger as normal or be disabled.
|
|
351
|
+
* Defaults to `true`.
|
|
352
|
+
*/
|
|
353
|
+
animationsEnabled?: boolean;
|
|
349
354
|
}
|
|
350
355
|
/**
|
|
351
356
|
* @publicApi
|
package/weak_ref.d.d.ts
CHANGED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/**
|
|
3
|
-
* @license Angular v20.2.0-next.2
|
|
4
|
-
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
|
-
* License: MIT
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
var core = require('@angular-devkit/core');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Gets all tsconfig paths from a CLI project by reading the workspace configuration
|
|
13
|
-
* and looking for common tsconfig locations.
|
|
14
|
-
*/
|
|
15
|
-
async function getProjectTsConfigPaths(tree) {
|
|
16
|
-
// Start with some tsconfig paths that are generally used within CLI projects. Note
|
|
17
|
-
// that we are not interested in IDE-specific tsconfig files (e.g. /tsconfig.json)
|
|
18
|
-
const buildPaths = new Set();
|
|
19
|
-
const testPaths = new Set();
|
|
20
|
-
const workspace = await getWorkspace(tree);
|
|
21
|
-
for (const [, project] of workspace.projects) {
|
|
22
|
-
for (const [name, target] of project.targets) {
|
|
23
|
-
if (name !== 'build' && name !== 'test') {
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
for (const [, options] of allTargetOptions(target)) {
|
|
27
|
-
const tsConfig = options['tsConfig'];
|
|
28
|
-
// Filter out tsconfig files that don't exist in the CLI project.
|
|
29
|
-
if (typeof tsConfig !== 'string' || !tree.exists(tsConfig)) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (name === 'build') {
|
|
33
|
-
buildPaths.add(core.normalize(tsConfig));
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
testPaths.add(core.normalize(tsConfig));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
buildPaths: [...buildPaths],
|
|
43
|
-
testPaths: [...testPaths],
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/** Get options for all configurations for the passed builder target. */
|
|
47
|
-
function* allTargetOptions(target) {
|
|
48
|
-
if (target.options) {
|
|
49
|
-
yield [undefined, target.options];
|
|
50
|
-
}
|
|
51
|
-
if (!target.configurations) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
for (const [name, options] of Object.entries(target.configurations)) {
|
|
55
|
-
if (options) {
|
|
56
|
-
yield [name, options];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function createHost(tree) {
|
|
61
|
-
return {
|
|
62
|
-
async readFile(path) {
|
|
63
|
-
const data = tree.read(path);
|
|
64
|
-
if (!data) {
|
|
65
|
-
throw new Error('File not found.');
|
|
66
|
-
}
|
|
67
|
-
return core.virtualFs.fileBufferToString(data);
|
|
68
|
-
},
|
|
69
|
-
async writeFile(path, data) {
|
|
70
|
-
return tree.overwrite(path, data);
|
|
71
|
-
},
|
|
72
|
-
async isDirectory(path) {
|
|
73
|
-
// Approximate a directory check.
|
|
74
|
-
// We don't need to consider empty directories and hence this is a good enough approach.
|
|
75
|
-
// This is also per documentation, see:
|
|
76
|
-
// https://angular.dev/tools/cli/schematics-for-libraries#get-the-project-configuration
|
|
77
|
-
return !tree.exists(path) && tree.getDir(path).subfiles.length > 0;
|
|
78
|
-
},
|
|
79
|
-
async isFile(path) {
|
|
80
|
-
return tree.exists(path);
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
async function getWorkspace(tree) {
|
|
85
|
-
const host = createHost(tree);
|
|
86
|
-
const { workspace } = await core.workspaces.readWorkspace('/', host);
|
|
87
|
-
return workspace;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
exports.getProjectTsConfigPaths = getProjectTsConfigPaths;
|