@angular/core 21.0.0-next.0 → 21.0.0-next.1

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 (64) hide show
  1. package/api.d.d.ts +1 -1
  2. package/chrome_dev_tools_performance.d.d.ts +2 -17
  3. package/discovery.d.d.ts +8 -26
  4. package/{signal.d.d.ts → effect.d.d.ts} +13 -3
  5. package/event_dispatcher.d.d.ts +1 -1
  6. package/fesm2022/attribute.mjs +1 -1
  7. package/fesm2022/core.mjs +5 -5
  8. package/fesm2022/core.mjs.map +1 -1
  9. package/fesm2022/debug_node.mjs +49 -53
  10. package/fesm2022/debug_node.mjs.map +1 -1
  11. package/fesm2022/{untracked.mjs → effect.mjs} +29 -4
  12. package/fesm2022/effect.mjs.map +1 -0
  13. package/fesm2022/not_found.mjs +1 -1
  14. package/fesm2022/primitives/di.mjs +1 -1
  15. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  16. package/fesm2022/primitives/signals.mjs +2 -2
  17. package/fesm2022/resource.mjs +18 -27
  18. package/fesm2022/resource.mjs.map +1 -1
  19. package/fesm2022/root_effect_scheduler.mjs +2 -8
  20. package/fesm2022/root_effect_scheduler.mjs.map +1 -1
  21. package/fesm2022/rxjs-interop.mjs +2 -2
  22. package/fesm2022/signal.mjs +1 -1
  23. package/fesm2022/testing.mjs +1 -1
  24. package/fesm2022/weak_ref.mjs +1 -1
  25. package/graph.d.d.ts +1 -1
  26. package/index.d.ts +5 -12
  27. package/package.json +2 -2
  28. package/primitives/di/index.d.ts +1 -1
  29. package/primitives/event-dispatch/index.d.ts +1 -1
  30. package/primitives/signals/index.d.ts +3 -3
  31. package/rxjs-interop/index.d.ts +1 -1
  32. package/schematics/bundles/{apply_import_manager-DR9xXCle.cjs → apply_import_manager-yycO3l8f.cjs} +3 -3
  33. package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
  34. package/schematics/bundles/{compiler_host-BXBP7CE2.cjs → compiler_host-DrXTGf_7.cjs} +2 -2
  35. package/schematics/bundles/control-flow-migration.cjs +13 -41
  36. package/schematics/bundles/{imports-CIX-JgAN.cjs → imports-26VeX8i-.cjs} +2 -1
  37. package/schematics/bundles/{index-CfTQUOiz.cjs → index-BdH2rlWJ.cjs} +4 -4
  38. package/schematics/bundles/{index-esqfDjNB.cjs → index-jjHOgYYs.cjs} +12 -12
  39. package/schematics/bundles/inject-migration.cjs +5 -5
  40. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  41. package/schematics/bundles/{migrate_ts_type_references-6NtAj-Wk.cjs → migrate_ts_type_references-BVSg43hf.cjs} +5 -5
  42. package/schematics/bundles/ng_component_template-DjLc4mdL.cjs +186 -0
  43. package/schematics/bundles/{ng_decorators-B5HCqr20.cjs → ng_decorators-CtYwz9Lw.cjs} +2 -2
  44. package/schematics/bundles/ngclass-to-class-migration.cjs +533 -0
  45. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  46. package/schematics/bundles/output-migration.cjs +6 -6
  47. package/schematics/bundles/parse_html-CXR8hziE.cjs +41 -0
  48. package/schematics/bundles/{project_paths-DcaODbky.cjs → project_paths-T_M15e2g.cjs} +3 -3
  49. package/schematics/bundles/{project_tsconfig_paths-CS-eSeHC.cjs → project_tsconfig_paths-D7xzGqRi.cjs} +28 -5
  50. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  51. package/schematics/bundles/route-lazy-loading.cjs +3 -3
  52. package/schematics/bundles/router-current-navigation.cjs +5 -5
  53. package/schematics/bundles/router-last-successful-navigation.cjs +5 -5
  54. package/schematics/bundles/self-closing-tags-migration.cjs +11 -207
  55. package/schematics/bundles/signal-input-migration.cjs +7 -7
  56. package/schematics/bundles/signal-queries-migration.cjs +7 -7
  57. package/schematics/bundles/signals.cjs +7 -7
  58. package/schematics/bundles/standalone-migration.cjs +6 -6
  59. package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
  60. package/schematics/collection.json +6 -0
  61. package/schematics/migrations/ngclass-to-class-migration/schema.json +20 -0
  62. package/testing/index.d.ts +2 -2
  63. package/weak_ref.d.d.ts +1 -1
  64. package/fesm2022/untracked.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.0
3
+ * @license Angular v21.0.0-next.1
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -25369,8 +25369,13 @@ function hasPipe(root) {
25369
25369
  *
25370
25370
  * 1. Unary operators in the base of an exponentiation expression. For example, `-2 ** 3` is not
25371
25371
  * valid JavaScript, but `(-2) ** 3` is.
25372
+ *
25372
25373
  * 2. When mixing nullish coalescing (`??`) and logical and/or operators (`&&`, `||`), we need
25373
25374
  * parentheses. For example, `a ?? b && c` is not valid JavaScript, but `a ?? (b && c)` is.
25375
+ * Note: Because of the outcome of https://github.com/microsoft/TypeScript/issues/62307
25376
+ * We need (for now) to keep parentheses around the `??` operator when it is used with and/or operators.
25377
+ * For example, `a ?? b && c` is not valid JavaScript, but `(a ?? b) && c` is.
25378
+ *
25374
25379
  * 3. Ternary expression used as an operand for nullish coalescing. Typescript generates incorrect
25375
25380
  * code if the parentheses are missing. For example when `(a ? b : c) ?? d` is translated to
25376
25381
  * typescript AST, the parentheses node is removed, and then the remaining AST is printed, it
@@ -25393,6 +25398,11 @@ function stripNonrequiredParentheses(job) {
25393
25398
  case BinaryOperator.NullishCoalesce:
25394
25399
  checkNullishCoalescingParens(expr, requiredParens);
25395
25400
  break;
25401
+ // these 2 cases can be dropped if the regression introduced in 5.9.2 is fixed
25402
+ // see https://github.com/microsoft/TypeScript/issues/62307
25403
+ case BinaryOperator.And:
25404
+ case BinaryOperator.Or:
25405
+ checkAndOrParens(expr, requiredParens);
25396
25406
  }
25397
25407
  }
25398
25408
  });
@@ -25425,6 +25435,13 @@ function checkNullishCoalescingParens(expr, requiredParens) {
25425
25435
  requiredParens.add(expr.rhs);
25426
25436
  }
25427
25437
  }
25438
+ function checkAndOrParens(expr, requiredParens) {
25439
+ if (expr.lhs instanceof ParenthesizedExpr &&
25440
+ expr.lhs.expr instanceof BinaryOperatorExpr &&
25441
+ expr.lhs.expr.operator === BinaryOperator.NullishCoalesce) {
25442
+ requiredParens.add(expr.lhs);
25443
+ }
25444
+ }
25428
25445
  function isLogicalAndOr(expr) {
25429
25446
  return (expr instanceof BinaryOperatorExpr &&
25430
25447
  (expr.operator === BinaryOperator.And || expr.operator === BinaryOperator.Or));
@@ -29793,6 +29810,12 @@ class HtmlAstToIvyAst {
29793
29810
  }
29794
29811
  return directives;
29795
29812
  }
29813
+ filterAnimationAttributes(attributes) {
29814
+ return attributes.filter((a) => !a.name.startsWith('animate.'));
29815
+ }
29816
+ filterAnimationInputs(attributes) {
29817
+ return attributes.filter((a) => a.type !== exports.BindingType.Animation);
29818
+ }
29796
29819
  wrapInTemplate(node, templateProperties, templateVariables, i18nAttrsMeta, isTemplateElement, isI18nRootElement) {
29797
29820
  // We need to hoist the attributes of the node to the template for content projection purposes.
29798
29821
  const attrs = this.categorizePropertyAttributes('ng-template', templateProperties, i18nAttrsMeta);
@@ -29805,8 +29828,8 @@ class HtmlAstToIvyAst {
29805
29828
  outputs: [],
29806
29829
  };
29807
29830
  if (node instanceof Element$1 || node instanceof Component$1) {
29808
- hoistedAttrs.attributes.push(...node.attributes);
29809
- hoistedAttrs.inputs.push(...node.inputs);
29831
+ hoistedAttrs.attributes.push(...this.filterAnimationAttributes(node.attributes));
29832
+ hoistedAttrs.inputs.push(...this.filterAnimationInputs(node.inputs));
29810
29833
  hoistedAttrs.outputs.push(...node.outputs);
29811
29834
  }
29812
29835
  // For <ng-template>s with structural directives on them, avoid passing i18n information to
@@ -32817,7 +32840,7 @@ function isAttrNode(ast) {
32817
32840
  * @description
32818
32841
  * Entry point for all public APIs of the compiler package.
32819
32842
  */
32820
- new Version('21.0.0-next.0');
32843
+ new Version('21.0.0-next.1');
32821
32844
 
32822
32845
  //////////////////////////////////////
32823
32846
  // THIS FILE HAS GLOBAL SIDE EFFECT //
@@ -33853,7 +33876,7 @@ class NodeJSPathManipulation {
33853
33876
  // G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
33854
33877
  // CommonJS/ESM interop for determining the current file name and containing dir.
33855
33878
  const isCommonJS = typeof __filename !== 'undefined';
33856
- const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-CS-eSeHC.cjs', document.baseURI).href));
33879
+ const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-D7xzGqRi.cjs', document.baseURI).href));
33857
33880
  // Note, when this code loads in the browser, `url` may be an empty `{}` due to the Closure shims.
33858
33881
  const currentFileName = isCommonJS
33859
33882
  ? __filename
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.0
3
+ * @license Angular v21.0.0-next.1
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.0
3
+ * @license Angular v21.0.0-next.1
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-BXBP7CE2.cjs');
13
- var project_tsconfig_paths = require('./project_tsconfig_paths-CS-eSeHC.cjs');
12
+ var compiler_host = require('./compiler_host-DrXTGf_7.cjs');
13
+ var project_tsconfig_paths = require('./project_tsconfig_paths-D7xzGqRi.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.0
3
+ * @license Angular v21.0.0-next.1
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,12 +8,12 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- require('./project_tsconfig_paths-CS-eSeHC.cjs');
12
- require('./index-esqfDjNB.cjs');
11
+ require('./project_tsconfig_paths-D7xzGqRi.cjs');
12
+ require('./index-jjHOgYYs.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-DcaODbky.cjs');
16
- var imports = require('./imports-CIX-JgAN.cjs');
15
+ var project_paths = require('./project_paths-T_M15e2g.cjs');
16
+ var imports = require('./imports-26VeX8i-.cjs');
17
17
  var symbol = require('./symbol-VPWguRxr.cjs');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.0
3
+ * @license Angular v21.0.0-next.1
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,12 +8,12 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- require('./project_tsconfig_paths-CS-eSeHC.cjs');
12
- require('./index-esqfDjNB.cjs');
11
+ require('./project_tsconfig_paths-D7xzGqRi.cjs');
12
+ require('./index-jjHOgYYs.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-DcaODbky.cjs');
16
- var imports = require('./imports-CIX-JgAN.cjs');
15
+ var project_paths = require('./project_paths-T_M15e2g.cjs');
16
+ var imports = require('./imports-26VeX8i-.cjs');
17
17
  var symbol = require('./symbol-VPWguRxr.cjs');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.0
3
+ * @license Angular v21.0.0-next.1
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,221 +8,25 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var project_tsconfig_paths = require('./project_tsconfig_paths-CS-eSeHC.cjs');
12
- require('./index-esqfDjNB.cjs');
11
+ var project_tsconfig_paths = require('./project_tsconfig_paths-D7xzGqRi.cjs');
12
+ require('./index-jjHOgYYs.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-DcaODbky.cjs');
16
- var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
17
- var property_name = require('./property_name-BBwFuqMe.cjs');
15
+ var project_paths = require('./project_paths-T_M15e2g.cjs');
16
+ var ng_component_template = require('./ng_component_template-DjLc4mdL.cjs');
17
+ var parse_html = require('./parse_html-CXR8hziE.cjs');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
20
20
  require('fs');
21
21
  require('module');
22
22
  require('url');
23
23
  require('@angular-devkit/schematics');
24
- require('./imports-CIX-JgAN.cjs');
25
-
26
- /**
27
- * Unwraps a given expression TypeScript node. Expressions can be wrapped within multiple
28
- * parentheses or as expression. e.g. "(((({exp}))))()". The function should return the
29
- * TypeScript node referring to the inner expression. e.g "exp".
30
- */
31
- function unwrapExpression(node) {
32
- if (ts.isParenthesizedExpression(node) || ts.isAsExpression(node)) {
33
- return unwrapExpression(node.expression);
34
- }
35
- else {
36
- return node;
37
- }
38
- }
39
-
40
- /** Extracts `@Directive` or `@Component` metadata from the given class. */
41
- function extractAngularClassMetadata(typeChecker, node) {
42
- const decorators = ts.getDecorators(node);
43
- if (!decorators || !decorators.length) {
44
- return null;
45
- }
46
- const ngDecorators = ng_decorators.getAngularDecorators(typeChecker, decorators);
47
- const componentDecorator = ngDecorators.find((dec) => dec.name === 'Component');
48
- const directiveDecorator = ngDecorators.find((dec) => dec.name === 'Directive');
49
- const decorator = componentDecorator ?? directiveDecorator;
50
- // In case no decorator could be found on the current class, skip.
51
- if (!decorator) {
52
- return null;
53
- }
54
- const decoratorCall = decorator.node.expression;
55
- // In case the decorator call is not valid, skip this class declaration.
56
- if (decoratorCall.arguments.length !== 1) {
57
- return null;
58
- }
59
- const metadata = unwrapExpression(decoratorCall.arguments[0]);
60
- // Ensure that the metadata is an object literal expression.
61
- if (!ts.isObjectLiteralExpression(metadata)) {
62
- return null;
63
- }
64
- return {
65
- type: componentDecorator ? 'component' : 'directive',
66
- node: metadata,
67
- };
68
- }
69
-
70
- const LF_CHAR = 10;
71
- const CR_CHAR = 13;
72
- const LINE_SEP_CHAR = 8232;
73
- const PARAGRAPH_CHAR = 8233;
74
- /** Gets the line and character for the given position from the line starts map. */
75
- function getLineAndCharacterFromPosition(lineStartsMap, position) {
76
- const lineIndex = findClosestLineStartPosition(lineStartsMap, position);
77
- return { character: position - lineStartsMap[lineIndex], line: lineIndex };
78
- }
79
- /**
80
- * Computes the line start map of the given text. This can be used in order to
81
- * retrieve the line and character of a given text position index.
82
- */
83
- function computeLineStartsMap(text) {
84
- const result = [0];
85
- let pos = 0;
86
- while (pos < text.length) {
87
- const char = text.charCodeAt(pos++);
88
- // Handles the "CRLF" line break. In that case we peek the character
89
- // after the "CR" and check if it is a line feed.
90
- if (char === CR_CHAR) {
91
- if (text.charCodeAt(pos) === LF_CHAR) {
92
- pos++;
93
- }
94
- result.push(pos);
95
- }
96
- else if (char === LF_CHAR || char === LINE_SEP_CHAR || char === PARAGRAPH_CHAR) {
97
- result.push(pos);
98
- }
99
- }
100
- result.push(pos);
101
- return result;
102
- }
103
- /** Finds the closest line start for the given position. */
104
- function findClosestLineStartPosition(linesMap, position, low = 0, high = linesMap.length - 1) {
105
- while (low <= high) {
106
- const pivotIdx = Math.floor((low + high) / 2);
107
- const pivotEl = linesMap[pivotIdx];
108
- if (pivotEl === position) {
109
- return pivotIdx;
110
- }
111
- else if (position > pivotEl) {
112
- low = pivotIdx + 1;
113
- }
114
- else {
115
- high = pivotIdx - 1;
116
- }
117
- }
118
- // In case there was no exact match, return the closest "lower" line index. We also
119
- // subtract the index by one because want the index of the previous line start.
120
- return low - 1;
121
- }
122
-
123
- /**
124
- * Visitor that can be used to determine Angular templates referenced within given
125
- * TypeScript source files (inline templates or external referenced templates)
126
- */
127
- class NgComponentTemplateVisitor {
128
- typeChecker;
129
- resolvedTemplates = [];
130
- fs = project_tsconfig_paths.getFileSystem();
131
- constructor(typeChecker) {
132
- this.typeChecker = typeChecker;
133
- }
134
- visitNode(node) {
135
- if (node.kind === ts.SyntaxKind.ClassDeclaration) {
136
- this.visitClassDeclaration(node);
137
- }
138
- ts.forEachChild(node, (n) => this.visitNode(n));
139
- }
140
- visitClassDeclaration(node) {
141
- const metadata = extractAngularClassMetadata(this.typeChecker, node);
142
- if (metadata === null || metadata.type !== 'component') {
143
- return;
144
- }
145
- const sourceFile = node.getSourceFile();
146
- const sourceFileName = sourceFile.fileName;
147
- // Walk through all component metadata properties and determine the referenced
148
- // HTML templates (either external or inline)
149
- metadata.node.properties.forEach((property) => {
150
- if (!ts.isPropertyAssignment(property)) {
151
- return;
152
- }
153
- const propertyName = property_name.getPropertyNameText(property.name);
154
- // In case there is an inline template specified, ensure that the value is statically
155
- // analyzable by checking if the initializer is a string literal-like node.
156
- if (propertyName === 'template' && ts.isStringLiteralLike(property.initializer)) {
157
- // Need to add an offset of one to the start because the template quotes are
158
- // not part of the template content.
159
- // The `getText()` method gives us the original raw text.
160
- // We could have used the `text` property, but if the template is defined as a backtick
161
- // string then the `text` property contains a "cooked" version of the string. Such cooked
162
- // strings will have converted CRLF characters to only LF. This messes up string
163
- // replacements in template migrations.
164
- // The raw text returned by `getText()` includes the enclosing quotes so we change the
165
- // `content` and `start` values accordingly.
166
- const content = property.initializer.getText().slice(1, -1);
167
- const start = property.initializer.getStart() + 1;
168
- this.resolvedTemplates.push({
169
- filePath: sourceFileName,
170
- container: node,
171
- content,
172
- inline: true,
173
- start: start,
174
- getCharacterAndLineOfPosition: (pos) => ts.getLineAndCharacterOfPosition(sourceFile, pos + start),
175
- });
176
- }
177
- if (propertyName === 'templateUrl' && ts.isStringLiteralLike(property.initializer)) {
178
- const absolutePath = this.fs.resolve(this.fs.dirname(sourceFileName), property.initializer.text);
179
- if (!this.fs.exists(absolutePath)) {
180
- return;
181
- }
182
- const fileContent = this.fs.readFile(absolutePath);
183
- const lineStartsMap = computeLineStartsMap(fileContent);
184
- this.resolvedTemplates.push({
185
- filePath: absolutePath,
186
- container: node,
187
- content: fileContent,
188
- inline: false,
189
- start: 0,
190
- getCharacterAndLineOfPosition: (pos) => getLineAndCharacterFromPosition(lineStartsMap, pos),
191
- });
192
- }
193
- });
194
- }
195
- }
196
-
197
- function parseTemplate(template) {
198
- let parsed;
199
- try {
200
- // Note: we use the HtmlParser here, instead of the `parseTemplate` function, because the
201
- // latter returns an Ivy AST, not an HTML AST. The HTML AST has the advantage of preserving
202
- // interpolated text as text nodes containing a mixture of interpolation tokens and text tokens,
203
- // rather than turning them into `BoundText` nodes like the Ivy AST does. This allows us to
204
- // easily get the text-only ranges without having to reconstruct the original text.
205
- parsed = new project_tsconfig_paths.HtmlParser().parse(template, '', {
206
- // Allows for ICUs to be parsed.
207
- tokenizeExpansionForms: true,
208
- // Explicitly disable blocks so that their characters are treated as plain text.
209
- tokenizeBlocks: true,
210
- preserveLineEndings: true,
211
- });
212
- // Don't migrate invalid templates.
213
- if (parsed.errors && parsed.errors.length > 0) {
214
- const errors = parsed.errors.map((e) => ({ type: 'parse', error: e }));
215
- return { tree: undefined, errors };
216
- }
217
- }
218
- catch (e) {
219
- return { tree: undefined, errors: [{ type: 'parse', error: e }] };
220
- }
221
- return { tree: parsed, errors: [] };
222
- }
24
+ require('./ng_decorators-CtYwz9Lw.cjs');
25
+ require('./imports-26VeX8i-.cjs');
26
+ require('./property_name-BBwFuqMe.cjs');
223
27
 
224
28
  function migrateTemplateToSelfClosingTags(template) {
225
- let parsed = parseTemplate(template);
29
+ let parsed = parse_html.parseTemplate(template);
226
30
  if (parsed.tree === undefined) {
227
31
  return { migrated: template, changed: false, replacementCount: 0 };
228
32
  }
@@ -305,7 +109,7 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
305
109
  if (this.config.shouldMigrate && this.config.shouldMigrate(file) === false) {
306
110
  return;
307
111
  }
308
- const templateVisitor = new NgComponentTemplateVisitor(typeChecker);
112
+ const templateVisitor = new ng_component_template.NgComponentTemplateVisitor(typeChecker);
309
113
  templateVisitor.visitNode(node);
310
114
  templateVisitor.resolvedTemplates.forEach((template) => {
311
115
  const { migrated, changed, replacementCount } = migrateTemplateToSelfClosingTags(template.content);
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.0
3
+ * @license Angular v21.0.0-next.1
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-6NtAj-Wk.cjs');
9
+ var migrate_ts_type_references = require('./migrate_ts_type_references-BVSg43hf.cjs');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-CS-eSeHC.cjs');
13
- var index$1 = require('./index-esqfDjNB.cjs');
12
+ var project_tsconfig_paths = require('./project_tsconfig_paths-D7xzGqRi.cjs');
13
+ var index$1 = require('./index-jjHOgYYs.cjs');
14
14
  require('path');
15
15
  require('node:path');
16
- var project_paths = require('./project_paths-DcaODbky.cjs');
17
- var index = require('./index-CfTQUOiz.cjs');
16
+ var project_paths = require('./project_paths-T_M15e2g.cjs');
17
+ var index = require('./index-BdH2rlWJ.cjs');
18
18
  var assert = require('assert');
19
- var apply_import_manager = require('./apply_import_manager-DR9xXCle.cjs');
19
+ var apply_import_manager = require('./apply_import_manager-yycO3l8f.cjs');
20
20
  require('@angular-devkit/core');
21
21
  require('node:path/posix');
22
22
  require('./leading_space-D9nQ8UQC.cjs');
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.0
3
+ * @license Angular v21.0.0-next.1
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-CS-eSeHC.cjs');
9
+ var project_tsconfig_paths = require('./project_tsconfig_paths-D7xzGqRi.cjs');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
- var index$1 = require('./index-esqfDjNB.cjs');
12
+ var index$1 = require('./index-jjHOgYYs.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-DcaODbky.cjs');
16
- var apply_import_manager = require('./apply_import_manager-DR9xXCle.cjs');
17
- var migrate_ts_type_references = require('./migrate_ts_type_references-6NtAj-Wk.cjs');
15
+ var project_paths = require('./project_paths-T_M15e2g.cjs');
16
+ var apply_import_manager = require('./apply_import_manager-yycO3l8f.cjs');
17
+ var migrate_ts_type_references = require('./migrate_ts_type_references-BVSg43hf.cjs');
18
18
  var assert = require('assert');
19
- var index = require('./index-CfTQUOiz.cjs');
19
+ var index = require('./index-BdH2rlWJ.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.0
3
+ * @license Angular v21.0.0-next.1
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-CS-eSeHC.cjs');
13
+ require('./project_tsconfig_paths-D7xzGqRi.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-esqfDjNB.cjs');
21
+ require('./index-jjHOgYYs.cjs');
22
22
  require('node:path');
23
- require('./project_paths-DcaODbky.cjs');
23
+ require('./project_paths-T_M15e2g.cjs');
24
24
  require('node:path/posix');
25
- require('./apply_import_manager-DR9xXCle.cjs');
26
- require('./migrate_ts_type_references-6NtAj-Wk.cjs');
25
+ require('./apply_import_manager-yycO3l8f.cjs');
26
+ require('./migrate_ts_type_references-BVSg43hf.cjs');
27
27
  require('assert');
28
- require('./index-CfTQUOiz.cjs');
28
+ require('./index-BdH2rlWJ.cjs');
29
29
  require('./leading_space-D9nQ8UQC.cjs');
30
30
 
31
31
  function migrate(options) {
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.0
3
+ * @license Angular v21.0.0-next.1
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-esqfDjNB.cjs');
10
+ var index = require('./index-jjHOgYYs.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-BXBP7CE2.cjs');
15
- var project_tsconfig_paths = require('./project_tsconfig_paths-CS-eSeHC.cjs');
16
- var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
14
+ var compiler_host = require('./compiler_host-DrXTGf_7.cjs');
15
+ var project_tsconfig_paths = require('./project_tsconfig_paths-D7xzGqRi.cjs');
16
+ var ng_decorators = require('./ng_decorators-CtYwz9Lw.cjs');
17
17
  var nodes = require('./nodes-B16H9JUd.cjs');
18
18
  var symbol = require('./symbol-VPWguRxr.cjs');
19
- var imports = require('./imports-CIX-JgAN.cjs');
19
+ var imports = require('./imports-26VeX8i-.cjs');
20
20
  require('os');
21
21
  require('module');
22
22
  require('url');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.0
3
+ * @license Angular v21.0.0-next.1
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -57,6 +57,12 @@
57
57
  "factory": "./bundles/control-flow-migration.cjs#migrate",
58
58
  "schema": "./migrations/control-flow-migration/schema.json",
59
59
  "aliases": ["control-flow"]
60
+ },
61
+ "ngclass-to-class-migration": {
62
+ "description": "Updates usages of `ngClass` directives to the `class` bindings where possible",
63
+ "factory": "./bundles/ngclass-to-class-migration.cjs#migrate",
64
+ "schema": "./migrations/ngclass-to-class-migration/schema.json",
65
+ "aliases": ["ngclass-to-class"]
60
66
  }
61
67
  }
62
68
  }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "AngularNgclassToClassMigration",
4
+ "title": "Angular ngClass to class Migration Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "path": {
8
+ "type": "string",
9
+ "description": "Path to the directory where all templates should be migrated.",
10
+ "x-prompt": "Which directory do you want to migrate?",
11
+ "default": "./"
12
+ },
13
+ "migrateSpaceSeparatedKey": {
14
+ "type": "boolean",
15
+ "description": "Enables the migration of object literals with space-separated keys",
16
+ "x-prompt": "Should the migration also migrate space-separated keys ?",
17
+ "default": "false"
18
+ }
19
+ }
20
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.0
2
+ * @license Angular v21.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -10,7 +10,7 @@ import { DeferBlockDetails, DeferBlockState, ComponentRef, DebugElement, Element
10
10
  import * as i0 from '@angular/core';
11
11
  import '../graph.d.js';
12
12
  import 'rxjs';
13
- import '../signal.d.js';
13
+ import '../effect.d.js';
14
14
  import '@angular/core/primitives/di';
15
15
 
16
16
  /**
package/weak_ref.d.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.0
2
+ * @license Angular v21.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1 +0,0 @@
1
- {"version":3,"file":"untracked.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/src/linked_signal.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/src/untracked.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {COMPUTING, ERRORED, UNSET} from './computed';\nimport {defaultEquals, ValueEqualityFn} from './equality';\nimport {\n consumerAfterComputation,\n consumerBeforeComputation,\n producerAccessed,\n producerMarkClean,\n producerUpdateValueVersion,\n REACTIVE_NODE,\n ReactiveNode,\n runPostProducerCreatedFn,\n SIGNAL,\n} from './graph';\nimport {signalSetFn, signalUpdateFn} from './signal';\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\ndeclare const ngDevMode: boolean | undefined;\n\nexport type ComputationFn<S, D> = (source: S, previous?: {source: S; value: D}) => D;\n\nexport interface LinkedSignalNode<S, D> extends ReactiveNode {\n /**\n * Value of the source signal that was used to derive the computed value.\n */\n sourceValue: S;\n\n /**\n * Current state value, or one of the sentinel values (`UNSET`, `COMPUTING`,\n * `ERROR`).\n */\n value: D;\n\n /**\n * If `value` is `ERRORED`, the error caught from the last computation attempt which will\n * be re-thrown.\n */\n error: unknown;\n\n /**\n * The source function represents reactive dependency based on which the linked state is reset.\n */\n source: () => S;\n\n /**\n * The computation function which will produce a new value based on the source and, optionally - previous values.\n */\n computation: ComputationFn<S, D>;\n\n equal: ValueEqualityFn<D>;\n}\n\nexport type LinkedSignalGetter<S, D> = (() => D) & {\n [SIGNAL]: LinkedSignalNode<S, D>;\n};\n\nexport function createLinkedSignal<S, D>(\n sourceFn: () => S,\n computationFn: ComputationFn<S, D>,\n equalityFn?: ValueEqualityFn<D>,\n): LinkedSignalGetter<S, D> {\n const node: LinkedSignalNode<S, D> = Object.create(LINKED_SIGNAL_NODE);\n\n node.source = sourceFn;\n node.computation = computationFn;\n if (equalityFn != undefined) {\n node.equal = equalityFn;\n }\n\n const linkedSignalGetter = () => {\n // Check if the value needs updating before returning it.\n producerUpdateValueVersion(node);\n\n // Record that someone looked at this signal.\n producerAccessed(node);\n\n if (node.value === ERRORED) {\n throw node.error;\n }\n\n return node.value;\n };\n\n const getter = linkedSignalGetter as LinkedSignalGetter<S, D>;\n getter[SIGNAL] = node;\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n const debugName = node.debugName ? ' (' + node.debugName + ')' : '';\n getter.toString = () => `[LinkedSignal${debugName}: ${node.value}]`;\n }\n\n runPostProducerCreatedFn(node);\n\n return getter;\n}\n\nexport function linkedSignalSetFn<S, D>(node: LinkedSignalNode<S, D>, newValue: D) {\n producerUpdateValueVersion(node);\n signalSetFn(node, newValue);\n producerMarkClean(node);\n}\n\nexport function linkedSignalUpdateFn<S, D>(\n node: LinkedSignalNode<S, D>,\n updater: (value: D) => D,\n): void {\n producerUpdateValueVersion(node);\n signalUpdateFn(node, updater);\n producerMarkClean(node);\n}\n\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `LINKED_SIGNAL_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nexport const LINKED_SIGNAL_NODE: object = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n value: UNSET,\n dirty: true,\n error: null,\n equal: defaultEquals,\n kind: 'linkedSignal',\n\n producerMustRecompute(node: LinkedSignalNode<unknown, unknown>): boolean {\n // Force a recomputation if there's no current value, or if the current value is in the\n // process of being calculated (which should throw an error).\n return node.value === UNSET || node.value === COMPUTING;\n },\n\n producerRecomputeValue(node: LinkedSignalNode<unknown, unknown>): void {\n if (node.value === COMPUTING) {\n // Our computation somehow led to a cyclic read of itself.\n throw new Error(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'Detected cycle in computations.' : '',\n );\n }\n\n const oldValue = node.value;\n node.value = COMPUTING;\n\n const prevConsumer = consumerBeforeComputation(node);\n let newValue: unknown;\n try {\n const newSourceValue = node.source();\n const prev =\n oldValue === UNSET || oldValue === ERRORED\n ? undefined\n : {\n source: node.sourceValue,\n value: oldValue,\n };\n newValue = node.computation(newSourceValue, prev);\n node.sourceValue = newSourceValue;\n } catch (err) {\n newValue = ERRORED;\n node.error = err;\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n\n if (oldValue !== UNSET && newValue !== ERRORED && node.equal(oldValue, newValue)) {\n // No change to `valueVersion` - old and new values are\n // semantically equivalent.\n node.value = oldValue;\n return;\n }\n\n node.value = newValue;\n node.version++;\n },\n };\n})();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {setActiveConsumer} from './graph';\n\n/**\n * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function\n * can, optionally, return a value.\n */\nexport function untracked<T>(nonReactiveReadsFn: () => T): T {\n const prevConsumer = setActiveConsumer(null);\n // We are not trying to catch any particular errors here, just making sure that the consumers\n // stack is restored in case of errors.\n try {\n return nonReactiveReadsFn();\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\n"],"names":[],"mappings":";;;;;;;;SAgEgB,kBAAkB,CAChC,QAAiB,EACjB,aAAkC,EAClC,UAA+B,EAAA;IAE/B,MAAM,IAAI,GAA2B,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC;AAEtE,IAAA,IAAI,CAAC,MAAM,GAAG,QAAQ;AACtB,IAAA,IAAI,CAAC,WAAW,GAAG,aAAa;AAChC,IAAA,IAAI,UAAU,IAA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