@angular/core 21.0.0-next.3 → 21.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 (78) hide show
  1. package/api.d.d.ts +1 -1
  2. package/chrome_dev_tools_performance.d.d.ts +1 -1
  3. package/discovery.d.d.ts +44 -18
  4. package/effect.d.d.ts +1 -1
  5. package/event_dispatcher.d.d.ts +1 -1
  6. package/fesm2022/attribute.mjs +1 -1
  7. package/fesm2022/attribute.mjs.map +1 -1
  8. package/fesm2022/core.mjs +221 -64
  9. package/fesm2022/core.mjs.map +1 -1
  10. package/fesm2022/debug_node.mjs +516 -690
  11. package/fesm2022/debug_node.mjs.map +1 -1
  12. package/fesm2022/effect.mjs +1 -1
  13. package/fesm2022/effect.mjs.map +1 -1
  14. package/fesm2022/not_found.mjs +1 -1
  15. package/fesm2022/not_found.mjs.map +1 -1
  16. package/fesm2022/primitives/di.mjs +1 -1
  17. package/fesm2022/primitives/di.mjs.map +1 -1
  18. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  19. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  20. package/fesm2022/primitives/signals.mjs +2 -2
  21. package/fesm2022/primitives/signals.mjs.map +1 -1
  22. package/fesm2022/resource.mjs +1 -1
  23. package/fesm2022/resource.mjs.map +1 -1
  24. package/fesm2022/root_effect_scheduler.mjs +55 -39
  25. package/fesm2022/root_effect_scheduler.mjs.map +1 -1
  26. package/fesm2022/rxjs-interop.mjs +3 -1
  27. package/fesm2022/rxjs-interop.mjs.map +1 -1
  28. package/fesm2022/signal.mjs +32 -11
  29. package/fesm2022/signal.mjs.map +1 -1
  30. package/fesm2022/testing.mjs +4 -4
  31. package/fesm2022/testing.mjs.map +1 -1
  32. package/fesm2022/weak_ref.mjs +1 -1
  33. package/fesm2022/weak_ref.mjs.map +1 -1
  34. package/graph.d.d.ts +24 -4
  35. package/index.d.ts +11 -129
  36. package/package.json +2 -2
  37. package/primitives/di/index.d.ts +1 -1
  38. package/primitives/event-dispatch/index.d.ts +1 -1
  39. package/primitives/signals/index.d.ts +2 -2
  40. package/rxjs-interop/index.d.ts +3 -1
  41. package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +5 -5
  42. package/schematics/bundles/application-config-core.cjs +6 -6
  43. package/schematics/bundles/{apply_import_manager-tNexl58m.cjs → apply_import_manager-DroqamMP.cjs} +3 -3
  44. package/schematics/bundles/bootstrap-options-migration.cjs +715 -0
  45. package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
  46. package/schematics/bundles/{compiler_host-Df7s6Riz.cjs → compiler_host-aKaS4KRz.cjs} +2 -2
  47. package/schematics/bundles/control-flow-migration.cjs +4 -4
  48. package/schematics/bundles/{imports-26VeX8i-.cjs → imports-DwPXlGFl.cjs} +27 -1
  49. package/schematics/bundles/{index-CBaykQBv.cjs → index-BI97t1U8.cjs} +107 -32
  50. package/schematics/bundles/{index-Clvp4COX.cjs → index-DaB-z4lP.cjs} +4 -4
  51. package/schematics/bundles/inject-migration.cjs +5 -5
  52. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  53. package/schematics/bundles/{migrate_ts_type_references-C_gTvDtH.cjs → migrate_ts_type_references-DPuwhGod.cjs} +5 -5
  54. package/schematics/bundles/{ng_component_template-HYGPuVhy.cjs → ng_component_template-CytqBs-q.cjs} +3 -3
  55. package/schematics/bundles/{ng_decorators-CtYwz9Lw.cjs → ng_decorators-BI0uV7KI.cjs} +2 -2
  56. package/schematics/bundles/ngclass-to-class-migration.cjs +9 -9
  57. package/schematics/bundles/ngstyle-to-style-migration.cjs +490 -0
  58. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  59. package/schematics/bundles/output-migration.cjs +6 -6
  60. package/schematics/bundles/parse_html-CeQjkdOK.cjs +132 -0
  61. package/schematics/bundles/{project_paths-BJTqcWvC.cjs → project_paths-Cz4x-QiT.cjs} +3 -3
  62. package/schematics/bundles/{project_tsconfig_paths-bRwOJEk9.cjs → project_tsconfig_paths-Clg7WX1w.cjs} +168 -198
  63. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  64. package/schematics/bundles/route-lazy-loading.cjs +48 -4
  65. package/schematics/bundles/router-current-navigation.cjs +6 -6
  66. package/schematics/bundles/router-last-successful-navigation.cjs +6 -6
  67. package/schematics/bundles/self-closing-tags-migration.cjs +8 -8
  68. package/schematics/bundles/signal-input-migration.cjs +17 -9
  69. package/schematics/bundles/signal-queries-migration.cjs +7 -7
  70. package/schematics/bundles/signals.cjs +7 -7
  71. package/schematics/bundles/standalone-migration.cjs +7 -7
  72. package/schematics/bundles/{symbol-VPWguRxr.cjs → symbol-BObKoqes.cjs} +3 -2
  73. package/schematics/collection.json +6 -0
  74. package/schematics/migrations/ngstyle-to-style-migration/schema.json +20 -0
  75. package/schematics/migrations.json +5 -0
  76. package/testing/index.d.ts +1 -1
  77. package/weak_ref.d.d.ts +1 -1
  78. package/schematics/bundles/parse_html-CLFKoiOK.cjs +0 -41
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.0.0-next.4
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,14 +8,14 @@
8
8
 
9
9
  require('@angular-devkit/core');
10
10
  require('node:path/posix');
11
- var project_paths = require('./project_paths-BJTqcWvC.cjs');
11
+ var project_paths = require('./project_paths-Cz4x-QiT.cjs');
12
12
  var ts = require('typescript');
13
13
  require('os');
14
- var project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
15
- var index = require('./index-CBaykQBv.cjs');
14
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
15
+ var index = require('./index-BI97t1U8.cjs');
16
16
  require('path');
17
17
  require('node:path');
18
- var apply_import_manager = require('./apply_import_manager-tNexl58m.cjs');
18
+ var apply_import_manager = require('./apply_import_manager-DroqamMP.cjs');
19
19
  require('@angular-devkit/schematics');
20
20
  require('fs');
21
21
  require('module');
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.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
9
  var ts = require('typescript');
10
- var project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
10
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
11
11
  require('os');
12
12
  var p = require('path');
13
13
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.0.0-next.4
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,10 +8,10 @@
8
8
 
9
9
  var schematics = require('@angular-devkit/schematics');
10
10
  var p = require('path');
11
- var compiler_host = require('./compiler_host-Df7s6Riz.cjs');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
11
+ var compiler_host = require('./compiler_host-aKaS4KRz.cjs');
12
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
13
13
  var ts = require('typescript');
14
- var parse_html = require('./parse_html-CLFKoiOK.cjs');
14
+ var parse_html = require('./parse_html-CeQjkdOK.cjs');
15
15
  require('os');
16
16
  require('fs');
17
17
  require('module');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.0.0-next.4
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -49,6 +49,10 @@ function getImportOfIdentifier(typeChecker, node) {
49
49
  function getImportSpecifier(sourceFile, moduleName, specifierName) {
50
50
  return getImportSpecifiers(sourceFile, moduleName, specifierName)[0] ?? null;
51
51
  }
52
+ /**
53
+ * Note: returns only matching imports specifiers,
54
+ * Unmatched imports will be ignored (you won't get undefined), but a shorter array.
55
+ */
52
56
  function getImportSpecifiers(sourceFile, moduleName, specifierOrSpecifiers) {
53
57
  const matches = [];
54
58
  for (const node of sourceFile.statements) {
@@ -99,8 +103,30 @@ function findImportSpecifier(nodes, specifierName) {
99
103
  return propertyName ? propertyName.text === specifierName : name.text === specifierName;
100
104
  });
101
105
  }
106
+ /**
107
+ * Gets the relative path between two files.
108
+ * @param from Path of the file that is importing from another file.
109
+ * @param to Path of the file that is being imported.
110
+ */
111
+ function getRelativePath(from, to) {
112
+ const fromParts = from.split('/').slice(0, -1);
113
+ const toParts = to.split('/');
114
+ while (fromParts.length > 0 && toParts.length > 0 && fromParts[0] === toParts[0]) {
115
+ fromParts.shift();
116
+ toParts.shift();
117
+ }
118
+ let relativePath = fromParts.map(() => '..').join('/') + (fromParts.length > 0 ? '/' : '') + toParts.join('/');
119
+ if (relativePath.endsWith('.ts')) {
120
+ relativePath = relativePath.slice(0, -3);
121
+ }
122
+ if (!relativePath.startsWith('.')) {
123
+ relativePath = './' + relativePath;
124
+ }
125
+ return relativePath;
126
+ }
102
127
 
103
128
  exports.getImportOfIdentifier = getImportOfIdentifier;
104
129
  exports.getImportSpecifier = getImportSpecifier;
105
130
  exports.getImportSpecifiers = getImportSpecifiers;
106
131
  exports.getNamedImports = getNamedImports;
132
+ exports.getRelativePath = getRelativePath;
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.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 project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
9
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
10
10
  var ts = require('typescript');
11
11
  var p = require('path');
12
12
  require('os');
@@ -891,7 +891,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
891
891
  function compileDeclareClassMetadata(metadata) {
892
892
  const definitionMap = new project_tsconfig_paths.DefinitionMap();
893
893
  definitionMap.set('minVersion', project_tsconfig_paths.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
894
- definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.3'));
894
+ definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.4'));
895
895
  definitionMap.set('ngImport', project_tsconfig_paths.importExpr(project_tsconfig_paths.Identifiers.core));
896
896
  definitionMap.set('type', metadata.type);
897
897
  definitionMap.set('decorators', metadata.decorators);
@@ -909,7 +909,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
909
909
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? project_tsconfig_paths.literal(null));
910
910
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? project_tsconfig_paths.literal(null));
911
911
  definitionMap.set('minVersion', project_tsconfig_paths.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
912
- definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.3'));
912
+ definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.4'));
913
913
  definitionMap.set('ngImport', project_tsconfig_paths.importExpr(project_tsconfig_paths.Identifiers.core));
914
914
  definitionMap.set('type', metadata.type);
915
915
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -1004,7 +1004,7 @@ function createDirectiveDefinitionMap(meta) {
1004
1004
  const definitionMap = new project_tsconfig_paths.DefinitionMap();
1005
1005
  const minVersion = getMinimumVersionForPartialOutput(meta);
1006
1006
  definitionMap.set('minVersion', project_tsconfig_paths.literal(minVersion));
1007
- definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.3'));
1007
+ definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.4'));
1008
1008
  // e.g. `type: MyDirective`
1009
1009
  definitionMap.set('type', meta.type.value);
1010
1010
  if (meta.isStandalone !== undefined) {
@@ -1420,7 +1420,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
1420
1420
  function compileDeclareFactoryFunction(meta) {
1421
1421
  const definitionMap = new project_tsconfig_paths.DefinitionMap();
1422
1422
  definitionMap.set('minVersion', project_tsconfig_paths.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
1423
- definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.3'));
1423
+ definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.4'));
1424
1424
  definitionMap.set('ngImport', project_tsconfig_paths.importExpr(project_tsconfig_paths.Identifiers.core));
1425
1425
  definitionMap.set('type', meta.type.value);
1426
1426
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -1455,7 +1455,7 @@ function compileDeclareInjectableFromMetadata(meta) {
1455
1455
  function createInjectableDefinitionMap(meta) {
1456
1456
  const definitionMap = new project_tsconfig_paths.DefinitionMap();
1457
1457
  definitionMap.set('minVersion', project_tsconfig_paths.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
1458
- definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.3'));
1458
+ definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.4'));
1459
1459
  definitionMap.set('ngImport', project_tsconfig_paths.importExpr(project_tsconfig_paths.Identifiers.core));
1460
1460
  definitionMap.set('type', meta.type.value);
1461
1461
  // Only generate providedIn property if it has a non-null value
@@ -1506,7 +1506,7 @@ function compileDeclareInjectorFromMetadata(meta) {
1506
1506
  function createInjectorDefinitionMap(meta) {
1507
1507
  const definitionMap = new project_tsconfig_paths.DefinitionMap();
1508
1508
  definitionMap.set('minVersion', project_tsconfig_paths.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
1509
- definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.3'));
1509
+ definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.4'));
1510
1510
  definitionMap.set('ngImport', project_tsconfig_paths.importExpr(project_tsconfig_paths.Identifiers.core));
1511
1511
  definitionMap.set('type', meta.type.value);
1512
1512
  definitionMap.set('providers', meta.providers);
@@ -1539,7 +1539,7 @@ function createNgModuleDefinitionMap(meta) {
1539
1539
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
1540
1540
  }
1541
1541
  definitionMap.set('minVersion', project_tsconfig_paths.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
1542
- definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.3'));
1542
+ definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.4'));
1543
1543
  definitionMap.set('ngImport', project_tsconfig_paths.importExpr(project_tsconfig_paths.Identifiers.core));
1544
1544
  definitionMap.set('type', meta.type.value);
1545
1545
  // We only generate the keys in the metadata if the arrays contain values.
@@ -1590,7 +1590,7 @@ function compileDeclarePipeFromMetadata(meta) {
1590
1590
  function createPipeDefinitionMap(meta) {
1591
1591
  const definitionMap = new project_tsconfig_paths.DefinitionMap();
1592
1592
  definitionMap.set('minVersion', project_tsconfig_paths.literal(MINIMUM_PARTIAL_LINKER_VERSION));
1593
- definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.3'));
1593
+ definitionMap.set('version', project_tsconfig_paths.literal('21.0.0-next.4'));
1594
1594
  definitionMap.set('ngImport', project_tsconfig_paths.importExpr(project_tsconfig_paths.Identifiers.core));
1595
1595
  // e.g. `type: MyPipe`
1596
1596
  definitionMap.set('type', meta.type.value);
@@ -1741,15 +1741,6 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
1741
1741
  return new project_tsconfig_paths.DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, project_tsconfig_paths.StmtModifier.Final);
1742
1742
  }
1743
1743
 
1744
- /**
1745
- * Base URL for the error details page.
1746
- *
1747
- * Keep the files below in full sync:
1748
- * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
1749
- * - packages/core/src/error_details_base_url.ts
1750
- */
1751
- const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.dev/errors';
1752
-
1753
1744
  // Escape anything that isn't alphanumeric, '/' or '_'.
1754
1745
  const CHARS_TO_ESCAPE = /[^a-zA-Z0-9/_]/g;
1755
1746
  /**
@@ -12332,7 +12323,7 @@ class PipeDecoratorHandler {
12332
12323
  * @description
12333
12324
  * Entry point for all public APIs of the compiler-cli package.
12334
12325
  */
12335
- new project_tsconfig_paths.Version('21.0.0-next.3');
12326
+ new project_tsconfig_paths.Version('21.0.0-next.4');
12336
12327
 
12337
12328
  /**
12338
12329
  * Whether a given decorator should be treated as an Angular decorator.
@@ -16455,10 +16446,10 @@ class InterpolatedSignalCheck extends TemplateCheckWithVisitor {
16455
16446
  }
16456
16447
  // bound properties like `[prop]="mySignal"`
16457
16448
  else if (node instanceof project_tsconfig_paths.BoundAttribute) {
16458
- // we skip the check if the node is an input binding
16459
- const usedDirectives = ctx.templateTypeChecker.getUsedDirectives(component);
16460
- if (usedDirectives !== null &&
16461
- usedDirectives.some((dir) => dir.inputs.getByBindingPropertyName(node.name) !== null)) {
16449
+ const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
16450
+ if (symbol?.kind === project_tsconfig_paths.SymbolKind.Input &&
16451
+ symbol.bindings.length > 0 &&
16452
+ symbol.bindings.some((binding) => binding.target.kind === project_tsconfig_paths.SymbolKind.Directive)) {
16462
16453
  return [];
16463
16454
  }
16464
16455
  // otherwise, we check if the node is
@@ -17369,7 +17360,7 @@ function unwrapAstWithSource(ast) {
17369
17360
  * found in the LICENSE file at https://angular.dev/license
17370
17361
  */
17371
17362
  /** APIs whose usages should be checked by the rule. */
17372
- const APIS_TO_CHECK = [
17363
+ const APIS_TO_CHECK$1 = [
17373
17364
  project_tsconfig_paths.INPUT_INITIALIZER_FN,
17374
17365
  project_tsconfig_paths.MODEL_INITIALIZER_FN,
17375
17366
  ...project_tsconfig_paths.OUTPUT_INITIALIZER_FNS,
@@ -17387,7 +17378,7 @@ class InitializerApiUsageRule {
17387
17378
  }
17388
17379
  shouldCheck(sourceFile) {
17389
17380
  // Skip the traversal if there are no imports of the initializer APIs.
17390
- return APIS_TO_CHECK.some(({ functionName, owningModule }) => {
17381
+ return APIS_TO_CHECK$1.some(({ functionName, owningModule }) => {
17391
17382
  return (this.importedSymbolsTracker.hasNamedImport(sourceFile, functionName, owningModule) ||
17392
17383
  this.importedSymbolsTracker.hasNamespaceImport(sourceFile, owningModule));
17393
17384
  });
@@ -17405,7 +17396,7 @@ class InitializerApiUsageRule {
17405
17396
  if (!node.parent || !ts.isCallExpression(node)) {
17406
17397
  return null;
17407
17398
  }
17408
- const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK, node, this.reflector, this.importedSymbolsTracker);
17399
+ const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK$1, node, this.reflector, this.importedSymbolsTracker);
17409
17400
  if (identifiedInitializer === null) {
17410
17401
  return null;
17411
17402
  }
@@ -17567,6 +17558,86 @@ function closestNode(start, predicate) {
17567
17558
  return null;
17568
17559
  }
17569
17560
 
17561
+ /*!
17562
+ * @license
17563
+ * Copyright Google LLC All Rights Reserved.
17564
+ *
17565
+ * Use of this source code is governed by an MIT-style license that can be
17566
+ * found in the LICENSE file at https://angular.dev/license
17567
+ */
17568
+ /** APIs whose usages should be checked by the rule. */
17569
+ const APIS_TO_CHECK = [
17570
+ project_tsconfig_paths.INPUT_INITIALIZER_FN,
17571
+ project_tsconfig_paths.MODEL_INITIALIZER_FN,
17572
+ ...project_tsconfig_paths.QUERY_INITIALIZER_FNS,
17573
+ ];
17574
+ /**
17575
+ * Rule that flags forbidden invocations of required initializers in property initializers and constructors.
17576
+ */
17577
+ class ForbiddenRequiredInitializersInvocationRule {
17578
+ reflector;
17579
+ importedSymbolsTracker;
17580
+ constructor(reflector, importedSymbolsTracker) {
17581
+ this.reflector = reflector;
17582
+ this.importedSymbolsTracker = importedSymbolsTracker;
17583
+ }
17584
+ shouldCheck(sourceFile) {
17585
+ // Skip the traversal if there are no imports of the initializer APIs.
17586
+ return APIS_TO_CHECK.some(({ functionName, owningModule }) => {
17587
+ return (this.importedSymbolsTracker.hasNamedImport(sourceFile, functionName, owningModule) ||
17588
+ this.importedSymbolsTracker.hasNamespaceImport(sourceFile, owningModule));
17589
+ });
17590
+ }
17591
+ checkNode(node) {
17592
+ if (!ts.isClassDeclaration(node))
17593
+ return null;
17594
+ const requiredInitializerDeclarations = node.members.filter((m) => ts.isPropertyDeclaration(m) && this.isPropDeclarationARequiredInitializer(m));
17595
+ const diagnostics = [];
17596
+ // Handling of the usages in props initializations
17597
+ for (let decl of node.members) {
17598
+ if (!ts.isPropertyDeclaration(decl))
17599
+ continue;
17600
+ const initiallizerExpr = decl.initializer;
17601
+ if (!initiallizerExpr)
17602
+ continue;
17603
+ checkForbiddenInvocation(initiallizerExpr);
17604
+ }
17605
+ function checkForbiddenInvocation(node) {
17606
+ if (ts.isArrowFunction(node) || ts.isFunctionExpression(node))
17607
+ return;
17608
+ if (ts.isPropertyAccessExpression(node) &&
17609
+ node.expression.kind === ts.SyntaxKind.ThisKeyword &&
17610
+ // With the following we make sure we only flag invoked required initializers
17611
+ ts.isCallExpression(node.parent) &&
17612
+ node.parent.expression === node) {
17613
+ const requiredProp = requiredInitializerDeclarations.find((prop) => prop.name.getText() === node.name.getText());
17614
+ if (requiredProp) {
17615
+ const initializerFn = requiredProp.initializer.expression.expression.getText();
17616
+ diagnostics.push(project_tsconfig_paths.makeDiagnostic(project_tsconfig_paths.ErrorCode.FORBIDDEN_REQUIRED_INITIALIZER_INVOCATION, node, `\`${node.name.getText()}\` is a required \`${initializerFn}\` and does not have a value in this context.`));
17617
+ }
17618
+ }
17619
+ return node.forEachChild(checkForbiddenInvocation);
17620
+ }
17621
+ const ctor = getConstructorFromClass(node);
17622
+ if (ctor) {
17623
+ checkForbiddenInvocation(ctor);
17624
+ }
17625
+ return diagnostics;
17626
+ }
17627
+ isPropDeclarationARequiredInitializer(node) {
17628
+ if (!node.initializer)
17629
+ return false;
17630
+ const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK, node.initializer, this.reflector, this.importedSymbolsTracker);
17631
+ if (identifiedInitializer === null || !identifiedInitializer.isRequired)
17632
+ return false;
17633
+ return true;
17634
+ }
17635
+ }
17636
+ function getConstructorFromClass(node) {
17637
+ // We also check for a constructor body to avoid picking up parent constructors.
17638
+ return node.members.find((m) => ts.isConstructorDeclaration(m) && m.body !== undefined);
17639
+ }
17640
+
17570
17641
  /*!
17571
17642
  * @license
17572
17643
  * Copyright Google LLC All Rights Reserved.
@@ -17582,6 +17653,7 @@ class SourceFileValidator {
17582
17653
  constructor(reflector, importedSymbolsTracker, templateTypeChecker, typeCheckingConfig) {
17583
17654
  this.rules = [new InitializerApiUsageRule(reflector, importedSymbolsTracker)];
17584
17655
  this.rules.push(new UnusedStandaloneImportsRule(templateTypeChecker, typeCheckingConfig, importedSymbolsTracker));
17656
+ this.rules.push(new ForbiddenRequiredInitializersInvocationRule(reflector, importedSymbolsTracker));
17585
17657
  }
17586
17658
  /**
17587
17659
  * Gets the diagnostics for a specific file, or null if the file is valid.
@@ -20343,7 +20415,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
20343
20415
  * @param minVersion Minimum required version for the feature.
20344
20416
  */
20345
20417
  function coreVersionSupportsFeature(coreVersion, minVersion) {
20346
- // A version of `21.0.0-next.3` usually means that core is at head so it supports
20418
+ // A version of `21.0.0-next.4` usually means that core is at head so it supports
20347
20419
  // all features. Use string interpolation prevent the placeholder from being replaced
20348
20420
  // with the current version during build time.
20349
20421
  if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
@@ -20501,9 +20573,12 @@ class NgCompiler {
20501
20573
  this.usePoisonedData = usePoisonedData || !!options._compilePoisonedComponents;
20502
20574
  this.enableTemplateTypeChecker =
20503
20575
  enableTemplateTypeChecker || !!options._enableTemplateTypeChecker;
20504
- // TODO(crisbeto): remove this flag and base `enableBlockSyntax` on the `angularCoreVersion`.
20505
- this.enableBlockSyntax = options['_enableBlockSyntax'] ?? true;
20506
- this.enableLetSyntax = options['_enableLetSyntax'] ?? true;
20576
+ this.enableBlockSyntax =
20577
+ this.angularCoreVersion === null ||
20578
+ coreVersionSupportsFeature(this.angularCoreVersion, '>= 17.0.0');
20579
+ this.enableLetSyntax =
20580
+ this.angularCoreVersion === null ||
20581
+ coreVersionSupportsFeature(this.angularCoreVersion, '>= 18.1.0');
20507
20582
  this.enableSelectorless = options['_enableSelectorless'] ?? false;
20508
20583
  this.emitDeclarationOnly =
20509
20584
  !!options.emitDeclarationOnly && !!options._experimentalAllowEmitDeclarationOnly;
@@ -20669,7 +20744,7 @@ class NgCompiler {
20669
20744
  return {
20670
20745
  ...diag,
20671
20746
  messageText: diag.messageText +
20672
- `. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/NG${project_tsconfig_paths.ngErrorCode(diag.code)}`,
20747
+ `. Find more at ${project_tsconfig_paths.ERROR_DETAILS_PAGE_BASE_URL}/NG${project_tsconfig_paths.ngErrorCode(diag.code)}`,
20673
20748
  };
20674
20749
  }
20675
20750
  return diag;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.0.0-next.4
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
- var project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
12
- var index = require('./index-CBaykQBv.cjs');
11
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
12
+ var index = require('./index-BI97t1U8.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-BJTqcWvC.cjs');
15
+ var project_paths = require('./project_paths-Cz4x-QiT.cjs');
16
16
 
17
17
  function getMemberName(member) {
18
18
  if (member.name === undefined) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.0.0-next.4
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 schematics = require('@angular-devkit/schematics');
10
10
  var p = require('path');
11
- var compiler_host = require('./compiler_host-Df7s6Riz.cjs');
11
+ var compiler_host = require('./compiler_host-aKaS4KRz.cjs');
12
12
  var ts = require('typescript');
13
- var ng_decorators = require('./ng_decorators-CtYwz9Lw.cjs');
14
- var imports = require('./imports-26VeX8i-.cjs');
13
+ var ng_decorators = require('./ng_decorators-BI0uV7KI.cjs');
14
+ var imports = require('./imports-DwPXlGFl.cjs');
15
15
  var nodes = require('./nodes-B16H9JUd.cjs');
16
16
  var leading_space = require('./leading_space-D9nQ8UQC.cjs');
17
- var project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
17
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
18
18
  require('os');
19
19
  require('fs');
20
20
  require('module');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.0.0-next.4
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.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 project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
9
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
12
  var assert = require('assert');
13
- var index = require('./index-Clvp4COX.cjs');
14
- var project_paths = require('./project_paths-BJTqcWvC.cjs');
13
+ var index = require('./index-DaB-z4lP.cjs');
14
+ var project_paths = require('./project_paths-Cz4x-QiT.cjs');
15
15
  var leading_space = require('./leading_space-D9nQ8UQC.cjs');
16
- require('./index-CBaykQBv.cjs');
16
+ require('./index-BI97t1U8.cjs');
17
17
  require('path');
18
18
  require('node:path');
19
19
 
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.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
9
  var ts = require('typescript');
10
- var ng_decorators = require('./ng_decorators-CtYwz9Lw.cjs');
10
+ var ng_decorators = require('./ng_decorators-BI0uV7KI.cjs');
11
11
  var property_name = require('./property_name-BBwFuqMe.cjs');
12
12
  require('os');
13
- var project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
13
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
14
14
 
15
15
  /**
16
16
  * Unwraps a given expression TypeScript node. Expressions can be wrapped within multiple
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.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
9
  var ts = require('typescript');
10
- var imports = require('./imports-26VeX8i-.cjs');
10
+ var imports = require('./imports-DwPXlGFl.cjs');
11
11
 
12
12
  function getCallDecoratorImport(typeChecker, decorator) {
13
13
  // Note that this does not cover the edge case where decorators are called from
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.0.0-next.4
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,22 +8,22 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var project_tsconfig_paths = require('./project_tsconfig_paths-bRwOJEk9.cjs');
12
- var index = require('./index-CBaykQBv.cjs');
11
+ var project_tsconfig_paths = require('./project_tsconfig_paths-Clg7WX1w.cjs');
12
+ var index = require('./index-BI97t1U8.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-BJTqcWvC.cjs');
16
- var apply_import_manager = require('./apply_import_manager-tNexl58m.cjs');
17
- var imports = require('./imports-26VeX8i-.cjs');
18
- var parse_html = require('./parse_html-CLFKoiOK.cjs');
19
- var ng_component_template = require('./ng_component_template-HYGPuVhy.cjs');
15
+ var project_paths = require('./project_paths-Cz4x-QiT.cjs');
16
+ var apply_import_manager = require('./apply_import_manager-DroqamMP.cjs');
17
+ var imports = require('./imports-DwPXlGFl.cjs');
18
+ var parse_html = require('./parse_html-CeQjkdOK.cjs');
19
+ var ng_component_template = require('./ng_component_template-CytqBs-q.cjs');
20
20
  require('@angular-devkit/core');
21
21
  require('node:path/posix');
22
22
  require('fs');
23
23
  require('module');
24
24
  require('url');
25
25
  require('@angular-devkit/schematics');
26
- require('./ng_decorators-CtYwz9Lw.cjs');
26
+ require('./ng_decorators-BI0uV7KI.cjs');
27
27
  require('./property_name-BBwFuqMe.cjs');
28
28
 
29
29
  const ngClassStr = 'NgClass';