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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/event_dispatcher.d-pVP0-wST.d.ts +345 -0
  2. package/fesm2022/core.mjs +614 -428
  3. package/fesm2022/core.mjs.map +1 -1
  4. package/fesm2022/injector-BlLwZ2sr.mjs +24 -0
  5. package/fesm2022/injector-BlLwZ2sr.mjs.map +1 -0
  6. package/fesm2022/primitives/di.mjs +5 -18
  7. package/fesm2022/primitives/di.mjs.map +1 -1
  8. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  9. package/fesm2022/primitives/signals.mjs +4 -589
  10. package/fesm2022/primitives/signals.mjs.map +1 -1
  11. package/fesm2022/rxjs-interop.mjs +1 -8
  12. package/fesm2022/rxjs-interop.mjs.map +1 -1
  13. package/fesm2022/testing.mjs +2 -10
  14. package/fesm2022/testing.mjs.map +1 -1
  15. package/fesm2022/untracked-DkcXpNb_.mjs +620 -0
  16. package/fesm2022/untracked-DkcXpNb_.mjs.map +1 -0
  17. package/index.d.ts +7589 -7510
  18. package/{navigation_types.d-u4EOrrdZ.d.ts → navigation_types.d-DgDrF5rp.d.ts} +2 -2
  19. package/package.json +2 -2
  20. package/primitives/di/index.d.ts +25 -10
  21. package/primitives/event-dispatch/index.d.ts +5 -340
  22. package/primitives/signals/index.d.ts +5 -208
  23. package/rxjs-interop/index.d.ts +1 -10
  24. package/schematics/bundles/{apply_import_manager-CyRT0UvU.js → apply_import_manager-CeNv8GIG.js} +6 -6
  25. package/schematics/bundles/{checker-DF8ZaFW5.js → checker-k591b6WQ.js} +856 -180
  26. package/schematics/bundles/cleanup-unused-imports.js +42 -69
  27. package/schematics/bundles/{compiler_host-Da636uJ8.js → compiler_host-DwM3ugW3.js} +2 -2
  28. package/schematics/bundles/control-flow-migration.js +34 -13
  29. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  30. package/schematics/bundles/{program-BZk27Ndu.js → index-B4OAlHh8.js} +2234 -2097
  31. package/schematics/bundles/{index-DnkWgagp.js → index-BhELUmYx.js} +11 -11
  32. package/schematics/bundles/inject-flags.js +18 -52
  33. package/schematics/bundles/inject-migration.js +3 -3
  34. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  35. package/schematics/bundles/{migrate_ts_type_references-DtkOnnv0.js → migrate_ts_type_references-Be0TNYen.js} +20 -20
  36. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  37. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  38. package/schematics/bundles/output-migration.js +62 -90
  39. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  40. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  41. package/schematics/bundles/route-lazy-loading.js +3 -3
  42. package/schematics/bundles/{project_paths-Jtbi76Bs.js → run_in_devkit-CkvEksWP.js} +262 -197
  43. package/schematics/bundles/self-closing-tags-migration.js +41 -71
  44. package/schematics/bundles/signal-input-migration.js +69 -97
  45. package/schematics/bundles/signal-queries-migration.js +80 -108
  46. package/schematics/bundles/signals.js +11 -11
  47. package/schematics/bundles/standalone-migration.js +8 -22
  48. package/schematics/bundles/symbol-VPWguRxr.js +25 -0
  49. package/schematics/bundles/test-bed-get.js +98 -0
  50. package/schematics/migrations.json +5 -0
  51. package/testing/index.d.ts +2 -4
  52. package/weak_ref.d-BZ7gyRag.d.ts +216 -0
  53. package/fesm2022/weak_ref-DrMdAIDh.mjs +0 -12
  54. package/fesm2022/weak_ref-DrMdAIDh.mjs.map +0 -1
  55. package/schematics/bundles/index-vGJcp5M7.js +0 -30
  56. package/weak_ref.d-ttyj86RV.d.ts +0 -9
@@ -1,26 +1,26 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.2
3
+ * @license Angular v20.0.0-next.4
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- var schematics = require('@angular-devkit/schematics');
10
- var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
11
- var project_paths = require('./project_paths-Jtbi76Bs.js');
12
- require('os');
13
9
  var ts = require('typescript');
14
- var checker = require('./checker-DF8ZaFW5.js');
15
- var program = require('./program-BZk27Ndu.js');
10
+ require('os');
11
+ var checker = require('./checker-k591b6WQ.js');
12
+ var index$1 = require('./index-B4OAlHh8.js');
16
13
  require('path');
17
- var apply_import_manager = require('./apply_import_manager-CyRT0UvU.js');
18
- var index = require('./index-DnkWgagp.js');
14
+ var run_in_devkit = require('./run_in_devkit-CkvEksWP.js');
15
+ var apply_import_manager = require('./apply_import_manager-CeNv8GIG.js');
16
+ var index = require('./index-BhELUmYx.js');
19
17
  require('@angular-devkit/core');
20
18
  require('node:path/posix');
21
19
  require('fs');
22
20
  require('module');
23
21
  require('url');
22
+ require('@angular-devkit/schematics');
23
+ require('./project_tsconfig_paths-CDVxT6Ov.js');
24
24
 
25
25
  function isOutputDeclarationEligibleForMigration(node) {
26
26
  return (node.initializer !== undefined &&
@@ -90,7 +90,7 @@ function getOutputDecorator(node, reflector) {
90
90
  // THINK: this utility + type is not specific to @Output, really, maybe move it to tsurge?
91
91
  /** Computes an unique ID for a given Angular `@Output` property. */
92
92
  function getUniqueIdForProperty(info, prop) {
93
- const { id } = project_paths.projectFile(prop.getSourceFile(), info);
93
+ const { id } = run_in_devkit.projectFile(prop.getSourceFile(), info);
94
94
  id.replace(/\.d\.ts$/, '.ts');
95
95
  return `${id}@@${prop.parent.name ?? 'unknown-class'}@@${prop.name.getText()}`;
96
96
  }
@@ -169,7 +169,7 @@ function calculateImportReplacements(info, sourceFiles) {
169
169
  const importManager = new checker.ImportManager();
170
170
  const addOnly = [];
171
171
  const addRemove = [];
172
- const file = project_paths.projectFile(sf, info);
172
+ const file = run_in_devkit.projectFile(sf, info);
173
173
  importManager.addImport({
174
174
  requestedFile: sf,
175
175
  exportModuleSpecifier: '@angular/core',
@@ -225,36 +225,36 @@ function calculatePipeCallReplacement(info, node) {
225
225
  }
226
226
  function prepareTextReplacementForNode(info, node, replacement, start) {
227
227
  const sf = node.getSourceFile();
228
- return new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
228
+ return new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
229
229
  position: start ?? node.getStart(),
230
230
  end: node.getEnd(),
231
231
  toInsert: replacement,
232
232
  }));
233
233
  }
234
234
  function prepareTextReplacement(file, replacement, start, end) {
235
- return new project_paths.Replacement(file, new project_paths.TextUpdate({
235
+ return new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
236
236
  position: start,
237
237
  end: end,
238
238
  toInsert: replacement,
239
239
  }));
240
240
  }
241
241
 
242
- class OutputMigration extends project_paths.TsurgeFunnelMigration {
242
+ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
243
243
  config;
244
244
  constructor(config = {}) {
245
245
  super();
246
246
  this.config = config;
247
247
  }
248
248
  async analyze(info) {
249
- const { sourceFiles, program: program$1 } = info;
249
+ const { sourceFiles, program } = info;
250
250
  const outputFieldReplacements = {};
251
251
  const problematicUsages = {};
252
252
  let problematicDeclarationCount = 0;
253
253
  const filesWithOutputDeclarations = new Set();
254
- const checker$1 = program$1.getTypeChecker();
254
+ const checker$1 = program.getTypeChecker();
255
255
  const reflector = new checker.TypeScriptReflectionHost(checker$1);
256
- const dtsReader = new program.DtsMetadataReader(checker$1, reflector);
257
- const evaluator = new program.PartialEvaluator(reflector, checker$1, null);
256
+ const dtsReader = new index$1.DtsMetadataReader(checker$1, reflector);
257
+ const evaluator = new index$1.PartialEvaluator(reflector, checker$1, null);
258
258
  const resourceLoader = info.ngCompiler?.['resourceManager'] ?? null;
259
259
  // Pre-analyze the program and get access to the template type checker.
260
260
  // If we are processing a non-Angular target, there is no template info.
@@ -290,7 +290,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
290
290
  id: getUniqueIdForProperty(info, node),
291
291
  aliasParam: outputDecorator.args?.at(0),
292
292
  };
293
- const outputFile = project_paths.projectFile(node.getSourceFile(), info);
293
+ const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
294
294
  if (this.config.shouldMigrate === undefined ||
295
295
  this.config.shouldMigrate({
296
296
  key: outputDef.id,
@@ -318,7 +318,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
318
318
  const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
319
319
  if (propertyDeclaration !== null) {
320
320
  const id = getUniqueIdForProperty(info, propertyDeclaration);
321
- const outputFile = project_paths.projectFile(node.getSourceFile(), info);
321
+ const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
322
322
  addOutputReplacement(outputFieldReplacements, id, outputFile, calculateNextFnReplacement(info, node.expression.name));
323
323
  }
324
324
  }
@@ -327,7 +327,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
327
327
  const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
328
328
  if (propertyDeclaration !== null) {
329
329
  const id = getUniqueIdForProperty(info, propertyDeclaration);
330
- const outputFile = project_paths.projectFile(node.getSourceFile(), info);
330
+ const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
331
331
  if (ts.isExpressionStatement(node.parent)) {
332
332
  addOutputReplacement(outputFieldReplacements, id, outputFile, calculateCompleteCallReplacement(info, node.parent));
333
333
  }
@@ -346,7 +346,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
346
346
  if (propertyDeclaration !== null) {
347
347
  const id = getUniqueIdForProperty(info, propertyDeclaration);
348
348
  if (isTestFile) {
349
- const outputFile = project_paths.projectFile(node.getSourceFile(), info);
349
+ const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
350
350
  addOutputReplacement(outputFieldReplacements, id, outputFile, ...calculatePipeCallReplacement(info, node));
351
351
  }
352
352
  else {
@@ -390,7 +390,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
390
390
  }
391
391
  // calculate import replacements but do so only for files that have output declarations
392
392
  const importReplacements = calculateImportReplacements(info, filesWithOutputDeclarations);
393
- return project_paths.confirmAsSerializable({
393
+ return run_in_devkit.confirmAsSerializable({
394
394
  problematicDeclarationCount,
395
395
  outputFields: outputFieldReplacements,
396
396
  importReplacements,
@@ -420,7 +420,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
420
420
  problematicUsages[declId] = unit.problematicUsages[declId];
421
421
  }
422
422
  }
423
- return project_paths.confirmAsSerializable({
423
+ return run_in_devkit.confirmAsSerializable({
424
424
  problematicDeclarationCount,
425
425
  outputFields,
426
426
  importReplacements,
@@ -442,7 +442,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
442
442
  }
443
443
  }
444
444
  // Noop here as we don't have any form of special global metadata.
445
- return project_paths.confirmAsSerializable(combinedData);
445
+ return run_in_devkit.confirmAsSerializable(combinedData);
446
446
  }
447
447
  async stats(globalMetadata) {
448
448
  const detectedOutputs = new Set(Object.keys(globalMetadata.outputFields)).size +
@@ -501,73 +501,45 @@ function addOutputReplacement(outputFieldReplacements, outputId, file, ...replac
501
501
 
502
502
  function migrate(options) {
503
503
  return async (tree, context) => {
504
- const { buildPaths, testPaths } = await project_tsconfig_paths.getProjectTsConfigPaths(tree);
505
- if (!buildPaths.length && !testPaths.length) {
506
- throw new schematics.SchematicsException('Could not find any tsconfig file. Cannot run output migration.');
507
- }
508
- const fs = new project_paths.DevkitMigrationFilesystem(tree);
509
- checker.setFileSystem(fs);
510
- const migration = new OutputMigration({
511
- shouldMigrate: (_, file) => {
512
- return (file.rootRelativePath.startsWith(fs.normalize(options.path)) &&
513
- !/(^|\/)node_modules\//.test(file.rootRelativePath));
504
+ await run_in_devkit.runMigrationInDevkit({
505
+ tree,
506
+ getMigration: (fs) => new OutputMigration({
507
+ shouldMigrate: (_, file) => {
508
+ return (file.rootRelativePath.startsWith(fs.normalize(options.path)) &&
509
+ !/(^|\/)node_modules\//.test(file.rootRelativePath));
510
+ },
511
+ }),
512
+ beforeProgramCreation: (tsconfigPath) => {
513
+ context.logger.info(`Preparing analysis for: ${tsconfigPath}...`);
514
514
  },
515
- });
516
- const analysisPath = fs.resolve(options.analysisDir);
517
- const unitResults = [];
518
- const programInfos = [...buildPaths, ...testPaths].map((tsconfigPath) => {
519
- context.logger.info(`Preparing analysis for: ${tsconfigPath}..`);
520
- const baseInfo = migration.createProgram(tsconfigPath, fs);
521
- const info = migration.prepareProgram(baseInfo);
522
- // Support restricting the analysis to subfolders for larger projects.
523
- if (analysisPath !== '/') {
524
- info.sourceFiles = info.sourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
525
- info.fullProgramSourceFiles = info.fullProgramSourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
526
- }
527
- return { info, tsconfigPath };
528
- });
529
- // Analyze phase. Treat all projects as compilation units as
530
- // this allows us to support references between those.
531
- for (const { info, tsconfigPath } of programInfos) {
532
- context.logger.info(`Scanning for outputs: ${tsconfigPath}..`);
533
- unitResults.push(await migration.analyze(info));
534
- }
535
- context.logger.info(``);
536
- context.logger.info(`Processing analysis data between targets..`);
537
- context.logger.info(``);
538
- const combined = await project_paths.synchronouslyCombineUnitData(migration, unitResults);
539
- if (combined === null) {
540
- context.logger.error('Migration failed unexpectedly with no analysis data');
541
- return;
542
- }
543
- const globalMeta = await migration.globalMeta(combined);
544
- const replacementsPerFile = new Map();
545
- for (const { info, tsconfigPath } of programInfos) {
546
- context.logger.info(`Migrating: ${tsconfigPath}..`);
547
- const { replacements } = await migration.migrate(globalMeta);
548
- const changesPerFile = project_paths.groupReplacementsByFile(replacements);
549
- for (const [file, changes] of changesPerFile) {
550
- if (!replacementsPerFile.has(file)) {
551
- replacementsPerFile.set(file, changes);
515
+ afterProgramCreation: (info, fs) => {
516
+ const analysisPath = fs.resolve(options.analysisDir);
517
+ // Support restricting the analysis to subfolders for larger projects.
518
+ if (analysisPath !== '/') {
519
+ info.sourceFiles = info.sourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
520
+ info.fullProgramSourceFiles = info.fullProgramSourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
552
521
  }
553
- }
554
- }
555
- context.logger.info(`Applying changes..`);
556
- for (const [file, changes] of replacementsPerFile) {
557
- const recorder = tree.beginUpdate(file);
558
- for (const c of changes) {
559
- recorder
560
- .remove(c.data.position, c.data.end - c.data.position)
561
- .insertLeft(c.data.position, c.data.toInsert);
562
- }
563
- tree.commitUpdate(recorder);
564
- }
565
- const { counters: { detectedOutputs, problematicOutputs, successRate }, } = await migration.stats(globalMeta);
566
- const migratedOutputs = detectedOutputs - problematicOutputs;
567
- const successRatePercent = (successRate * 100).toFixed(2);
568
- context.logger.info('');
569
- context.logger.info(`Successfully migrated to outputs as functions 🎉`);
570
- context.logger.info(` -> Migrated ${migratedOutputs} out of ${detectedOutputs} detected outputs (${successRatePercent} %).`);
522
+ },
523
+ beforeUnitAnalysis: (tsconfigPath) => {
524
+ context.logger.info(`Scanning for outputs: ${tsconfigPath}...`);
525
+ },
526
+ afterAllAnalyzed: () => {
527
+ context.logger.info(``);
528
+ context.logger.info(`Processing analysis data between targets...`);
529
+ context.logger.info(``);
530
+ },
531
+ afterAnalysisFailure: () => {
532
+ context.logger.error('Migration failed unexpectedly with no analysis data');
533
+ },
534
+ whenDone: ({ counters }) => {
535
+ const { detectedOutputs, problematicOutputs, successRate } = counters;
536
+ const migratedOutputs = detectedOutputs - problematicOutputs;
537
+ const successRatePercent = (successRate * 100).toFixed(2);
538
+ context.logger.info('');
539
+ context.logger.info(`Successfully migrated to outputs as functions 🎉`);
540
+ context.logger.info(` -> Migrated ${migratedOutputs} out of ${detectedOutputs} detected outputs (${successRatePercent} %).`);
541
+ },
542
+ });
571
543
  };
572
544
  }
573
545
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.2
3
+ * @license Angular v20.0.0-next.4
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 v20.0.0-next.2
3
+ * @license Angular v20.0.0-next.4
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 v20.0.0-next.2
3
+ * @license Angular v20.0.0-next.4
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -9,10 +9,10 @@
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-Da636uJ8.js');
12
+ var compiler_host = require('./compiler_host-DwM3ugW3.js');
13
13
  var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
14
14
  var ts = require('typescript');
15
- var checker = require('./checker-DF8ZaFW5.js');
15
+ var checker = require('./checker-k591b6WQ.js');
16
16
  var property_name = require('./property_name-BBwFuqMe.js');
17
17
  require('os');
18
18
  require('@angular-devkit/core');