@angular/core 21.0.0-next.4 → 21.0.0-next.6

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.
Files changed (87) hide show
  1. package/fesm2022/{attribute.mjs → _attribute-chunk.mjs} +2 -2
  2. package/fesm2022/_attribute-chunk.mjs.map +1 -0
  3. package/fesm2022/{debug_node.mjs → _debug_node-chunk.mjs} +70 -69
  4. package/fesm2022/_debug_node-chunk.mjs.map +1 -0
  5. package/fesm2022/{effect.mjs → _effect-chunk.mjs} +5 -6
  6. package/fesm2022/_effect-chunk.mjs.map +1 -0
  7. package/fesm2022/{not_found.mjs → _not_found-chunk.mjs} +2 -2
  8. package/fesm2022/_not_found-chunk.mjs.map +1 -0
  9. package/fesm2022/{resource.mjs → _resource-chunk.mjs} +9 -8
  10. package/fesm2022/_resource-chunk.mjs.map +1 -0
  11. package/fesm2022/{root_effect_scheduler.mjs → _root_effect_scheduler-chunk.mjs} +11 -11
  12. package/fesm2022/_root_effect_scheduler-chunk.mjs.map +1 -0
  13. package/fesm2022/{signal.mjs → _signal-chunk.mjs} +9 -9
  14. package/fesm2022/_signal-chunk.mjs.map +1 -0
  15. package/fesm2022/{weak_ref.mjs → _weak_ref-chunk.mjs} +2 -2
  16. package/fesm2022/_weak_ref-chunk.mjs.map +1 -0
  17. package/fesm2022/core.mjs +21 -22
  18. package/fesm2022/core.mjs.map +1 -1
  19. package/fesm2022/{primitives/di.mjs → primitives-di.mjs} +3 -3
  20. package/fesm2022/primitives-di.mjs.map +1 -0
  21. package/fesm2022/{primitives/event-dispatch.mjs → primitives-event-dispatch.mjs} +3 -3
  22. package/fesm2022/primitives-event-dispatch.mjs.map +1 -0
  23. package/fesm2022/primitives-signals.mjs +221 -0
  24. package/fesm2022/primitives-signals.mjs.map +1 -0
  25. package/fesm2022/rxjs-interop.mjs +6 -6
  26. package/fesm2022/rxjs-interop.mjs.map +1 -1
  27. package/fesm2022/testing.mjs +6 -6
  28. package/fesm2022/testing.mjs.map +1 -1
  29. package/package.json +12 -12
  30. package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +5 -5
  31. package/schematics/bundles/application-config-core.cjs +5 -5
  32. package/schematics/bundles/{apply_import_manager-DroqamMP.cjs → apply_import_manager-pLtndDki.cjs} +3 -3
  33. package/schematics/bundles/bootstrap-options-migration.cjs +13 -91
  34. package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
  35. package/schematics/bundles/{compiler_host-aKaS4KRz.cjs → compiler_host-BJEh7-L1.cjs} +2 -2
  36. package/schematics/bundles/control-flow-migration.cjs +71 -39
  37. package/schematics/bundles/imports-DwPXlGFl.cjs +1 -1
  38. package/schematics/bundles/{index-BI97t1U8.cjs → index-DCfgOEYE.cjs} +55 -45
  39. package/schematics/bundles/{index-DaB-z4lP.cjs → index-bqpULzLD.cjs} +4 -6
  40. package/schematics/bundles/inject-migration.cjs +3 -3
  41. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  42. package/schematics/bundles/{migrate_ts_type_references-DPuwhGod.cjs → migrate_ts_type_references-COE6BA7E.cjs} +5 -5
  43. package/schematics/bundles/{ng_component_template-CytqBs-q.cjs → ng_component_template-pDoKlgPP.cjs} +2 -2
  44. package/schematics/bundles/ng_decorators-BI0uV7KI.cjs +1 -1
  45. package/schematics/bundles/ngclass-to-class-migration.cjs +108 -96
  46. package/schematics/bundles/ngstyle-to-style-migration.cjs +7 -7
  47. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  48. package/schematics/bundles/output-migration.cjs +6 -6
  49. package/schematics/bundles/{parse_html-CeQjkdOK.cjs → parse_html-B6fblY_V.cjs} +2 -2
  50. package/schematics/bundles/{project_paths-Cz4x-QiT.cjs → project_paths-i0Wjiiq1.cjs} +3 -3
  51. package/schematics/bundles/{project_tsconfig_paths-Clg7WX1w.cjs → project_tsconfig_paths-sFatqIE5.cjs} +330 -170
  52. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  53. package/schematics/bundles/route-lazy-loading.cjs +3 -3
  54. package/schematics/bundles/router-current-navigation.cjs +4 -4
  55. package/schematics/bundles/router-last-successful-navigation.cjs +4 -4
  56. package/schematics/bundles/self-closing-tags-migration.cjs +6 -6
  57. package/schematics/bundles/signal-input-migration.cjs +67 -8
  58. package/schematics/bundles/signal-queries-migration.cjs +7 -7
  59. package/schematics/bundles/signals.cjs +7 -7
  60. package/schematics/bundles/standalone-migration.cjs +70 -43
  61. package/schematics/bundles/symbol-BObKoqes.cjs +1 -1
  62. package/schematics/migrations.json +1 -2
  63. package/{api.d.d.ts → types/_api-chunk.d.ts} +8 -5
  64. package/{chrome_dev_tools_performance.d.d.ts → types/_chrome_dev_tools_performance-chunk.d.ts} +3 -3
  65. package/{discovery.d.d.ts → types/_discovery-chunk.d.ts} +10 -9
  66. package/{effect.d.d.ts → types/_effect-chunk.d.ts} +2 -3
  67. package/{event_dispatcher.d.d.ts → types/_event_dispatcher-chunk.d.ts} +1 -1
  68. package/{graph.d.d.ts → types/_formatter-chunk.d.ts} +14 -2
  69. package/{weak_ref.d.d.ts → types/_weak_ref-chunk.d.ts} +1 -1
  70. package/{index.d.ts → types/core.d.ts} +21 -24
  71. package/{primitives/di/index.d.ts → types/primitives-di.d.ts} +1 -1
  72. package/{primitives/event-dispatch/index.d.ts → types/primitives-event-dispatch.d.ts} +3 -3
  73. package/{primitives/signals/index.d.ts → types/primitives-signals.d.ts} +6 -7
  74. package/{rxjs-interop/index.d.ts → types/rxjs-interop.d.ts} +5 -5
  75. package/{testing/index.d.ts → types/testing.d.ts} +6 -6
  76. package/fesm2022/attribute.mjs.map +0 -1
  77. package/fesm2022/debug_node.mjs.map +0 -1
  78. package/fesm2022/effect.mjs.map +0 -1
  79. package/fesm2022/not_found.mjs.map +0 -1
  80. package/fesm2022/primitives/di.mjs.map +0 -1
  81. package/fesm2022/primitives/event-dispatch.mjs.map +0 -1
  82. package/fesm2022/primitives/signals.mjs +0 -89
  83. package/fesm2022/primitives/signals.mjs.map +0 -1
  84. package/fesm2022/resource.mjs.map +0 -1
  85. package/fesm2022/root_effect_scheduler.mjs.map +0 -1
  86. package/fesm2022/signal.mjs.map +0 -1
  87. package/fesm2022/weak_ref.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -9,8 +9,8 @@
9
9
  var schematics = require('@angular-devkit/schematics');
10
10
  var fs = require('fs');
11
11
  var p = require('path');
12
- var compiler_host = require('./compiler_host-aKaS4KRz.cjs');
13
- var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
12
+ var compiler_host = require('./compiler_host-BJEh7-L1.cjs');
13
+ var project_tsconfig_paths = require('./project_tsconfig_paths-sFatqIE5.cjs');
14
14
  var ts = require('typescript');
15
15
  var property_name = require('./property_name-BBwFuqMe.cjs');
16
16
  require('os');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
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('./project_tsconfig_paths-Clg7WX1w.cjs');
12
- require('./index-BI97t1U8.cjs');
11
+ require('./project_tsconfig_paths-sFatqIE5.cjs');
12
+ require('./index-DCfgOEYE.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-Cz4x-QiT.cjs');
15
+ var project_paths = require('./project_paths-i0Wjiiq1.cjs');
16
16
  var imports = require('./imports-DwPXlGFl.cjs');
17
17
  var symbol = require('./symbol-BObKoqes.cjs');
18
18
  require('@angular-devkit/core');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
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('./project_tsconfig_paths-Clg7WX1w.cjs');
12
- require('./index-BI97t1U8.cjs');
11
+ require('./project_tsconfig_paths-sFatqIE5.cjs');
12
+ require('./index-DCfgOEYE.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-Cz4x-QiT.cjs');
15
+ var project_paths = require('./project_paths-i0Wjiiq1.cjs');
16
16
  var imports = require('./imports-DwPXlGFl.cjs');
17
17
  var symbol = require('./symbol-BObKoqes.cjs');
18
18
  require('@angular-devkit/core');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,13 +8,13 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
12
- require('./index-BI97t1U8.cjs');
11
+ var project_tsconfig_paths = require('./project_tsconfig_paths-sFatqIE5.cjs');
12
+ require('./index-DCfgOEYE.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-Cz4x-QiT.cjs');
16
- var ng_component_template = require('./ng_component_template-CytqBs-q.cjs');
17
- var parse_html = require('./parse_html-CeQjkdOK.cjs');
15
+ var project_paths = require('./project_paths-i0Wjiiq1.cjs');
16
+ var ng_component_template = require('./ng_component_template-pDoKlgPP.cjs');
17
+ var parse_html = require('./parse_html-B6fblY_V.cjs');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
20
20
  require('fs');
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
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-DPuwhGod.cjs');
9
+ var migrate_ts_type_references = require('./migrate_ts_type_references-COE6BA7E.cjs');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
13
- var index$1 = require('./index-BI97t1U8.cjs');
12
+ var project_tsconfig_paths = require('./project_tsconfig_paths-sFatqIE5.cjs');
13
+ var index$1 = require('./index-DCfgOEYE.cjs');
14
14
  require('path');
15
15
  require('node:path');
16
- var project_paths = require('./project_paths-Cz4x-QiT.cjs');
17
- var index = require('./index-DaB-z4lP.cjs');
16
+ var project_paths = require('./project_paths-i0Wjiiq1.cjs');
17
+ var index = require('./index-bqpULzLD.cjs');
18
18
  var assert = require('assert');
19
- var apply_import_manager = require('./apply_import_manager-DroqamMP.cjs');
19
+ var apply_import_manager = require('./apply_import_manager-pLtndDki.cjs');
20
20
  require('@angular-devkit/core');
21
21
  require('node:path/posix');
22
22
  require('./leading_space-D9nQ8UQC.cjs');
@@ -969,6 +969,12 @@ function populateKnownInputsFromGlobalData(knownInputs, globalData) {
969
969
  * @returns Replacements for converting the input.
970
970
  */
971
971
  function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType, preferShorthandIfPossible, originalInputDecorator, initialValue, leadingTodoText, }, info, checker, importManager, result) {
972
+ // Check for 'this' references in initializer before doing anything else
973
+ if (node.initializer &&
974
+ (ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer)) &&
975
+ containsThisReferences(node.initializer)) {
976
+ return []; // Skip migration for this input by returning empty replacements
977
+ }
972
978
  let optionsLiteral = null;
973
979
  // We need an options array for the input because:
974
980
  // - the input is either aliased,
@@ -1038,7 +1044,23 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
1038
1044
  if (!modifiersWithoutInputDecorator?.some((s) => s.kind === ts.SyntaxKind.ReadonlyKeyword)) {
1039
1045
  modifiersWithoutInputDecorator.push(ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword));
1040
1046
  }
1041
- const newNode = ts.factory.createPropertyDeclaration(modifiersWithoutInputDecorator, node.name, undefined, undefined, inputInitializer);
1047
+ // Skip migration if the input is a function that references class members via 'this'
1048
+ if (inputInitializer &&
1049
+ (ts.isArrowFunction(inputInitializer) || ts.isFunctionExpression(inputInitializer))) {
1050
+ if (containsThisReferences(inputInitializer)) {
1051
+ return []; // Skip migration for this input by returning empty replacements
1052
+ }
1053
+ }
1054
+ let finalInitializer = inputInitializer;
1055
+ if (inputInitializer === undefined) {
1056
+ if (preferShorthandIfPossible === null) {
1057
+ finalInitializer = ts.factory.createIdentifier('undefined');
1058
+ }
1059
+ else {
1060
+ resolvedType = preferShorthandIfPossible.originalType;
1061
+ }
1062
+ }
1063
+ const newNode = ts.factory.createPropertyDeclaration(modifiersWithoutInputDecorator, node.name, undefined, undefined, finalInitializer);
1042
1064
  const newPropertyText = result.printer.printNode(ts.EmitHint.Unspecified, newNode, node.getSourceFile());
1043
1065
  const replacements = [];
1044
1066
  if (leadingTodoText !== null) {
@@ -1082,6 +1104,43 @@ function extractTransformOfInput(transform, resolvedType, checker) {
1082
1104
  leadingTodoText,
1083
1105
  };
1084
1106
  }
1107
+ /**
1108
+ * Checks if a function node contains any references to 'this'.
1109
+ * This is used to skip migration for functions that reference class members.
1110
+ */
1111
+ function containsThisReferences(node) {
1112
+ let hasThis = false;
1113
+ const visit = (node) => {
1114
+ if (hasThis)
1115
+ return;
1116
+ if (node.kind === ts.SyntaxKind.ThisKeyword) {
1117
+ hasThis = true;
1118
+ return;
1119
+ }
1120
+ if (ts.isPropertyAccessExpression(node)) {
1121
+ const expr = node.expression;
1122
+ if (ts.isIdentifier(expr) && expr.text === 'this') {
1123
+ hasThis = true;
1124
+ return;
1125
+ }
1126
+ }
1127
+ ts.forEachChild(node, visit);
1128
+ };
1129
+ if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
1130
+ if (node.body) {
1131
+ if (node.body.kind === ts.SyntaxKind.Block) {
1132
+ node.body.statements.forEach(visit);
1133
+ }
1134
+ else {
1135
+ visit(node.body);
1136
+ }
1137
+ }
1138
+ }
1139
+ else {
1140
+ ts.forEachChild(node, visit);
1141
+ }
1142
+ return hasThis;
1143
+ }
1085
1144
 
1086
1145
  /**
1087
1146
  * Phase that migrates `@Input()` declarations to signal inputs and
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
9
+ var project_tsconfig_paths = require('./project_tsconfig_paths-sFatqIE5.cjs');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
- var index$1 = require('./index-BI97t1U8.cjs');
12
+ var index$1 = require('./index-DCfgOEYE.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-Cz4x-QiT.cjs');
16
- var apply_import_manager = require('./apply_import_manager-DroqamMP.cjs');
17
- var migrate_ts_type_references = require('./migrate_ts_type_references-DPuwhGod.cjs');
15
+ var project_paths = require('./project_paths-i0Wjiiq1.cjs');
16
+ var apply_import_manager = require('./apply_import_manager-pLtndDki.cjs');
17
+ var migrate_ts_type_references = require('./migrate_ts_type_references-COE6BA7E.cjs');
18
18
  var assert = require('assert');
19
- var index = require('./index-DaB-z4lP.cjs');
19
+ var index = require('./index-bqpULzLD.cjs');
20
20
  require('@angular-devkit/core');
21
21
  require('node:path/posix');
22
22
  require('fs');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -10,7 +10,7 @@ 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('./project_tsconfig_paths-Clg7WX1w.cjs');
13
+ require('./project_tsconfig_paths-sFatqIE5.cjs');
14
14
  require('typescript');
15
15
  require('os');
16
16
  require('fs');
@@ -18,14 +18,14 @@ require('module');
18
18
  require('path');
19
19
  require('url');
20
20
  require('@angular-devkit/core');
21
- require('./index-BI97t1U8.cjs');
21
+ require('./index-DCfgOEYE.cjs');
22
22
  require('node:path');
23
- require('./project_paths-Cz4x-QiT.cjs');
23
+ require('./project_paths-i0Wjiiq1.cjs');
24
24
  require('node:path/posix');
25
- require('./apply_import_manager-DroqamMP.cjs');
26
- require('./migrate_ts_type_references-DPuwhGod.cjs');
25
+ require('./apply_import_manager-pLtndDki.cjs');
26
+ require('./migrate_ts_type_references-COE6BA7E.cjs');
27
27
  require('assert');
28
- require('./index-DaB-z4lP.cjs');
28
+ require('./index-bqpULzLD.cjs');
29
29
  require('./leading_space-D9nQ8UQC.cjs');
30
30
 
31
31
  function migrate(options) {
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
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-BI97t1U8.cjs');
10
+ var index = require('./index-DCfgOEYE.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-aKaS4KRz.cjs');
15
- var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
14
+ var compiler_host = require('./compiler_host-BJEh7-L1.cjs');
15
+ var project_tsconfig_paths = require('./project_tsconfig_paths-sFatqIE5.cjs');
16
16
  var ng_decorators = require('./ng_decorators-BI0uV7KI.cjs');
17
17
  var nodes = require('./nodes-B16H9JUd.cjs');
18
18
  var symbol = require('./symbol-BObKoqes.cjs');
@@ -402,9 +402,16 @@ function getComponentImportExpressions(decl, allDeclarations, tracker, typeCheck
402
402
  const importLocation = findImportLocation(dep, decl, usedDependenciesInMigration.has(dep)
403
403
  ? project_tsconfig_paths.PotentialImportMode.ForceDirect
404
404
  : project_tsconfig_paths.PotentialImportMode.Normal, typeChecker);
405
- if (importLocation && !seenImports.has(importLocation.symbolName)) {
406
- seenImports.add(importLocation.symbolName);
407
- resolvedDependencies.push(importLocation);
405
+ if (importLocation) {
406
+ // Create a unique key that includes both the symbol name and module specifier
407
+ // to handle cases where the same symbol name is imported from different modules
408
+ const importKey = importLocation.moduleSpecifier
409
+ ? `${importLocation.symbolName}::${importLocation.moduleSpecifier}`
410
+ : importLocation.symbolName;
411
+ if (!seenImports.has(importKey)) {
412
+ seenImports.add(importKey);
413
+ resolvedDependencies.push(importLocation);
414
+ }
408
415
  }
409
416
  }
410
417
  return potentialImportsToExpressions(resolvedDependencies, decl.getSourceFile(), tracker, importRemapper);
@@ -470,33 +477,42 @@ function moveDeclarationsToImports(literal, allDeclarations, typeChecker, templa
470
477
  ts.isArrayLiteralExpression(prop.initializer) &&
471
478
  prop.initializer.elements.hasTrailingComma);
472
479
  // Separate the declarations that we want to keep and ones we need to copy into the `imports`.
473
- if (ts.isPropertyAssignment(declarationsProp)) {
474
- // If the declarations are an array, we can analyze it to
475
- // find any classes from the current migration.
476
- if (ts.isArrayLiteralExpression(declarationsProp.initializer)) {
477
- for (const el of declarationsProp.initializer.elements) {
478
- if (ts.isIdentifier(el)) {
479
- const correspondingClass = findClassDeclaration(el, typeChecker);
480
- if (!correspondingClass ||
481
- // Check whether the declaration is either standalone already or is being converted
482
- // in this migration. We need to check if it's standalone already, in order to correct
483
- // some cases where the main app and the test files are being migrated in separate
484
- // programs.
485
- isStandaloneDeclaration(correspondingClass, allDeclarations, templateTypeChecker)) {
486
- declarationsToCopy.push(el);
480
+ if (ts.isPropertyAssignment(declarationsProp) ||
481
+ ts.isShorthandPropertyAssignment(declarationsProp)) {
482
+ // Handle both regular and shorthand property assignments
483
+ if (ts.isPropertyAssignment(declarationsProp)) {
484
+ // If the declarations are an array, we can analyze it to
485
+ // find any classes from the current migration.
486
+ if (ts.isArrayLiteralExpression(declarationsProp.initializer)) {
487
+ for (const el of declarationsProp.initializer.elements) {
488
+ if (ts.isIdentifier(el)) {
489
+ const correspondingClass = findClassDeclaration(el, typeChecker);
490
+ if (!correspondingClass ||
491
+ // Check whether the declaration is either standalone already or is being converted
492
+ // in this migration. We need to check if it's standalone already, in order to correct
493
+ // some cases where the main app and the test files are being migrated in separate
494
+ // programs.
495
+ isStandaloneDeclaration(correspondingClass, allDeclarations, templateTypeChecker)) {
496
+ declarationsToCopy.push(el);
497
+ }
498
+ else {
499
+ declarationsToPreserve.push(el);
500
+ }
487
501
  }
488
502
  else {
489
- declarationsToPreserve.push(el);
503
+ declarationsToCopy.push(el);
490
504
  }
491
505
  }
492
- else {
493
- declarationsToCopy.push(el);
494
- }
506
+ }
507
+ else {
508
+ // Otherwise create a spread that will be copied into the `imports`.
509
+ declarationsToCopy.push(ts.factory.createSpreadElement(declarationsProp.initializer));
495
510
  }
496
511
  }
497
512
  else {
498
- // Otherwise create a spread that will be copied into the `imports`.
499
- declarationsToCopy.push(ts.factory.createSpreadElement(declarationsProp.initializer));
513
+ // For shorthand properties, treat them as unanalyzable and use spread syntax
514
+ // shorthand properties were being ignored, now they're detected and treated as spreads
515
+ declarationsToCopy.push(ts.factory.createSpreadElement(declarationsProp.name));
500
516
  }
501
517
  }
502
518
  // If there are no `imports`, create them with the declarations we want to copy.
@@ -504,35 +520,38 @@ function moveDeclarationsToImports(literal, allDeclarations, typeChecker, templa
504
520
  properties.push(ts.factory.createPropertyAssignment('imports', ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray(declarationsToCopy, hasAnyArrayTrailingComma && declarationsToCopy.length > 2))));
505
521
  }
506
522
  for (const prop of literal.properties) {
507
- if (!isNamedPropertyAssignment(prop)) {
523
+ if (!isNamedPropertyAssignment(prop) && !ts.isShorthandPropertyAssignment(prop)) {
508
524
  properties.push(prop);
509
525
  continue;
510
526
  }
511
527
  // If we have declarations to preserve, update the existing property, otherwise drop it.
512
528
  if (prop === declarationsProp) {
513
529
  if (declarationsToPreserve.length > 0) {
514
- const hasTrailingComma = ts.isArrayLiteralExpression(prop.initializer)
530
+ const hasTrailingComma = ts.isPropertyAssignment(prop) && ts.isArrayLiteralExpression(prop.initializer)
515
531
  ? prop.initializer.elements.hasTrailingComma
516
532
  : hasAnyArrayTrailingComma;
517
- properties.push(ts.factory.updatePropertyAssignment(prop, prop.name, ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray(declarationsToPreserve, hasTrailingComma && declarationsToPreserve.length > 2))));
533
+ properties.push(ts.factory.createPropertyAssignment(prop.name, ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray(declarationsToPreserve, hasTrailingComma && declarationsToPreserve.length > 2))));
518
534
  }
519
535
  continue;
520
536
  }
521
537
  // If we have an `imports` array and declarations
522
538
  // that should be copied, we merge the two arrays.
523
539
  if (prop === importsProp && declarationsToCopy.length > 0) {
524
- let initializer;
525
- if (ts.isArrayLiteralExpression(prop.initializer)) {
526
- initializer = ts.factory.updateArrayLiteralExpression(prop.initializer, ts.factory.createNodeArray([...prop.initializer.elements, ...declarationsToCopy], prop.initializer.elements.hasTrailingComma));
527
- }
528
- else {
529
- initializer = ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray([ts.factory.createSpreadElement(prop.initializer), ...declarationsToCopy],
530
- // Expect the declarations to be greater than 1 since
531
- // we have the pre-existing initializer already.
532
- hasAnyArrayTrailingComma && declarationsToCopy.length > 1));
540
+ // Only regular property assignments have initializers that we can merge
541
+ if (ts.isPropertyAssignment(prop)) {
542
+ let initializer;
543
+ if (ts.isArrayLiteralExpression(prop.initializer)) {
544
+ initializer = ts.factory.updateArrayLiteralExpression(prop.initializer, ts.factory.createNodeArray([...prop.initializer.elements, ...declarationsToCopy], prop.initializer.elements.hasTrailingComma));
545
+ }
546
+ else {
547
+ initializer = ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray([ts.factory.createSpreadElement(prop.initializer), ...declarationsToCopy],
548
+ // Expect the declarations to be greater than 1 since
549
+ // we have the pre-existing initializer already.
550
+ hasAnyArrayTrailingComma && declarationsToCopy.length > 1));
551
+ }
552
+ properties.push(ts.factory.updatePropertyAssignment(prop, prop.name, initializer));
553
+ continue;
533
554
  }
534
- properties.push(ts.factory.updatePropertyAssignment(prop, prop.name, initializer));
535
- continue;
536
555
  }
537
556
  // Retain any remaining properties.
538
557
  properties.push(prop);
@@ -642,8 +661,14 @@ function findImportLocation(target, inContext, importMode, typeChecker) {
642
661
  * but not `declarations: []`.
643
662
  */
644
663
  function hasNgModuleMetadataElements(node) {
645
- return (ts.isPropertyAssignment(node) &&
646
- (!ts.isArrayLiteralExpression(node.initializer) || node.initializer.elements.length > 0));
664
+ if (ts.isPropertyAssignment(node)) {
665
+ return !ts.isArrayLiteralExpression(node.initializer) || node.initializer.elements.length > 0;
666
+ }
667
+ if (ts.isShorthandPropertyAssignment(node)) {
668
+ // For shorthand properties, we assume they have elements since they reference a variable
669
+ return true;
670
+ }
671
+ return false;
647
672
  }
648
673
  /** Finds all modules whose declarations can be migrated. */
649
674
  function findNgModuleClassesToMigrate(sourceFile, typeChecker) {
@@ -820,6 +845,7 @@ function analyzeTestingModules(testObjects, typeChecker) {
820
845
  const importsProp = findLiteralProperty(obj, 'imports');
821
846
  const importElements = importsProp &&
822
847
  hasNgModuleMetadataElements(importsProp) &&
848
+ ts.isPropertyAssignment(importsProp) &&
823
849
  ts.isArrayLiteralExpression(importsProp.initializer)
824
850
  ? importsProp.initializer.elements.filter((el) => {
825
851
  // Filter out calls since they may be a `ModuleWithProviders`.
@@ -864,6 +890,7 @@ function extractDeclarationsFromTestObject(obj, typeChecker) {
864
890
  const declarations = findLiteralProperty(obj, 'declarations');
865
891
  if (declarations &&
866
892
  hasNgModuleMetadataElements(declarations) &&
893
+ ts.isPropertyAssignment(declarations) &&
867
894
  ts.isArrayLiteralExpression(declarations.initializer)) {
868
895
  for (const element of declarations.initializer.elements) {
869
896
  const declaration = findClassDeclaration(element, typeChecker);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.4
3
+ * @license Angular v21.0.0-next.6
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -3,8 +3,7 @@
3
3
  "control-flow-migration": {
4
4
  "version": "21.0.0",
5
5
  "description": "Converts the entire application to block control flow syntax",
6
- "factory": "./bundles/control-flow-migration.cjs#migrate",
7
- "optional": true
6
+ "factory": "./bundles/control-flow-migration.cjs#migrate"
8
7
  },
9
8
  "router-current-navigation": {
10
9
  "version": "21.0.0",
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.4
2
+ * @license Angular v21.0.0-next.6
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { OutputRef, OutputRefSubscription, DestroyRef, Signal, WritableSignal, ValueEqualityFn, Injector } from './chrome_dev_tools_performance.d.js';
7
+ import { OutputRef, OutputRefSubscription, DestroyRef, Signal, WritableSignal, ValueEqualityFn, Injector } from './_chrome_dev_tools_performance-chunk.js';
8
8
 
9
9
  /**
10
10
  * An `OutputEmitterRef` is created by the `output()` function and can be
@@ -139,7 +139,8 @@ interface Resource<T> {
139
139
  *
140
140
  * This function is reactive.
141
141
  */
142
- hasValue(): this is Resource<Exclude<T, undefined>>;
142
+ hasValue(this: T extends undefined ? this : never): this is Resource<Exclude<T, undefined>>;
143
+ hasValue(): boolean;
143
144
  }
144
145
  /**
145
146
  * A `Resource` with a mutable value.
@@ -150,7 +151,8 @@ interface Resource<T> {
150
151
  */
151
152
  interface WritableResource<T> extends Resource<T> {
152
153
  readonly value: WritableSignal<T>;
153
- hasValue(): this is WritableResource<Exclude<T, undefined>>;
154
+ hasValue(this: T extends undefined ? this : never): this is WritableResource<Exclude<T, undefined>>;
155
+ hasValue(): boolean;
154
156
  /**
155
157
  * Convenience wrapper for `value.set`.
156
158
  */
@@ -176,7 +178,8 @@ interface WritableResource<T> extends Resource<T> {
176
178
  * @experimental
177
179
  */
178
180
  interface ResourceRef<T> extends WritableResource<T> {
179
- hasValue(): this is ResourceRef<Exclude<T, undefined>>;
181
+ hasValue(this: T extends undefined ? this : never): this is ResourceRef<Exclude<T, undefined>>;
182
+ hasValue(): boolean;
180
183
  /**
181
184
  * Manually destroy the resource, which cancels pending requests and returns it to `idle` state.
182
185
  */
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.4
2
+ * @license Angular v21.0.0-next.6
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { SIGNAL } from './graph.d.js';
8
- import { EventContract } from './event_dispatcher.d.js';
7
+ import { SIGNAL } from './_formatter-chunk.js';
8
+ import { EventContract } from './_event_dispatcher-chunk.js';
9
9
 
10
10
  /**
11
11
  * A reactive value which notifies consumers of any changes.
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.4
2
+ * @license Angular v21.0.0-next.6
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { InjectionToken, Type, ValueProvider, ExistingProvider, FactoryProvider, ConstructorProvider, StaticClassProvider, ClassProvider, EnvironmentProviders, Injector, ProviderToken, InjectOptions, Provider, ProcessProvidersFunction, ModuleWithProviders, DestroyRef, InternalInjectFlags, WritableSignal, OutputRef, StaticProvider } from './chrome_dev_tools_performance.d.js';
7
+ import { InjectionToken, Type, ValueProvider, ExistingProvider, FactoryProvider, ConstructorProvider, StaticClassProvider, ClassProvider, EnvironmentProviders, Injector, ProviderToken, InjectOptions, Provider, ProcessProvidersFunction, ModuleWithProviders, DestroyRef, InternalInjectFlags, WritableSignal, OutputRef, StaticProvider } from './_chrome_dev_tools_performance-chunk.js';
8
8
  import { Observable, Subject, Subscription } from 'rxjs';
9
- import './event_dispatcher.d.js';
10
- import { SignalNode, BaseEffectNode } from './effect.d.js';
9
+ import './_event_dispatcher-chunk.js';
10
+ import { ReactiveNode } from './_formatter-chunk.js';
11
+ import { SignalNode, BaseEffectNode } from './_effect-chunk.js';
11
12
  import { Injector as Injector$1, InjectionToken as InjectionToken$1, NotFound } from '@angular/core/primitives/di';
12
- import { ReactiveNode } from './graph.d.js';
13
13
 
14
14
  /**
15
15
  * Reactive node type for an input signal. An input signal extends a signal.
@@ -70,7 +70,7 @@ type AnimationFunction = (event: AnimationCallbackEvent) => void;
70
70
  interface AnimationLViewData {
71
71
  enter?: Function[];
72
72
  leave?: (() => Promise<void>)[];
73
- running?: Promise<PromiseSettledResult<void>[]>;
73
+ running?: Promise<unknown>;
74
74
  skipLeaveAnimations?: boolean;
75
75
  }
76
76
 
@@ -3640,9 +3640,10 @@ declare abstract class Renderer2 {
3640
3640
  * @param parent The parent node.
3641
3641
  * @param oldChild The child node to remove.
3642
3642
  * @param isHostElement Optionally signal to the renderer whether this element is a host element
3643
- * or not
3643
+ * @param requireSynchronousElementRemoval Optionally signal to the renderer whether this element
3644
+ * needs synchronous removal
3644
3645
  */
3645
- abstract removeChild(parent: any, oldChild: any, isHostElement?: boolean): void;
3646
+ abstract removeChild(parent: any, oldChild: any, isHostElement?: boolean, requireSynchronousElementRemoval?: boolean): void;
3646
3647
  /**
3647
3648
  * Implement this callback to prepare an element to be bootstrapped
3648
3649
  * as a root element, and return the element instance.
@@ -3787,7 +3788,7 @@ interface Renderer {
3787
3788
  destroyNode?: ((node: RNode) => void) | null;
3788
3789
  appendChild(parent: RElement, newChild: RNode): void;
3789
3790
  insertBefore(parent: RNode, newChild: RNode, refChild: RNode | null, isMove?: boolean): void;
3790
- removeChild(parent: RElement | null, oldChild: RNode, isHostElement?: boolean): void;
3791
+ removeChild(parent: RElement | null, oldChild: RNode, isHostElement?: boolean, requireSynchronousElementRemoval?: boolean): void;
3791
3792
  selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): RElement;
3792
3793
  parentNode(node: RNode): RElement | null;
3793
3794
  nextSibling(node: RNode): RNode | null;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.4
2
+ * @license Angular v21.0.0-next.6
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { ReactiveNode, ValueEqualityFn, SIGNAL, ReactiveHookFn } from './graph.d.js';
7
+ import { ReactiveNode, ValueEqualityFn, SIGNAL, ReactiveHookFn } from './_formatter-chunk.js';
8
8
 
9
9
  interface SignalNode<T> extends ReactiveNode {
10
10
  value: T;
@@ -30,7 +30,6 @@ declare function runPostSignalSetFn<T>(node: SignalNode<T>): void;
30
30
  declare const SIGNAL_NODE: SignalNode<unknown>;
31
31
 
32
32
  interface BaseEffectNode extends ReactiveNode {
33
- hasRun: boolean;
34
33
  fn: () => void;
35
34
  destroy(): void;
36
35
  cleanup(): void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.4
2
+ * @license Angular v21.0.0-next.6
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */