@angular/core 20.0.0-next.0 → 20.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/fesm2022/core.mjs +3307 -4479
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/di.mjs +45 -0
  4. package/fesm2022/primitives/di.mjs.map +1 -0
  5. package/fesm2022/primitives/event-dispatch.mjs +3 -590
  6. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  7. package/fesm2022/primitives/signals.mjs +19 -9
  8. package/fesm2022/primitives/signals.mjs.map +1 -1
  9. package/fesm2022/rxjs-interop.mjs +8 -33
  10. package/fesm2022/rxjs-interop.mjs.map +1 -1
  11. package/fesm2022/testing.mjs +392 -250
  12. package/fesm2022/testing.mjs.map +1 -1
  13. package/fesm2022/weak_ref-DrMdAIDh.mjs +12 -0
  14. package/fesm2022/weak_ref-DrMdAIDh.mjs.map +1 -0
  15. package/index.d.ts +14339 -15134
  16. package/navigation_types.d-u4EOrrdZ.d.ts +121 -0
  17. package/package.json +11 -1
  18. package/primitives/di/index.d.ts +91 -0
  19. package/primitives/event-dispatch/index.d.ts +206 -310
  20. package/primitives/signals/index.d.ts +159 -196
  21. package/rxjs-interop/index.d.ts +72 -92
  22. package/schematics/bundles/{apply_import_manager-0959b78c.js → apply_import_manager-CyRT0UvU.js} +13 -17
  23. package/schematics/bundles/{checker-cf6f7980.js → checker-DF8ZaFW5.js} +3363 -1289
  24. package/schematics/bundles/cleanup-unused-imports.js +22 -28
  25. package/schematics/bundles/{compiler_host-cc1379e9.js → compiler_host-Da636uJ8.js} +20 -24
  26. package/schematics/bundles/control-flow-migration.js +82 -39
  27. package/schematics/bundles/{imports-31a38653.js → imports-CIX-JgAN.js} +10 -15
  28. package/schematics/bundles/{index-42d84d69.js → index-DnkWgagp.js} +56 -60
  29. package/schematics/bundles/{index-6675d6bc.js → index-vGJcp5M7.js} +5 -5
  30. package/schematics/bundles/inject-flags.js +181 -0
  31. package/schematics/bundles/inject-migration.js +122 -128
  32. package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-D9nQ8UQC.js} +2 -2
  33. package/schematics/bundles/{migrate_ts_type_references-5089e4ef.js → migrate_ts_type_references-DtkOnnv0.js} +113 -120
  34. package/schematics/bundles/{ng_decorators-6878e227.js → ng_decorators-DznZ5jMl.js} +5 -9
  35. package/schematics/bundles/{nodes-ffdce442.js → nodes-B16H9JUd.js} +3 -7
  36. package/schematics/bundles/output-migration.js +40 -46
  37. package/schematics/bundles/{program-362689f0.js → program-BZk27Ndu.js} +846 -2653
  38. package/schematics/bundles/{project_paths-7d2daa1e.js → project_paths-Jtbi76Bs.js} +26 -24
  39. package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-CDVxT6Ov.js} +2 -2
  40. package/schematics/bundles/{property_name-42030525.js → property_name-BBwFuqMe.js} +4 -8
  41. package/schematics/bundles/route-lazy-loading.js +36 -42
  42. package/schematics/bundles/self-closing-tags-migration.js +55 -45
  43. package/schematics/bundles/signal-input-migration.js +61 -68
  44. package/schematics/bundles/signal-queries-migration.js +48 -55
  45. package/schematics/bundles/signals.js +10 -12
  46. package/schematics/bundles/standalone-migration.js +179 -185
  47. package/schematics/migrations.json +4 -15
  48. package/testing/index.d.ts +309 -478
  49. package/weak_ref.d-ttyj86RV.d.ts +9 -0
  50. package/schematics/bundles/explicit-standalone-flag.js +0 -184
  51. package/schematics/bundles/pending-tasks.js +0 -103
  52. package/schematics/bundles/provide-initializer.js +0 -186
@@ -1,43 +1,37 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.0
4
- * (c) 2010-2024 Google LLC. https://angular.io/
3
+ * @license Angular v20.0.0-next.2
4
+ * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- Object.defineProperty(exports, '__esModule', { value: true });
10
-
11
9
  var schematics = require('@angular-devkit/schematics');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
13
- var project_paths = require('./project_paths-7d2daa1e.js');
10
+ var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
11
+ var project_paths = require('./project_paths-Jtbi76Bs.js');
14
12
  require('os');
15
13
  var ts = require('typescript');
16
- var checker = require('./checker-cf6f7980.js');
17
- var program = require('./program-362689f0.js');
14
+ var checker = require('./checker-DF8ZaFW5.js');
15
+ var program = require('./program-BZk27Ndu.js');
18
16
  require('path');
19
- var apply_import_manager = require('./apply_import_manager-0959b78c.js');
20
- var index = require('./index-42d84d69.js');
17
+ var apply_import_manager = require('./apply_import_manager-CyRT0UvU.js');
18
+ var index = require('./index-DnkWgagp.js');
21
19
  require('@angular-devkit/core');
22
20
  require('node:path/posix');
23
21
  require('fs');
24
22
  require('module');
25
23
  require('url');
26
24
 
27
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
28
-
29
- var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
30
-
31
25
  function isOutputDeclarationEligibleForMigration(node) {
32
26
  return (node.initializer !== undefined &&
33
- ts__default["default"].isNewExpression(node.initializer) &&
34
- ts__default["default"].isIdentifier(node.initializer.expression) &&
27
+ ts.isNewExpression(node.initializer) &&
28
+ ts.isIdentifier(node.initializer.expression) &&
35
29
  node.initializer.expression.text === 'EventEmitter');
36
30
  }
37
31
  function isPotentialOutputCallUsage(node, name) {
38
- if (ts__default["default"].isCallExpression(node) &&
39
- ts__default["default"].isPropertyAccessExpression(node.expression) &&
40
- ts__default["default"].isIdentifier(node.expression.name)) {
32
+ if (ts.isCallExpression(node) &&
33
+ ts.isPropertyAccessExpression(node.expression) &&
34
+ ts.isIdentifier(node.expression.name)) {
41
35
  return node.expression?.name.text === name;
42
36
  }
43
37
  else {
@@ -68,8 +62,8 @@ function isTargetOutputDeclaration(node, checker, reflector, dtsReader) {
68
62
  function isOutputDeclaration(node, reflector, dtsReader) {
69
63
  // `.d.ts` file, so we check the `static ecmp` metadata on the `declare class`.
70
64
  if (node.getSourceFile().isDeclarationFile) {
71
- if (!ts__default["default"].isIdentifier(node.name) ||
72
- !ts__default["default"].isClassDeclaration(node.parent) ||
65
+ if (!ts.isIdentifier(node.name) ||
66
+ !ts.isClassDeclaration(node.parent) ||
73
67
  node.parent.name === undefined) {
74
68
  return false;
75
69
  }
@@ -82,7 +76,7 @@ function isOutputDeclaration(node, reflector, dtsReader) {
82
76
  }
83
77
  function getTargetPropertyDeclaration(targetSymbol) {
84
78
  const valDeclaration = targetSymbol.valueDeclaration;
85
- if (valDeclaration !== undefined && ts__default["default"].isPropertyDeclaration(valDeclaration)) {
79
+ if (valDeclaration !== undefined && ts.isPropertyDeclaration(valDeclaration)) {
86
80
  return valDeclaration;
87
81
  }
88
82
  return null;
@@ -101,7 +95,7 @@ function getUniqueIdForProperty(info, prop) {
101
95
  return `${id}@@${prop.parent.name ?? 'unknown-class'}@@${prop.name.getText()}`;
102
96
  }
103
97
  function isTestRunnerImport(node) {
104
- if (ts__default["default"].isImportDeclaration(node)) {
98
+ if (ts.isImportDeclaration(node)) {
105
99
  const moduleSpecifier = node.moduleSpecifier.getText();
106
100
  return moduleSpecifier.includes('jasmine') || moduleSpecifier.includes('catalyst');
107
101
  }
@@ -147,27 +141,27 @@ function checkNonTsReferenceCallsField(ref, fieldName) {
147
141
  return potentialRead;
148
142
  }
149
143
 
150
- const printer = ts__default["default"].createPrinter();
144
+ const printer = ts.createPrinter();
151
145
  function calculateDeclarationReplacement(info, node, aliasParam) {
152
146
  const sf = node.getSourceFile();
153
- const payloadTypes = node.initializer !== undefined && ts__default["default"].isNewExpression(node.initializer)
147
+ const payloadTypes = node.initializer !== undefined && ts.isNewExpression(node.initializer)
154
148
  ? node.initializer?.typeArguments
155
149
  : undefined;
156
- const outputCall = ts__default["default"].factory.createCallExpression(ts__default["default"].factory.createIdentifier('output'), payloadTypes, aliasParam !== undefined
150
+ const outputCall = ts.factory.createCallExpression(ts.factory.createIdentifier('output'), payloadTypes, aliasParam !== undefined
157
151
  ? [
158
- ts__default["default"].factory.createObjectLiteralExpression([
159
- ts__default["default"].factory.createPropertyAssignment('alias', ts__default["default"].factory.createStringLiteral(aliasParam, true)),
152
+ ts.factory.createObjectLiteralExpression([
153
+ ts.factory.createPropertyAssignment('alias', ts.factory.createStringLiteral(aliasParam, true)),
160
154
  ], false),
161
155
  ]
162
156
  : []);
163
- const existingModifiers = (node.modifiers ?? []).filter((modifier) => !ts__default["default"].isDecorator(modifier) && modifier.kind !== ts__default["default"].SyntaxKind.ReadonlyKeyword);
164
- const updatedOutputDeclaration = ts__default["default"].factory.createPropertyDeclaration(
157
+ const existingModifiers = (node.modifiers ?? []).filter((modifier) => !ts.isDecorator(modifier) && modifier.kind !== ts.SyntaxKind.ReadonlyKeyword);
158
+ const updatedOutputDeclaration = ts.factory.createPropertyDeclaration(
165
159
  // Think: this logic of dealing with modifiers is applicable to all signal-based migrations
166
- ts__default["default"].factory.createNodeArray([
160
+ ts.factory.createNodeArray([
167
161
  ...existingModifiers,
168
- ts__default["default"].factory.createModifier(ts__default["default"].SyntaxKind.ReadonlyKeyword),
162
+ ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword),
169
163
  ]), node.name, undefined, undefined, outputCall);
170
- return prepareTextReplacementForNode(info, node, printer.printNode(ts__default["default"].EmitHint.Unspecified, updatedOutputDeclaration, sf));
164
+ return prepareTextReplacementForNode(info, node, printer.printNode(ts.EmitHint.Unspecified, updatedOutputDeclaration, sf));
171
165
  }
172
166
  function calculateImportReplacements(info, sourceFiles) {
173
167
  const importReplacements = {};
@@ -205,7 +199,7 @@ function calculateCompleteCallReplacement(info, node) {
205
199
  return prepareTextReplacementForNode(info, node, '', node.getFullStart());
206
200
  }
207
201
  function calculatePipeCallReplacement(info, node) {
208
- if (ts__default["default"].isPropertyAccessExpression(node.expression)) {
202
+ if (ts.isPropertyAccessExpression(node.expression)) {
209
203
  const sf = node.getSourceFile();
210
204
  const importManager = new checker.ImportManager();
211
205
  const outputToObservableIdent = importManager.addImport({
@@ -213,13 +207,13 @@ function calculatePipeCallReplacement(info, node) {
213
207
  exportModuleSpecifier: '@angular/core/rxjs-interop',
214
208
  exportSymbolName: 'outputToObservable',
215
209
  });
216
- const toObsCallExp = ts__default["default"].factory.createCallExpression(outputToObservableIdent, undefined, [
210
+ const toObsCallExp = ts.factory.createCallExpression(outputToObservableIdent, undefined, [
217
211
  node.expression.expression,
218
212
  ]);
219
- const pipePropAccessExp = ts__default["default"].factory.updatePropertyAccessExpression(node.expression, toObsCallExp, node.expression.name);
220
- const pipeCallExp = ts__default["default"].factory.updateCallExpression(node, pipePropAccessExp, [], node.arguments);
213
+ const pipePropAccessExp = ts.factory.updatePropertyAccessExpression(node.expression, toObsCallExp, node.expression.name);
214
+ const pipeCallExp = ts.factory.updateCallExpression(node, pipePropAccessExp, [], node.arguments);
221
215
  const replacements = [
222
- prepareTextReplacementForNode(info, node, printer.printNode(ts__default["default"].EmitHint.Unspecified, pipeCallExp, sf)),
216
+ prepareTextReplacementForNode(info, node, printer.printNode(ts.EmitHint.Unspecified, pipeCallExp, sf)),
223
217
  ];
224
218
  apply_import_manager.applyImportManagerChanges(importManager, replacements, [sf], info);
225
219
  return replacements;
@@ -288,7 +282,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
288
282
  let isTestFile = false;
289
283
  const outputMigrationVisitor = (node) => {
290
284
  // detect output declarations
291
- if (ts__default["default"].isPropertyDeclaration(node)) {
285
+ if (ts.isPropertyDeclaration(node)) {
292
286
  const outputDecorator = getOutputDecorator(node, reflector);
293
287
  if (outputDecorator !== null) {
294
288
  if (isOutputDeclarationEligibleForMigration(node)) {
@@ -320,7 +314,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
320
314
  }
321
315
  }
322
316
  // detect .next usages that should be migrated to .emit
323
- if (isPotentialNextCallUsage(node) && ts__default["default"].isPropertyAccessExpression(node.expression)) {
317
+ if (isPotentialNextCallUsage(node) && ts.isPropertyAccessExpression(node.expression)) {
324
318
  const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
325
319
  if (propertyDeclaration !== null) {
326
320
  const id = getUniqueIdForProperty(info, propertyDeclaration);
@@ -329,12 +323,12 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
329
323
  }
330
324
  }
331
325
  // detect .complete usages that should be removed
332
- if (isPotentialCompleteCallUsage(node) && ts__default["default"].isPropertyAccessExpression(node.expression)) {
326
+ if (isPotentialCompleteCallUsage(node) && ts.isPropertyAccessExpression(node.expression)) {
333
327
  const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
334
328
  if (propertyDeclaration !== null) {
335
329
  const id = getUniqueIdForProperty(info, propertyDeclaration);
336
330
  const outputFile = project_paths.projectFile(node.getSourceFile(), info);
337
- if (ts__default["default"].isExpressionStatement(node.parent)) {
331
+ if (ts.isExpressionStatement(node.parent)) {
338
332
  addOutputReplacement(outputFieldReplacements, id, outputFile, calculateCompleteCallReplacement(info, node.parent));
339
333
  }
340
334
  else {
@@ -347,7 +341,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
347
341
  isTestFile = true;
348
342
  }
349
343
  // detect unsafe access of the output property
350
- if (isPotentialPipeCallUsage(node) && ts__default["default"].isPropertyAccessExpression(node.expression)) {
344
+ if (isPotentialPipeCallUsage(node) && ts.isPropertyAccessExpression(node.expression)) {
351
345
  const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
352
346
  if (propertyDeclaration !== null) {
353
347
  const id = getUniqueIdForProperty(info, propertyDeclaration);
@@ -360,12 +354,12 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
360
354
  }
361
355
  }
362
356
  }
363
- ts__default["default"].forEachChild(node, outputMigrationVisitor);
357
+ ts.forEachChild(node, outputMigrationVisitor);
364
358
  };
365
359
  // calculate output migration replacements
366
360
  for (const sf of sourceFiles) {
367
361
  isTestFile = false;
368
- ts__default["default"].forEachChild(sf, outputMigrationVisitor);
362
+ ts.forEachChild(sf, outputMigrationVisitor);
369
363
  }
370
364
  // take care of the references in templates and host bindings
371
365
  const referenceResult = { references: [] };
@@ -373,7 +367,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
373
367
  referenceResult);
374
368
  // calculate template / host binding replacements
375
369
  for (const sf of sourceFiles) {
376
- ts__default["default"].forEachChild(sf, templateHostRefVisitor);
370
+ ts.forEachChild(sf, templateHostRefVisitor);
377
371
  }
378
372
  for (const ref of referenceResult.references) {
379
373
  // detect .next usages that should be migrated to .emit in template and host binding expressions