@angular/core 21.0.0-next.2 → 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 (79) 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 +253 -87
  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 +16 -135
  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 +135 -0
  42. package/schematics/bundles/application-config-core.cjs +6 -6
  43. package/schematics/bundles/{apply_import_manager-B3czqUhF.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-B9qvCnmC.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-B6-f9bil.cjs → index-BI97t1U8.cjs} +130 -34
  50. package/schematics/bundles/{index-DN8W1c8n.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-DawXRJzI.cjs → migrate_ts_type_references-DPuwhGod.cjs} +5 -5
  54. package/schematics/bundles/{ng_component_template-DUAg-x1h.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-D64fJzoa.cjs → project_paths-Cz4x-QiT.cjs} +3 -3
  62. package/schematics/bundles/{project_tsconfig_paths-DZ17BWwk.cjs → project_tsconfig_paths-Clg7WX1w.cjs} +170 -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/ngclass-to-class-migration/schema.json +1 -1
  75. package/schematics/migrations/ngstyle-to-style-migration/schema.json +20 -0
  76. package/schematics/migrations.json +10 -0
  77. package/testing/index.d.ts +1 -1
  78. package/weak_ref.d.d.ts +1 -1
  79. package/schematics/bundles/parse_html-C8TYlOyu.cjs +0 -41
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.2
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-D64fJzoa.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-DZ17BWwk.cjs');
15
- var index = require('./index-B6-f9bil.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-B3czqUhF.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.2
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-DZ17BWwk.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.2
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-B9qvCnmC.cjs');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-DZ17BWwk.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-C8TYlOyu.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.2
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.2
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-DZ17BWwk.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.2'));
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.2'));
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.2'));
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.2'));
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.2'));
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.2'));
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.2'));
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.2'));
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.2');
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.
@@ -13165,7 +13156,7 @@ function compareVersions(v1, v2) {
13165
13156
  * Note: this check is disabled in g3, search for
13166
13157
  * `angularCompilerOptions.disableTypeScriptVersionCheck` config param value in g3.
13167
13158
  */
13168
- const MIN_TS_VERSION = '5.8.0';
13159
+ const MIN_TS_VERSION = '5.9.0';
13169
13160
  /**
13170
13161
  * Supremum of supported TypeScript versions
13171
13162
  * ∀ supported typescript version v, v < MAX_TS_VERSION
@@ -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
@@ -16480,6 +16471,27 @@ class InterpolatedSignalCheck extends TemplateCheckWithVisitor {
16480
16471
  return buildDiagnosticForSignal(ctx, nodeAst, component);
16481
16472
  }
16482
16473
  }
16474
+ // if blocks like `@if(mySignal) { ... }`
16475
+ else if (node instanceof project_tsconfig_paths.IfBlock) {
16476
+ return node.branches
16477
+ .map((branch) => branch.expression)
16478
+ .filter((expr) => expr instanceof project_tsconfig_paths.ASTWithSource)
16479
+ .map((expr) => {
16480
+ const ast = expr.ast;
16481
+ return ast instanceof project_tsconfig_paths.PrefixNot ? ast.expression : ast;
16482
+ })
16483
+ .filter((ast) => ast instanceof project_tsconfig_paths.PropertyRead)
16484
+ .flatMap((item) => buildDiagnosticForSignal(ctx, item, component));
16485
+ }
16486
+ // switch blocks like `@switch(mySignal) { ... }`
16487
+ else if (node instanceof project_tsconfig_paths.SwitchBlock && node.expression instanceof project_tsconfig_paths.ASTWithSource) {
16488
+ const expression = node.expression.ast instanceof project_tsconfig_paths.PrefixNot
16489
+ ? node.expression.ast.expression
16490
+ : node.expression.ast;
16491
+ if (expression instanceof project_tsconfig_paths.PropertyRead) {
16492
+ return buildDiagnosticForSignal(ctx, expression, component);
16493
+ }
16494
+ }
16483
16495
  return [];
16484
16496
  }
16485
16497
  }
@@ -17348,7 +17360,7 @@ function unwrapAstWithSource(ast) {
17348
17360
  * found in the LICENSE file at https://angular.dev/license
17349
17361
  */
17350
17362
  /** APIs whose usages should be checked by the rule. */
17351
- const APIS_TO_CHECK = [
17363
+ const APIS_TO_CHECK$1 = [
17352
17364
  project_tsconfig_paths.INPUT_INITIALIZER_FN,
17353
17365
  project_tsconfig_paths.MODEL_INITIALIZER_FN,
17354
17366
  ...project_tsconfig_paths.OUTPUT_INITIALIZER_FNS,
@@ -17366,7 +17378,7 @@ class InitializerApiUsageRule {
17366
17378
  }
17367
17379
  shouldCheck(sourceFile) {
17368
17380
  // Skip the traversal if there are no imports of the initializer APIs.
17369
- return APIS_TO_CHECK.some(({ functionName, owningModule }) => {
17381
+ return APIS_TO_CHECK$1.some(({ functionName, owningModule }) => {
17370
17382
  return (this.importedSymbolsTracker.hasNamedImport(sourceFile, functionName, owningModule) ||
17371
17383
  this.importedSymbolsTracker.hasNamespaceImport(sourceFile, owningModule));
17372
17384
  });
@@ -17384,7 +17396,7 @@ class InitializerApiUsageRule {
17384
17396
  if (!node.parent || !ts.isCallExpression(node)) {
17385
17397
  return null;
17386
17398
  }
17387
- 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);
17388
17400
  if (identifiedInitializer === null) {
17389
17401
  return null;
17390
17402
  }
@@ -17546,6 +17558,86 @@ function closestNode(start, predicate) {
17546
17558
  return null;
17547
17559
  }
17548
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
+
17549
17641
  /*!
17550
17642
  * @license
17551
17643
  * Copyright Google LLC All Rights Reserved.
@@ -17561,6 +17653,7 @@ class SourceFileValidator {
17561
17653
  constructor(reflector, importedSymbolsTracker, templateTypeChecker, typeCheckingConfig) {
17562
17654
  this.rules = [new InitializerApiUsageRule(reflector, importedSymbolsTracker)];
17563
17655
  this.rules.push(new UnusedStandaloneImportsRule(templateTypeChecker, typeCheckingConfig, importedSymbolsTracker));
17656
+ this.rules.push(new ForbiddenRequiredInitializersInvocationRule(reflector, importedSymbolsTracker));
17564
17657
  }
17565
17658
  /**
17566
17659
  * Gets the diagnostics for a specific file, or null if the file is valid.
@@ -20322,7 +20415,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
20322
20415
  * @param minVersion Minimum required version for the feature.
20323
20416
  */
20324
20417
  function coreVersionSupportsFeature(coreVersion, minVersion) {
20325
- // A version of `21.0.0-next.2` 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
20326
20419
  // all features. Use string interpolation prevent the placeholder from being replaced
20327
20420
  // with the current version during build time.
20328
20421
  if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
@@ -20480,9 +20573,12 @@ class NgCompiler {
20480
20573
  this.usePoisonedData = usePoisonedData || !!options._compilePoisonedComponents;
20481
20574
  this.enableTemplateTypeChecker =
20482
20575
  enableTemplateTypeChecker || !!options._enableTemplateTypeChecker;
20483
- // TODO(crisbeto): remove this flag and base `enableBlockSyntax` on the `angularCoreVersion`.
20484
- this.enableBlockSyntax = options['_enableBlockSyntax'] ?? true;
20485
- 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');
20486
20582
  this.enableSelectorless = options['_enableSelectorless'] ?? false;
20487
20583
  this.emitDeclarationOnly =
20488
20584
  !!options.emitDeclarationOnly && !!options._experimentalAllowEmitDeclarationOnly;
@@ -20648,7 +20744,7 @@ class NgCompiler {
20648
20744
  return {
20649
20745
  ...diag,
20650
20746
  messageText: diag.messageText +
20651
- `. 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)}`,
20652
20748
  };
20653
20749
  }
20654
20750
  return diag;
@@ -21264,7 +21360,7 @@ class NgCompiler {
21264
21360
  const supportJitMode = this.options['supportJitMode'] ?? true;
21265
21361
  const supportTestBed = this.options['supportTestBed'] ?? true;
21266
21362
  const externalRuntimeStyles = this.options['externalRuntimeStyles'] ?? false;
21267
- const typeCheckHostBindings = this.options.typeCheckHostBindings ?? false;
21363
+ const typeCheckHostBindings = this.options.typeCheckHostBindings ?? true;
21268
21364
  // Libraries compiled in partial mode could potentially be used with TestBed within an
21269
21365
  // application. Since this is not known at library compilation time, support is required to
21270
21366
  // prevent potential downstream application testing breakage.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.2
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-DZ17BWwk.cjs');
12
- var index = require('./index-B6-f9bil.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-D64fJzoa.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.2
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-B9qvCnmC.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-DZ17BWwk.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.2
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.2
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-DZ17BWwk.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-DN8W1c8n.cjs');
14
- var project_paths = require('./project_paths-D64fJzoa.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-B6-f9bil.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.2
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-DZ17BWwk.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.2
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.2
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-DZ17BWwk.cjs');
12
- var index = require('./index-B6-f9bil.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-D64fJzoa.cjs');
16
- var apply_import_manager = require('./apply_import_manager-B3czqUhF.cjs');
17
- var imports = require('./imports-26VeX8i-.cjs');
18
- var parse_html = require('./parse_html-C8TYlOyu.cjs');
19
- var ng_component_template = require('./ng_component_template-DUAg-x1h.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';