@angular/core 21.0.0-next.3 → 21.0.0-next.5

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 +7 -4
  2. package/chrome_dev_tools_performance.d.d.ts +1 -1
  3. package/discovery.d.d.ts +48 -21
  4. package/effect.d.d.ts +1 -2
  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 +228 -72
  9. package/fesm2022/core.mjs.map +1 -1
  10. package/fesm2022/debug_node.mjs +564 -747
  11. package/fesm2022/debug_node.mjs.map +1 -1
  12. package/fesm2022/effect.mjs +3 -4
  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 +4 -5
  21. package/fesm2022/primitives/signals.mjs.map +1 -1
  22. package/fesm2022/resource.mjs +5 -4
  23. package/fesm2022/resource.mjs.map +1 -1
  24. package/fesm2022/root_effect_scheduler.mjs +61 -45
  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 +19 -140
  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 -3
  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-Bx60Uquz.cjs} +3 -3
  44. package/schematics/bundles/bootstrap-options-migration.cjs +637 -0
  45. package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
  46. package/schematics/bundles/{compiler_host-Df7s6Riz.cjs → compiler_host-Aouk-n4F.cjs} +2 -2
  47. package/schematics/bundles/control-flow-migration.cjs +71 -39
  48. package/schematics/bundles/{imports-26VeX8i-.cjs → imports-DwPXlGFl.cjs} +27 -1
  49. package/schematics/bundles/{index-Clvp4COX.cjs → index-BZQb51Qf.cjs} +4 -4
  50. package/schematics/bundles/{index-CBaykQBv.cjs → index-Bb6iejCd.cjs} +130 -41
  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-By2ZtKls.cjs} +5 -5
  54. package/schematics/bundles/{ng_component_template-HYGPuVhy.cjs → ng_component_template-B4M8mTyv.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 +110 -98
  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-7Wl_HDnw.cjs +132 -0
  61. package/schematics/bundles/{project_paths-BJTqcWvC.cjs → project_paths-Dr2s3Pq3.cjs} +3 -3
  62. package/schematics/bundles/{project_tsconfig_paths-bRwOJEk9.cjs → project_tsconfig_paths-DX9KHLn9.cjs} +423 -236
  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 +17 -10
  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.5
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-Aouk-n4F.cjs');
12
+ var project_tsconfig_paths = require('./project_tsconfig_paths-DX9KHLn9.cjs');
13
13
  var ts = require('typescript');
14
- var parse_html = require('./parse_html-CLFKoiOK.cjs');
14
+ var parse_html = require('./parse_html-7Wl_HDnw.cjs');
15
15
  require('os');
16
16
  require('fs');
17
17
  require('module');
@@ -410,6 +410,7 @@ const endMarkerRegex = new RegExp(endMarker, 'gm');
410
410
  const startI18nMarkerRegex = new RegExp(startI18nMarker, 'gm');
411
411
  const endI18nMarkerRegex = new RegExp(endI18nMarker, 'gm');
412
412
  const replaceMarkerRegex = new RegExp(`${startMarker}|${endMarker}`, 'gm');
413
+ const PRIORITY_WEIGHT_TEMPLATE_REFERENCE_BY_OUTLET = 2;
413
414
  /**
414
415
  * Analyzes a source file to find file that need to be migrated and the text ranges within them.
415
416
  * @param sourceFile File to be analyzed.
@@ -689,34 +690,6 @@ function getTemplates(template) {
689
690
  }
690
691
  return new Map();
691
692
  }
692
- function countTemplateUsage(nodes, templateName) {
693
- let count = 0;
694
- let isReferencedInTemplateOutlet = false;
695
- for (const node of nodes) {
696
- if (node.attrs) {
697
- for (const attr of node.attrs) {
698
- if (attr.name === '*ngTemplateOutlet' && attr.value === templateName.slice(1)) {
699
- isReferencedInTemplateOutlet = true;
700
- break;
701
- }
702
- if (attr.name.trim() === templateName) {
703
- count++;
704
- }
705
- }
706
- }
707
- if (node.children) {
708
- if (node.name === 'for') {
709
- for (const child of node.children) {
710
- if (child.value?.includes(templateName.slice(1))) {
711
- count++;
712
- }
713
- }
714
- }
715
- count += countTemplateUsage(node.children, templateName);
716
- }
717
- }
718
- return isReferencedInTemplateOutlet ? count + 2 : count;
719
- }
720
693
  function updateTemplates(template, templates) {
721
694
  const updatedTemplates = getTemplates(template);
722
695
  for (let [key, tmpl] of updatedTemplates) {
@@ -740,9 +713,10 @@ function processNgTemplates(template, sourceFile) {
740
713
  try {
741
714
  const templates = getTemplates(template);
742
715
  // swap placeholders and remove
743
- for (const [name, t] of templates) {
744
- const replaceRegex = new RegExp(getPlaceholder(name.slice(1)), 'g');
745
- const forRegex = new RegExp(getPlaceholder(name.slice(1), PlaceholderKind.Alternate), 'g');
716
+ for (const [nameWithHash, t] of templates) {
717
+ const name = nameWithHash.slice(1);
718
+ const replaceRegex = new RegExp(getPlaceholder(name), 'g');
719
+ const forRegex = new RegExp(getPlaceholder(nameWithHash.slice(1), PlaceholderKind.Alternate), 'g');
746
720
  const forMatches = [...template.matchAll(forRegex)];
747
721
  const matches = [...forMatches, ...template.matchAll(replaceRegex)];
748
722
  let safeToRemove = true;
@@ -767,7 +741,12 @@ function processNgTemplates(template, sourceFile) {
767
741
  template = template.replace(replaceRegex, t.children);
768
742
  }
769
743
  const dist = matches.filter((obj, index, self) => index === self.findIndex((t) => t.input === obj.input));
770
- if ((t.count === dist.length || t.count - matches.length === 1) && safeToRemove) {
744
+ // Check if template is used by ngTemplateOutlet in addition to control flow
745
+ const hasTemplateOutletUsage = checkForTemplateOutletUsage(template, nameWithHash.slice(1));
746
+ // Only remove template if it's safe to do so AND not used by ngTemplateOutlet
747
+ if ((t.count === dist.length || t.count - matches.length === 1) &&
748
+ safeToRemove &&
749
+ !hasTemplateOutletUsage) {
771
750
  const refsInComponentFile = getViewChildOrViewChildrenNames(sourceFile);
772
751
  if (refsInComponentFile?.length > 0) {
773
752
  const templateRefs = getTemplateReferences(template);
@@ -797,6 +776,59 @@ function processNgTemplates(template, sourceFile) {
797
776
  return { migrated: template, err: err };
798
777
  }
799
778
  }
779
+ function analyzeTemplateUsage(nodes, templateName) {
780
+ let count = 0;
781
+ let isReferencedInTemplateOutlet = false;
782
+ const templateNameWithHash = `#${templateName}`;
783
+ function traverseNodes(nodeList) {
784
+ for (const node of nodeList) {
785
+ if (node.attrs) {
786
+ for (const attr of node.attrs) {
787
+ if ((attr.name === '*ngTemplateOutlet' || attr.name === '[ngTemplateOutlet]') &&
788
+ attr.value === templateName) {
789
+ isReferencedInTemplateOutlet = true;
790
+ }
791
+ if (attr.name.trim() === templateNameWithHash) {
792
+ count++;
793
+ }
794
+ }
795
+ }
796
+ if (node.children) {
797
+ if (node.name === 'for') {
798
+ for (const child of node.children) {
799
+ if (child.value?.includes(templateName)) {
800
+ count++;
801
+ }
802
+ }
803
+ }
804
+ traverseNodes(node.children);
805
+ }
806
+ }
807
+ }
808
+ traverseNodes(nodes);
809
+ return {
810
+ isReferencedInTemplateOutlet,
811
+ totalCount: isReferencedInTemplateOutlet
812
+ ? count + PRIORITY_WEIGHT_TEMPLATE_REFERENCE_BY_OUTLET
813
+ : count,
814
+ };
815
+ }
816
+ /**
817
+ * Checks if a template is used by ngTemplateOutlet directive
818
+ */
819
+ function checkForTemplateOutletUsage(template, templateName) {
820
+ const parsed = parse_html.parseTemplate(template);
821
+ if (parsed.tree === undefined) {
822
+ return false;
823
+ }
824
+ const result = analyzeTemplateUsage(parsed.tree.rootNodes, templateName);
825
+ return result.isReferencedInTemplateOutlet;
826
+ }
827
+ function countTemplateUsage(nodes, templateNameWithHash) {
828
+ const templateName = templateNameWithHash.slice(1);
829
+ const result = analyzeTemplateUsage(nodes, templateName);
830
+ return result.totalCount;
831
+ }
800
832
  function getViewChildOrViewChildrenNames(sourceFile) {
801
833
  const names = [];
802
834
  function visit(node) {
@@ -821,11 +853,11 @@ function getTemplateReferences(template) {
821
853
  if (parsed.tree === undefined) {
822
854
  return [];
823
855
  }
824
- const references = [];
856
+ const templateNameRefWithoutHash = [];
825
857
  function visitNodes(nodes) {
826
858
  for (const node of nodes) {
827
859
  if (node?.name === 'ng-template') {
828
- references.push(...node.attrs?.map((ref) => ref?.name?.slice(1)));
860
+ templateNameRefWithoutHash.push(...node.attrs?.map((ref) => ref?.name?.slice(1)));
829
861
  }
830
862
  if (node.children) {
831
863
  visitNodes(node.children);
@@ -833,7 +865,7 @@ function getTemplateReferences(template) {
833
865
  }
834
866
  }
835
867
  visitNodes(parsed.tree.rootNodes);
836
- return references;
868
+ return templateNameRefWithoutHash;
837
869
  }
838
870
  function replaceRemainingPlaceholders(template) {
839
871
  const pattern = '.*';
@@ -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.5
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,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v21.0.0-next.3
3
+ * @license Angular v21.0.0-next.5
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-DX9KHLn9.cjs');
12
+ var index = require('./index-Bb6iejCd.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-Dr2s3Pq3.cjs');
16
16
 
17
17
  function getMemberName(member) {
18
18
  if (member.name === undefined) {
@@ -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.5
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-DX9KHLn9.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.5'));
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.5'));
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.5'));
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.5'));
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.5'));
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.5'));
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.5'));
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.5'));
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
  /**
@@ -11534,11 +11525,12 @@ class ComponentDecoratorHandler {
11534
11525
  for (const [_, deps] of resolution.deferPerBlockDependencies) {
11535
11526
  for (const deferBlockDep of deps) {
11536
11527
  const node = deferBlockDep.declaration.node;
11537
- const importDecl = resolution.deferrableDeclToImportDecl.get(node) ?? null;
11538
- if (importDecl !== null && this.deferredSymbolTracker.canDefer(importDecl)) {
11528
+ const importInfo = resolution.deferrableDeclToImportDecl.get(node) ?? null;
11529
+ if (importInfo !== null && this.deferredSymbolTracker.canDefer(importInfo.node)) {
11539
11530
  deferBlockDep.isDeferrable = true;
11540
- deferBlockDep.importPath = importDecl.moduleSpecifier.text;
11541
- deferBlockDep.isDefaultImport = isDefaultImport(importDecl);
11531
+ deferBlockDep.symbolName = importInfo.name;
11532
+ deferBlockDep.importPath = importInfo.from;
11533
+ deferBlockDep.isDefaultImport = isDefaultImport(importInfo.node);
11542
11534
  // The same dependency may be used across multiple deferred blocks. De-duplicate it
11543
11535
  // because it can throw off other logic further down the compilation pipeline.
11544
11536
  // Note that the logic above needs to run even if the dependency is seen before,
@@ -11711,9 +11703,10 @@ class ComponentDecoratorHandler {
11711
11703
  // This is not a directive or a pipe.
11712
11704
  return;
11713
11705
  }
11714
- // Keep track of how this class made it into the current source file
11715
- // (which ts.ImportDeclaration was used for this symbol).
11716
- resolutionData.deferrableDeclToImportDecl.set(decl.node, imp.node);
11706
+ // Keep track of how this class made it into the current source file.
11707
+ // Store the full `Import` info so that callers can correctly determine the
11708
+ // exported name (handling aliasing) and the module specifier.
11709
+ resolutionData.deferrableDeclToImportDecl.set(decl.node, imp);
11717
11710
  this.deferredSymbolTracker.markAsDeferrableCandidate(node, imp.node, componentClassDecl, isDeferredImport);
11718
11711
  }
11719
11712
  compileDeferBlocks(resolution) {
@@ -12332,7 +12325,7 @@ class PipeDecoratorHandler {
12332
12325
  * @description
12333
12326
  * Entry point for all public APIs of the compiler-cli package.
12334
12327
  */
12335
- new project_tsconfig_paths.Version('21.0.0-next.3');
12328
+ new project_tsconfig_paths.Version('21.0.0-next.5');
12336
12329
 
12337
12330
  /**
12338
12331
  * Whether a given decorator should be treated as an Angular decorator.
@@ -16455,10 +16448,10 @@ class InterpolatedSignalCheck extends TemplateCheckWithVisitor {
16455
16448
  }
16456
16449
  // bound properties like `[prop]="mySignal"`
16457
16450
  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)) {
16451
+ const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
16452
+ if (symbol?.kind === project_tsconfig_paths.SymbolKind.Input &&
16453
+ symbol.bindings.length > 0 &&
16454
+ symbol.bindings.some((binding) => binding.target.kind === project_tsconfig_paths.SymbolKind.Directive)) {
16462
16455
  return [];
16463
16456
  }
16464
16457
  // otherwise, we check if the node is
@@ -16788,13 +16781,24 @@ const factory$9 = {
16788
16781
  * otherwise it would produce inaccurate results.
16789
16782
  */
16790
16783
  class OptionalChainNotNullableCheck extends TemplateCheckWithVisitor {
16784
+ noUncheckedIndexedAccess;
16791
16785
  canVisitStructuralAttributes = false;
16792
16786
  code = project_tsconfig_paths.ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE;
16787
+ constructor(noUncheckedIndexedAccess) {
16788
+ super();
16789
+ this.noUncheckedIndexedAccess = noUncheckedIndexedAccess;
16790
+ }
16793
16791
  visitNode(ctx, component, node) {
16794
16792
  if (!(node instanceof project_tsconfig_paths.SafeCall) &&
16795
16793
  !(node instanceof project_tsconfig_paths.SafePropertyRead) &&
16796
- !(node instanceof project_tsconfig_paths.SafeKeyedRead))
16794
+ !(node instanceof project_tsconfig_paths.SafeKeyedRead)) {
16795
+ return [];
16796
+ }
16797
+ // When `noUncheckedIndexedAccess` is disabled, an indexed access is not checked
16798
+ // and may result in `undefined`.
16799
+ if (node.receiver instanceof project_tsconfig_paths.KeyedRead && !this.noUncheckedIndexedAccess) {
16797
16800
  return [];
16801
+ }
16798
16802
  const symbolLeft = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
16799
16803
  if (symbolLeft === null || symbolLeft.kind !== project_tsconfig_paths.SymbolKind.Expression) {
16800
16804
  return [];
@@ -16834,7 +16838,8 @@ const factory$8 = {
16834
16838
  if (!strictNullChecks) {
16835
16839
  return null;
16836
16840
  }
16837
- return new OptionalChainNotNullableCheck();
16841
+ const noUncheckedIndexedAccess = !!options.noUncheckedIndexedAccess;
16842
+ return new OptionalChainNotNullableCheck(noUncheckedIndexedAccess);
16838
16843
  },
16839
16844
  };
16840
16845
 
@@ -17369,7 +17374,7 @@ function unwrapAstWithSource(ast) {
17369
17374
  * found in the LICENSE file at https://angular.dev/license
17370
17375
  */
17371
17376
  /** APIs whose usages should be checked by the rule. */
17372
- const APIS_TO_CHECK = [
17377
+ const APIS_TO_CHECK$1 = [
17373
17378
  project_tsconfig_paths.INPUT_INITIALIZER_FN,
17374
17379
  project_tsconfig_paths.MODEL_INITIALIZER_FN,
17375
17380
  ...project_tsconfig_paths.OUTPUT_INITIALIZER_FNS,
@@ -17387,7 +17392,7 @@ class InitializerApiUsageRule {
17387
17392
  }
17388
17393
  shouldCheck(sourceFile) {
17389
17394
  // Skip the traversal if there are no imports of the initializer APIs.
17390
- return APIS_TO_CHECK.some(({ functionName, owningModule }) => {
17395
+ return APIS_TO_CHECK$1.some(({ functionName, owningModule }) => {
17391
17396
  return (this.importedSymbolsTracker.hasNamedImport(sourceFile, functionName, owningModule) ||
17392
17397
  this.importedSymbolsTracker.hasNamespaceImport(sourceFile, owningModule));
17393
17398
  });
@@ -17405,7 +17410,7 @@ class InitializerApiUsageRule {
17405
17410
  if (!node.parent || !ts.isCallExpression(node)) {
17406
17411
  return null;
17407
17412
  }
17408
- const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK, node, this.reflector, this.importedSymbolsTracker);
17413
+ const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK$1, node, this.reflector, this.importedSymbolsTracker);
17409
17414
  if (identifiedInitializer === null) {
17410
17415
  return null;
17411
17416
  }
@@ -17567,6 +17572,86 @@ function closestNode(start, predicate) {
17567
17572
  return null;
17568
17573
  }
17569
17574
 
17575
+ /*!
17576
+ * @license
17577
+ * Copyright Google LLC All Rights Reserved.
17578
+ *
17579
+ * Use of this source code is governed by an MIT-style license that can be
17580
+ * found in the LICENSE file at https://angular.dev/license
17581
+ */
17582
+ /** APIs whose usages should be checked by the rule. */
17583
+ const APIS_TO_CHECK = [
17584
+ project_tsconfig_paths.INPUT_INITIALIZER_FN,
17585
+ project_tsconfig_paths.MODEL_INITIALIZER_FN,
17586
+ ...project_tsconfig_paths.QUERY_INITIALIZER_FNS,
17587
+ ];
17588
+ /**
17589
+ * Rule that flags forbidden invocations of required initializers in property initializers and constructors.
17590
+ */
17591
+ class ForbiddenRequiredInitializersInvocationRule {
17592
+ reflector;
17593
+ importedSymbolsTracker;
17594
+ constructor(reflector, importedSymbolsTracker) {
17595
+ this.reflector = reflector;
17596
+ this.importedSymbolsTracker = importedSymbolsTracker;
17597
+ }
17598
+ shouldCheck(sourceFile) {
17599
+ // Skip the traversal if there are no imports of the initializer APIs.
17600
+ return APIS_TO_CHECK.some(({ functionName, owningModule }) => {
17601
+ return (this.importedSymbolsTracker.hasNamedImport(sourceFile, functionName, owningModule) ||
17602
+ this.importedSymbolsTracker.hasNamespaceImport(sourceFile, owningModule));
17603
+ });
17604
+ }
17605
+ checkNode(node) {
17606
+ if (!ts.isClassDeclaration(node))
17607
+ return null;
17608
+ const requiredInitializerDeclarations = node.members.filter((m) => ts.isPropertyDeclaration(m) && this.isPropDeclarationARequiredInitializer(m));
17609
+ const diagnostics = [];
17610
+ // Handling of the usages in props initializations
17611
+ for (let decl of node.members) {
17612
+ if (!ts.isPropertyDeclaration(decl))
17613
+ continue;
17614
+ const initiallizerExpr = decl.initializer;
17615
+ if (!initiallizerExpr)
17616
+ continue;
17617
+ checkForbiddenInvocation(initiallizerExpr);
17618
+ }
17619
+ function checkForbiddenInvocation(node) {
17620
+ if (ts.isArrowFunction(node) || ts.isFunctionExpression(node))
17621
+ return;
17622
+ if (ts.isPropertyAccessExpression(node) &&
17623
+ node.expression.kind === ts.SyntaxKind.ThisKeyword &&
17624
+ // With the following we make sure we only flag invoked required initializers
17625
+ ts.isCallExpression(node.parent) &&
17626
+ node.parent.expression === node) {
17627
+ const requiredProp = requiredInitializerDeclarations.find((prop) => prop.name.getText() === node.name.getText());
17628
+ if (requiredProp) {
17629
+ const initializerFn = requiredProp.initializer.expression.expression.getText();
17630
+ 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.`));
17631
+ }
17632
+ }
17633
+ return node.forEachChild(checkForbiddenInvocation);
17634
+ }
17635
+ const ctor = getConstructorFromClass(node);
17636
+ if (ctor) {
17637
+ checkForbiddenInvocation(ctor);
17638
+ }
17639
+ return diagnostics;
17640
+ }
17641
+ isPropDeclarationARequiredInitializer(node) {
17642
+ if (!node.initializer)
17643
+ return false;
17644
+ const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK, node.initializer, this.reflector, this.importedSymbolsTracker);
17645
+ if (identifiedInitializer === null || !identifiedInitializer.isRequired)
17646
+ return false;
17647
+ return true;
17648
+ }
17649
+ }
17650
+ function getConstructorFromClass(node) {
17651
+ // We also check for a constructor body to avoid picking up parent constructors.
17652
+ return node.members.find((m) => ts.isConstructorDeclaration(m) && m.body !== undefined);
17653
+ }
17654
+
17570
17655
  /*!
17571
17656
  * @license
17572
17657
  * Copyright Google LLC All Rights Reserved.
@@ -17582,6 +17667,7 @@ class SourceFileValidator {
17582
17667
  constructor(reflector, importedSymbolsTracker, templateTypeChecker, typeCheckingConfig) {
17583
17668
  this.rules = [new InitializerApiUsageRule(reflector, importedSymbolsTracker)];
17584
17669
  this.rules.push(new UnusedStandaloneImportsRule(templateTypeChecker, typeCheckingConfig, importedSymbolsTracker));
17670
+ this.rules.push(new ForbiddenRequiredInitializersInvocationRule(reflector, importedSymbolsTracker));
17585
17671
  }
17586
17672
  /**
17587
17673
  * Gets the diagnostics for a specific file, or null if the file is valid.
@@ -20343,7 +20429,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
20343
20429
  * @param minVersion Minimum required version for the feature.
20344
20430
  */
20345
20431
  function coreVersionSupportsFeature(coreVersion, minVersion) {
20346
- // A version of `21.0.0-next.3` usually means that core is at head so it supports
20432
+ // A version of `21.0.0-next.5` usually means that core is at head so it supports
20347
20433
  // all features. Use string interpolation prevent the placeholder from being replaced
20348
20434
  // with the current version during build time.
20349
20435
  if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
@@ -20501,9 +20587,12 @@ class NgCompiler {
20501
20587
  this.usePoisonedData = usePoisonedData || !!options._compilePoisonedComponents;
20502
20588
  this.enableTemplateTypeChecker =
20503
20589
  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;
20590
+ this.enableBlockSyntax =
20591
+ this.angularCoreVersion === null ||
20592
+ coreVersionSupportsFeature(this.angularCoreVersion, '>= 17.0.0');
20593
+ this.enableLetSyntax =
20594
+ this.angularCoreVersion === null ||
20595
+ coreVersionSupportsFeature(this.angularCoreVersion, '>= 18.1.0');
20507
20596
  this.enableSelectorless = options['_enableSelectorless'] ?? false;
20508
20597
  this.emitDeclarationOnly =
20509
20598
  !!options.emitDeclarationOnly && !!options._experimentalAllowEmitDeclarationOnly;
@@ -20669,7 +20758,7 @@ class NgCompiler {
20669
20758
  return {
20670
20759
  ...diag,
20671
20760
  messageText: diag.messageText +
20672
- `. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/NG${project_tsconfig_paths.ngErrorCode(diag.code)}`,
20761
+ `. Find more at ${project_tsconfig_paths.ERROR_DETAILS_PAGE_BASE_URL}/NG${project_tsconfig_paths.ngErrorCode(diag.code)}`,
20673
20762
  };
20674
20763
  }
20675
20764
  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.5
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-Aouk-n4F.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-DX9KHLn9.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.5
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.5
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-DX9KHLn9.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-BZQb51Qf.cjs');
14
+ var project_paths = require('./project_paths-Dr2s3Pq3.cjs');
15
15
  var leading_space = require('./leading_space-D9nQ8UQC.cjs');
16
- require('./index-CBaykQBv.cjs');
16
+ require('./index-Bb6iejCd.cjs');
17
17
  require('path');
18
18
  require('node:path');
19
19