@angular/core 21.0.0-next.1 → 21.0.0-next.10
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/_attribute-chunk.mjs +12 -0
- package/fesm2022/_attribute-chunk.mjs.map +1 -0
- package/fesm2022/_debug_node-chunk.mjs +18469 -0
- package/fesm2022/_debug_node-chunk.mjs.map +1 -0
- package/fesm2022/_effect-chunk.mjs +423 -0
- package/fesm2022/_effect-chunk.mjs.map +1 -0
- package/fesm2022/_effect-chunk2.mjs +2951 -0
- package/fesm2022/_effect-chunk2.mjs.map +1 -0
- package/fesm2022/_not_found-chunk.mjs +39 -0
- package/fesm2022/_not_found-chunk.mjs.map +1 -0
- package/fesm2022/_resource-chunk.mjs +378 -0
- package/fesm2022/_resource-chunk.mjs.map +1 -0
- package/fesm2022/_untracked-chunk.mjs +96 -0
- package/fesm2022/_untracked-chunk.mjs.map +1 -0
- package/fesm2022/_weak_ref-chunk.mjs +10 -0
- package/fesm2022/_weak_ref-chunk.mjs.map +1 -0
- package/fesm2022/core.mjs +2499 -4185
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives-di.mjs +23 -0
- package/fesm2022/primitives-di.mjs.map +1 -0
- package/fesm2022/primitives-event-dispatch.mjs +788 -0
- package/fesm2022/primitives-event-dispatch.mjs.map +1 -0
- package/fesm2022/primitives-signals.mjs +187 -0
- package/fesm2022/primitives-signals.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +210 -308
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +2309 -3170
- package/fesm2022/testing.mjs.map +1 -1
- package/package.json +18 -12
- package/resources/best-practices.md +56 -0
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +117 -0
- package/schematics/bundles/application-config-core.cjs +84 -0
- package/schematics/bundles/{apply_import_manager-yycO3l8f.cjs → apply_import_manager-1Zs_gpB6.cjs} +4 -5
- package/schematics/bundles/bootstrap-options-migration.cjs +598 -0
- package/schematics/bundles/cleanup-unused-imports.cjs +9 -13
- package/schematics/bundles/common-to-standalone-migration.cjs +381 -0
- package/schematics/bundles/{compiler_host-DrXTGf_7.cjs → compiler_host-DBwYMlTo.cjs} +10 -11
- package/schematics/bundles/control-flow-migration.cjs +113 -82
- package/schematics/bundles/{imports-26VeX8i-.cjs → imports-DP72APSx.cjs} +5 -1
- package/schematics/bundles/{index-BdH2rlWJ.cjs → index-B7I9sIUx.cjs} +36 -39
- package/schematics/bundles/inject-migration.cjs +148 -70
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-BVSg43hf.cjs → migrate_ts_type_references-UGIUl7En.cjs} +500 -24
- package/schematics/bundles/{ng_component_template-DjLc4mdL.cjs → ng_component_template-Dsuq1Lw7.cjs} +4 -5
- package/schematics/bundles/{ng_decorators-CtYwz9Lw.cjs → ng_decorators-DSFlWYQY.cjs} +2 -2
- package/schematics/bundles/ngclass-to-class-migration.cjs +118 -109
- package/schematics/bundles/ngstyle-to-style-migration.cjs +487 -0
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +16 -19
- package/schematics/bundles/parse_html-8VLCL37B.cjs +132 -0
- package/schematics/bundles/{project_paths-T_M15e2g.cjs → project_paths-DvD50ouC.cjs} +14 -247
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.cjs +90 -0
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +54 -26
- package/schematics/bundles/router-current-navigation.cjs +7 -18
- package/schematics/bundles/router-last-successful-navigation.cjs +7 -18
- package/schematics/bundles/router-testing-module-migration.cjs +502 -0
- package/schematics/bundles/self-closing-tags-migration.cjs +14 -17
- package/schematics/bundles/signal-input-migration.cjs +93 -29
- package/schematics/bundles/signal-queries-migration.cjs +22 -25
- package/schematics/bundles/signals.cjs +10 -13
- package/schematics/bundles/standalone-migration.cjs +135 -102
- package/schematics/bundles/{symbol-VPWguRxr.cjs → symbol-BObKoqes.cjs} +3 -2
- package/schematics/collection.json +17 -0
- package/schematics/migrations/common-to-standalone-migration/schema.json +14 -0
- package/schematics/migrations/ngclass-to-class-migration/schema.json +2 -2
- package/schematics/migrations/ngstyle-to-style-migration/schema.json +20 -0
- package/schematics/migrations/router-testing-module-migration/schema.json +14 -0
- package/schematics/migrations.json +16 -2
- package/{api.d.d.ts → types/_api-chunk.d.ts} +9 -6
- package/{chrome_dev_tools_performance.d.d.ts → types/_chrome_dev_tools_performance-chunk.d.ts} +25 -15
- package/{discovery.d.d.ts → types/_discovery-chunk.d.ts} +130 -75
- package/{effect.d.d.ts → types/_effect-chunk.d.ts} +3 -4
- package/{event_dispatcher.d.d.ts → types/_event_dispatcher-chunk.d.ts} +2 -2
- package/{graph.d.d.ts → types/_formatter-chunk.d.ts} +40 -7
- package/{weak_ref.d.d.ts → types/_weak_ref-chunk.d.ts} +2 -2
- package/{index.d.ts → types/core.d.ts} +233 -298
- package/{primitives/di/index.d.ts → types/primitives-di.d.ts} +2 -2
- package/{primitives/event-dispatch/index.d.ts → types/primitives-event-dispatch.d.ts} +4 -4
- package/{primitives/signals/index.d.ts → types/primitives-signals.d.ts} +7 -8
- package/{rxjs-interop/index.d.ts → types/rxjs-interop.d.ts} +8 -6
- package/{testing/index.d.ts → types/testing.d.ts} +7 -7
- package/fesm2022/attribute.mjs +0 -24
- package/fesm2022/attribute.mjs.map +0 -1
- package/fesm2022/debug_node.mjs +0 -31829
- package/fesm2022/debug_node.mjs.map +0 -1
- package/fesm2022/effect.mjs +0 -142
- package/fesm2022/effect.mjs.map +0 -1
- package/fesm2022/not_found.mjs +0 -56
- package/fesm2022/not_found.mjs.map +0 -1
- package/fesm2022/primitives/di.mjs +0 -23
- package/fesm2022/primitives/di.mjs.map +0 -1
- package/fesm2022/primitives/event-dispatch.mjs +0 -1622
- package/fesm2022/primitives/event-dispatch.mjs.map +0 -1
- package/fesm2022/primitives/signals.mjs +0 -89
- package/fesm2022/primitives/signals.mjs.map +0 -1
- package/fesm2022/resource.mjs +0 -624
- package/fesm2022/resource.mjs.map +0 -1
- package/fesm2022/root_effect_scheduler.mjs +0 -4001
- package/fesm2022/root_effect_scheduler.mjs.map +0 -1
- package/fesm2022/signal.mjs +0 -560
- package/fesm2022/signal.mjs.map +0 -1
- package/fesm2022/weak_ref.mjs +0 -12
- package/fesm2022/weak_ref.mjs.map +0 -1
- package/schematics/bundles/index-jjHOgYYs.cjs +0 -22074
- package/schematics/bundles/parse_html-CXR8hziE.cjs +0 -41
- package/schematics/bundles/project_tsconfig_paths-D7xzGqRi.cjs +0 -51085
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v21.0.0-next.
|
|
3
|
+
* @license Angular v21.0.0-next.10
|
|
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-UGIUl7En.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
|
-
require('
|
|
12
|
-
var
|
|
13
|
-
var index$1 = require('./index-jjHOgYYs.cjs');
|
|
14
|
-
require('path');
|
|
11
|
+
require('@angular/compiler-cli');
|
|
12
|
+
var migrations = require('@angular/compiler-cli/private/migrations');
|
|
15
13
|
require('node:path');
|
|
16
|
-
var project_paths = require('./project_paths-
|
|
17
|
-
var index = require('./index-
|
|
14
|
+
var project_paths = require('./project_paths-DvD50ouC.cjs');
|
|
15
|
+
var index = require('./index-B7I9sIUx.cjs');
|
|
18
16
|
var assert = require('assert');
|
|
19
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
17
|
+
var apply_import_manager = require('./apply_import_manager-1Zs_gpB6.cjs');
|
|
20
18
|
require('@angular-devkit/core');
|
|
21
19
|
require('node:path/posix');
|
|
22
20
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
23
|
-
require('fs');
|
|
24
|
-
require('module');
|
|
25
|
-
require('url');
|
|
26
21
|
require('@angular-devkit/schematics');
|
|
22
|
+
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
23
|
+
require('@angular/compiler');
|
|
27
24
|
|
|
28
25
|
/**
|
|
29
26
|
* Class that holds information about a given directive and its input fields.
|
|
@@ -274,9 +271,9 @@ function prepareAnalysisInfo(userProgram, compiler, programAbsoluteRootPaths) {
|
|
|
274
271
|
state.templateTypeChecker.generateAllTypeCheckBlocks();
|
|
275
272
|
}
|
|
276
273
|
const typeChecker = userProgram.getTypeChecker();
|
|
277
|
-
const reflector = new
|
|
278
|
-
const evaluator = new
|
|
279
|
-
const dtsMetadataReader = new
|
|
274
|
+
const reflector = new migrations.TypeScriptReflectionHost(typeChecker);
|
|
275
|
+
const evaluator = new migrations.PartialEvaluator(reflector, typeChecker, null);
|
|
276
|
+
const dtsMetadataReader = new migrations.DtsMetadataReader(typeChecker, reflector);
|
|
280
277
|
return {
|
|
281
278
|
metaRegistry: metaReader,
|
|
282
279
|
dtsMetadataReader,
|
|
@@ -337,7 +334,7 @@ function extractDtsInput(node, metadataReader) {
|
|
|
337
334
|
// in the `.d.ts` aren't resolvable. This seems to be unexpected and shouldn't
|
|
338
335
|
// result in the entire migration to be failing.
|
|
339
336
|
try {
|
|
340
|
-
directiveMetadata = metadataReader.getDirectiveMetadata(new
|
|
337
|
+
directiveMetadata = metadataReader.getDirectiveMetadata(new migrations.Reference(node.parent));
|
|
341
338
|
}
|
|
342
339
|
catch (e) {
|
|
343
340
|
console.error('Unexpected error. Gracefully ignoring.');
|
|
@@ -373,7 +370,7 @@ function extractSourceCodeInput(node, host, reflector, evaluator) {
|
|
|
373
370
|
if (decorators === null) {
|
|
374
371
|
return null;
|
|
375
372
|
}
|
|
376
|
-
const ngDecorators =
|
|
373
|
+
const ngDecorators = migrations.getAngularDecorators(decorators, ['Input'], host.isMigratingCore);
|
|
377
374
|
if (ngDecorators.length === 0) {
|
|
378
375
|
return null;
|
|
379
376
|
}
|
|
@@ -396,7 +393,15 @@ function extractSourceCodeInput(node, host, reflector, evaluator) {
|
|
|
396
393
|
isRequired = !!evaluatedInputOpts.get('required');
|
|
397
394
|
}
|
|
398
395
|
if (evaluatedInputOpts.has('transform') && evaluatedInputOpts.get('transform') != null) {
|
|
399
|
-
|
|
396
|
+
const result = parseTransformOfInput(evaluatedInputOpts, node, reflector);
|
|
397
|
+
if (result === 'parsingError') {
|
|
398
|
+
if (!host.config.bestEffortMode) {
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
transformResult = result;
|
|
404
|
+
}
|
|
400
405
|
}
|
|
401
406
|
}
|
|
402
407
|
}
|
|
@@ -417,33 +422,33 @@ function extractSourceCodeInput(node, host, reflector, evaluator) {
|
|
|
417
422
|
*/
|
|
418
423
|
function parseTransformOfInput(evaluatedInputOpts, node, reflector) {
|
|
419
424
|
const transformValue = evaluatedInputOpts.get('transform');
|
|
420
|
-
if (!(transformValue instanceof
|
|
425
|
+
if (!(transformValue instanceof migrations.DynamicValue) && !(transformValue instanceof migrations.Reference)) {
|
|
421
426
|
return null;
|
|
422
427
|
}
|
|
423
428
|
// For parsing the transform, we don't need a real reference emitter, as
|
|
424
429
|
// the emitter is only used for verifying that the transform type could be
|
|
425
430
|
// copied into e.g. an `ngInputAccept` class member.
|
|
426
|
-
const noopRefEmitter = new
|
|
431
|
+
const noopRefEmitter = new migrations.ReferenceEmitter([
|
|
427
432
|
{
|
|
428
433
|
emit: () => ({
|
|
429
|
-
kind:
|
|
430
|
-
expression:
|
|
434
|
+
kind: migrations.ReferenceEmitKind.Success,
|
|
435
|
+
expression: migrate_ts_type_references.NULL_EXPR,
|
|
431
436
|
importedFile: null,
|
|
432
437
|
}),
|
|
433
438
|
},
|
|
434
439
|
]);
|
|
435
440
|
try {
|
|
436
|
-
return
|
|
441
|
+
return migrations.parseDecoratorInputTransformFunction(node.parent, node.name.text, transformValue, reflector, noopRefEmitter, migrations.CompilationMode.FULL,
|
|
437
442
|
/* emitDeclarationOnly */ false);
|
|
438
443
|
}
|
|
439
444
|
catch (e) {
|
|
440
|
-
if (!(e instanceof
|
|
445
|
+
if (!(e instanceof migrations.FatalDiagnosticError)) {
|
|
441
446
|
throw e;
|
|
442
447
|
}
|
|
443
448
|
// TODO: implement error handling.
|
|
444
449
|
// See failing case: e.g. inherit_definition_feature_spec.ts
|
|
445
450
|
console.error(`${e.node.getSourceFile().fileName}: ${e.toString()}`);
|
|
446
|
-
return
|
|
451
|
+
return 'parsingError';
|
|
447
452
|
}
|
|
448
453
|
}
|
|
449
454
|
|
|
@@ -648,7 +653,7 @@ function pass1__IdentifySourceFileAndDeclarationInputs(sf, host, checker, reflec
|
|
|
648
653
|
function pass3__checkIncompatiblePatterns(host, inheritanceGraph, checker, groupedTsAstVisitor, knownInputs) {
|
|
649
654
|
migrate_ts_type_references.checkIncompatiblePatterns(inheritanceGraph, checker, groupedTsAstVisitor, knownInputs, () => knownInputs.getAllInputContainingClasses());
|
|
650
655
|
for (const input of knownInputs.knownInputIds.values()) {
|
|
651
|
-
const hostBindingDecorators =
|
|
656
|
+
const hostBindingDecorators = migrations.getAngularDecorators(input.metadata.fieldDecorators, ['HostBinding'], host.isMigratingCore);
|
|
652
657
|
if (hostBindingDecorators.length > 0) {
|
|
653
658
|
knownInputs.markFieldIncompatible(input.descriptor, {
|
|
654
659
|
context: hostBindingDecorators[0].node,
|
|
@@ -686,7 +691,7 @@ function executeAnalysisPhase(host, knownInputs, result, { sourceFiles, fullProg
|
|
|
686
691
|
fullProgramSourceFiles.forEach((sf) =>
|
|
687
692
|
// Shim shim files. Those are unnecessary and might cause unexpected slowness.
|
|
688
693
|
// e.g. `ngtypecheck` files.
|
|
689
|
-
!
|
|
694
|
+
!migrations.isShim(sf) &&
|
|
690
695
|
pass1__IdentifySourceFileAndDeclarationInputs(sf, host, typeChecker, reflector, dtsMetadataReader, evaluator, knownInputs, result));
|
|
691
696
|
const fieldNamesToConsiderForReferenceLookup = new Set();
|
|
692
697
|
for (const input of knownInputs.knownInputIds.values()) {
|
|
@@ -961,6 +966,12 @@ function populateKnownInputsFromGlobalData(knownInputs, globalData) {
|
|
|
961
966
|
* @returns Replacements for converting the input.
|
|
962
967
|
*/
|
|
963
968
|
function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType, preferShorthandIfPossible, originalInputDecorator, initialValue, leadingTodoText, }, info, checker, importManager, result) {
|
|
969
|
+
// Check for 'this' references in initializer before doing anything else
|
|
970
|
+
if (node.initializer &&
|
|
971
|
+
(ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer)) &&
|
|
972
|
+
containsThisReferences(node.initializer)) {
|
|
973
|
+
return []; // Skip migration for this input by returning empty replacements
|
|
974
|
+
}
|
|
964
975
|
let optionsLiteral = null;
|
|
965
976
|
// We need an options array for the input because:
|
|
966
977
|
// - the input is either aliased,
|
|
@@ -1030,7 +1041,23 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
|
|
|
1030
1041
|
if (!modifiersWithoutInputDecorator?.some((s) => s.kind === ts.SyntaxKind.ReadonlyKeyword)) {
|
|
1031
1042
|
modifiersWithoutInputDecorator.push(ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword));
|
|
1032
1043
|
}
|
|
1033
|
-
|
|
1044
|
+
// Skip migration if the input is a function that references class members via 'this'
|
|
1045
|
+
if (inputInitializer &&
|
|
1046
|
+
(ts.isArrowFunction(inputInitializer) || ts.isFunctionExpression(inputInitializer))) {
|
|
1047
|
+
if (containsThisReferences(inputInitializer)) {
|
|
1048
|
+
return []; // Skip migration for this input by returning empty replacements
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
let finalInitializer = inputInitializer;
|
|
1052
|
+
if (inputInitializer === undefined) {
|
|
1053
|
+
if (preferShorthandIfPossible === null) {
|
|
1054
|
+
finalInitializer = ts.factory.createIdentifier('undefined');
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
resolvedType = preferShorthandIfPossible.originalType;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
const newNode = ts.factory.createPropertyDeclaration(modifiersWithoutInputDecorator, node.name, undefined, undefined, finalInitializer);
|
|
1034
1061
|
const newPropertyText = result.printer.printNode(ts.EmitHint.Unspecified, newNode, node.getSourceFile());
|
|
1035
1062
|
const replacements = [];
|
|
1036
1063
|
if (leadingTodoText !== null) {
|
|
@@ -1074,6 +1101,43 @@ function extractTransformOfInput(transform, resolvedType, checker) {
|
|
|
1074
1101
|
leadingTodoText,
|
|
1075
1102
|
};
|
|
1076
1103
|
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Checks if a function node contains any references to 'this'.
|
|
1106
|
+
* This is used to skip migration for functions that reference class members.
|
|
1107
|
+
*/
|
|
1108
|
+
function containsThisReferences(node) {
|
|
1109
|
+
let hasThis = false;
|
|
1110
|
+
const visit = (node) => {
|
|
1111
|
+
if (hasThis)
|
|
1112
|
+
return;
|
|
1113
|
+
if (node.kind === ts.SyntaxKind.ThisKeyword) {
|
|
1114
|
+
hasThis = true;
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
1118
|
+
const expr = node.expression;
|
|
1119
|
+
if (ts.isIdentifier(expr) && expr.text === 'this') {
|
|
1120
|
+
hasThis = true;
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
ts.forEachChild(node, visit);
|
|
1125
|
+
};
|
|
1126
|
+
if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
|
|
1127
|
+
if (node.body) {
|
|
1128
|
+
if (node.body.kind === ts.SyntaxKind.Block) {
|
|
1129
|
+
node.body.statements.forEach(visit);
|
|
1130
|
+
}
|
|
1131
|
+
else {
|
|
1132
|
+
visit(node.body);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
else {
|
|
1137
|
+
ts.forEachChild(node, visit);
|
|
1138
|
+
}
|
|
1139
|
+
return hasThis;
|
|
1140
|
+
}
|
|
1077
1141
|
|
|
1078
1142
|
/**
|
|
1079
1143
|
* Phase that migrates `@Input()` declarations to signal inputs and
|
|
@@ -1234,7 +1298,7 @@ function pass9__migrateTypeScriptTypeReferences(host, references, importManager,
|
|
|
1234
1298
|
*/
|
|
1235
1299
|
function executeMigrationPhase(host, knownInputs, result, info) {
|
|
1236
1300
|
const { typeChecker, sourceFiles } = info;
|
|
1237
|
-
const importManager = new
|
|
1301
|
+
const importManager = new migrations.ImportManager({
|
|
1238
1302
|
// For the purpose of this migration, we always use `input` and don't alias
|
|
1239
1303
|
// it to e.g. `input_1`.
|
|
1240
1304
|
generateUniqueIdentifier: () => null,
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v21.0.0-next.
|
|
3
|
+
* @license Angular v21.0.0-next.10
|
|
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 migrations = require('@angular/compiler-cli/private/migrations');
|
|
10
10
|
var ts = require('typescript');
|
|
11
|
-
require('
|
|
12
|
-
var index$1 = require('./index-jjHOgYYs.cjs');
|
|
13
|
-
require('path');
|
|
11
|
+
require('@angular/compiler-cli');
|
|
14
12
|
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-
|
|
13
|
+
var project_paths = require('./project_paths-DvD50ouC.cjs');
|
|
14
|
+
var apply_import_manager = require('./apply_import_manager-1Zs_gpB6.cjs');
|
|
15
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-UGIUl7En.cjs');
|
|
18
16
|
var assert = require('assert');
|
|
19
|
-
var index = require('./index-
|
|
17
|
+
var index = require('./index-B7I9sIUx.cjs');
|
|
18
|
+
var compiler = require('@angular/compiler');
|
|
20
19
|
require('@angular-devkit/core');
|
|
21
20
|
require('node:path/posix');
|
|
22
|
-
require('fs');
|
|
23
|
-
require('module');
|
|
24
|
-
require('url');
|
|
25
21
|
require('@angular-devkit/schematics');
|
|
22
|
+
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
26
23
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
27
24
|
|
|
28
25
|
/**
|
|
@@ -159,7 +156,7 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
if (metadata.queryInfo.read !== null) {
|
|
162
|
-
assert(metadata.queryInfo.read instanceof
|
|
159
|
+
assert(metadata.queryInfo.read instanceof compiler.WrappedNodeExpr);
|
|
163
160
|
optionProperties.push(ts.factory.createPropertyAssignment('read', metadata.queryInfo.read.node));
|
|
164
161
|
}
|
|
165
162
|
if (metadata.queryInfo.descendants !== defaultDescendants) {
|
|
@@ -203,7 +200,7 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
203
200
|
// If the original property type and the read type are matching, we can rely
|
|
204
201
|
// on the TS inference, instead of repeating types, like in `viewChild<Button>(Button)`.
|
|
205
202
|
if (type !== undefined &&
|
|
206
|
-
resolvedReadType instanceof
|
|
203
|
+
resolvedReadType instanceof compiler.WrappedNodeExpr &&
|
|
207
204
|
ts.isIdentifier(resolvedReadType.node) &&
|
|
208
205
|
ts.isTypeReferenceNode(type) &&
|
|
209
206
|
ts.isIdentifier(type.typeName) &&
|
|
@@ -291,7 +288,7 @@ function extractSourceQueryDefinition(node, reflector, evaluator, info) {
|
|
|
291
288
|
return null;
|
|
292
289
|
}
|
|
293
290
|
const decorators = reflector.getDecoratorsOfDeclaration(node) ?? [];
|
|
294
|
-
const ngDecorators =
|
|
291
|
+
const ngDecorators = migrations.getAngularDecorators(decorators, migrations.queryDecoratorNames, /* isCore */ false);
|
|
295
292
|
if (ngDecorators.length === 0) {
|
|
296
293
|
return null;
|
|
297
294
|
}
|
|
@@ -318,10 +315,10 @@ function extractSourceQueryDefinition(node, reflector, evaluator, info) {
|
|
|
318
315
|
}
|
|
319
316
|
let queryInfo = null;
|
|
320
317
|
try {
|
|
321
|
-
queryInfo =
|
|
318
|
+
queryInfo = migrations.extractDecoratorQueryMetadata(node, decorator.name, decorator.args ?? [], node.name.text, reflector, evaluator);
|
|
322
319
|
}
|
|
323
320
|
catch (e) {
|
|
324
|
-
if (!(e instanceof
|
|
321
|
+
if (!(e instanceof migrations.FatalDiagnosticError)) {
|
|
325
322
|
throw e;
|
|
326
323
|
}
|
|
327
324
|
console.error(`Skipping query: ${e.node.getSourceFile().fileName}: ${e.toString()}`);
|
|
@@ -532,7 +529,7 @@ function checkNonTsReferenceAccessesField(ref, fieldName) {
|
|
|
532
529
|
if (ref.from.read !== readFromPath) {
|
|
533
530
|
return null;
|
|
534
531
|
}
|
|
535
|
-
if (!(parentRead instanceof
|
|
532
|
+
if (!(parentRead instanceof compiler.PropertyRead) || parentRead.name !== fieldName) {
|
|
536
533
|
return null;
|
|
537
534
|
}
|
|
538
535
|
return parentRead;
|
|
@@ -570,7 +567,7 @@ function checkNonTsReferenceCallsField(ref, fieldName) {
|
|
|
570
567
|
return null;
|
|
571
568
|
}
|
|
572
569
|
const potentialCall = ref.from.readAstPath[accessIdx - 1];
|
|
573
|
-
if (potentialCall === undefined || !(potentialCall instanceof
|
|
570
|
+
if (potentialCall === undefined || !(potentialCall instanceof compiler.Call)) {
|
|
574
571
|
return null;
|
|
575
572
|
}
|
|
576
573
|
return potentialCall;
|
|
@@ -740,8 +737,8 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
740
737
|
}
|
|
741
738
|
const { sourceFiles, program } = info;
|
|
742
739
|
const checker = program.getTypeChecker();
|
|
743
|
-
const reflector = new
|
|
744
|
-
const evaluator = new
|
|
740
|
+
const reflector = new migrations.TypeScriptReflectionHost(checker);
|
|
741
|
+
const evaluator = new migrations.PartialEvaluator(reflector, checker, null);
|
|
745
742
|
const res = {
|
|
746
743
|
knownQueryFields: {},
|
|
747
744
|
potentialProblematicQueries: {},
|
|
@@ -789,7 +786,7 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
789
786
|
}
|
|
790
787
|
// Migrating fields with `@HostBinding` is incompatible as
|
|
791
788
|
// the host binding decorator does not invoke the signal.
|
|
792
|
-
const hostBindingDecorators =
|
|
789
|
+
const hostBindingDecorators = migrations.getAngularDecorators(extractedQuery.fieldDecorators, ['HostBinding'],
|
|
793
790
|
/* isCore */ false);
|
|
794
791
|
if (hostBindingDecorators.length > 0) {
|
|
795
792
|
markFieldIncompatibleInMetadata(res.potentialProblematicQueries, extractedQuery.id, migrate_ts_type_references.FieldIncompatibilityReason.SignalIncompatibleWithHostBinding);
|
|
@@ -928,10 +925,10 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
928
925
|
const resourceLoader = info.ngCompiler?.['resourceManager'] ?? null;
|
|
929
926
|
const { program, sourceFiles } = info;
|
|
930
927
|
const checker = program.getTypeChecker();
|
|
931
|
-
const reflector = new
|
|
932
|
-
const evaluator = new
|
|
928
|
+
const reflector = new migrations.TypeScriptReflectionHost(checker);
|
|
929
|
+
const evaluator = new migrations.PartialEvaluator(reflector, checker, null);
|
|
933
930
|
const replacements = [];
|
|
934
|
-
const importManager = new
|
|
931
|
+
const importManager = new migrations.ImportManager();
|
|
935
932
|
const printer = ts.createPrinter();
|
|
936
933
|
const filesWithSourceQueries = new Map();
|
|
937
934
|
const filesWithIncompleteMigration = new Map();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v21.0.0-next.
|
|
3
|
+
* @license Angular v21.0.0-next.10
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,22 +10,19 @@ 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('@angular/compiler-cli/private/migrations');
|
|
14
14
|
require('typescript');
|
|
15
|
-
require('
|
|
16
|
-
require('fs');
|
|
17
|
-
require('module');
|
|
18
|
-
require('path');
|
|
19
|
-
require('url');
|
|
20
|
-
require('@angular-devkit/core');
|
|
21
|
-
require('./index-jjHOgYYs.cjs');
|
|
15
|
+
require('@angular/compiler-cli');
|
|
22
16
|
require('node:path');
|
|
23
|
-
require('./project_paths-
|
|
17
|
+
require('./project_paths-DvD50ouC.cjs');
|
|
18
|
+
require('@angular-devkit/core');
|
|
24
19
|
require('node:path/posix');
|
|
25
|
-
require('./
|
|
26
|
-
require('./
|
|
20
|
+
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
21
|
+
require('./apply_import_manager-1Zs_gpB6.cjs');
|
|
22
|
+
require('./migrate_ts_type_references-UGIUl7En.cjs');
|
|
27
23
|
require('assert');
|
|
28
|
-
require('./index-
|
|
24
|
+
require('./index-B7I9sIUx.cjs');
|
|
25
|
+
require('@angular/compiler');
|
|
29
26
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
30
27
|
|
|
31
28
|
function migrate(options) {
|