@angular/core 20.3.0 → 20.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) 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 +47 -6
  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 +7 -30
  9. package/fesm2022/core.mjs.map +1 -1
  10. package/fesm2022/debug_node.mjs +514 -493
  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 +47 -27
  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 +1 -1
  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 +13 -96
  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/{apply_import_manager-CeOmw2t5.cjs → apply_import_manager-Ch2ALAC9.cjs} +3 -3
  43. package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
  44. package/schematics/bundles/{compiler_host-CXabxf2P.cjs → compiler_host-Jw4hNUf8.cjs} +2 -2
  45. package/schematics/bundles/control-flow-migration.cjs +70 -38
  46. package/schematics/bundles/document-core.cjs +5 -5
  47. package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
  48. package/schematics/bundles/{index-CKtFJ_6n.cjs → index-DWTTHy-7.cjs} +4 -4
  49. package/schematics/bundles/{index-CLpTl6rd.cjs → index-Gg0PI_fh.cjs} +124 -38
  50. package/schematics/bundles/inject-flags.cjs +5 -5
  51. package/schematics/bundles/inject-migration.cjs +3 -3
  52. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  53. package/schematics/bundles/{migrate_ts_type_references-CjIN7lkE.cjs → migrate_ts_type_references-D_xIwAQ5.cjs} +5 -5
  54. package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
  55. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  56. package/schematics/bundles/output-migration.cjs +6 -6
  57. package/schematics/bundles/{project_paths-CGqaSutM.cjs → project_paths-CfXVBYVk.cjs} +3 -3
  58. package/schematics/bundles/{project_tsconfig_paths-RAvhwg8f.cjs → project_tsconfig_paths-C11WBTJF.cjs} +184 -200
  59. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  60. package/schematics/bundles/route-lazy-loading.cjs +48 -4
  61. package/schematics/bundles/router-current-navigation.cjs +4 -4
  62. package/schematics/bundles/self-closing-tags-migration.cjs +4 -4
  63. package/schematics/bundles/signal-input-migration.cjs +17 -9
  64. package/schematics/bundles/signal-queries-migration.cjs +7 -7
  65. package/schematics/bundles/signals.cjs +7 -7
  66. package/schematics/bundles/standalone-migration.cjs +14 -7
  67. package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
  68. package/schematics/bundles/test-bed-get.cjs +4 -4
  69. package/testing/index.d.ts +1 -1
  70. package/weak_ref.d.d.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.3.0
3
+ * @license Angular v20.3.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,8 +8,8 @@
8
8
 
9
9
  var schematics = require('@angular-devkit/schematics');
10
10
  var path = require('node:path');
11
- var compiler_host = require('./compiler_host-CXabxf2P.cjs');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-RAvhwg8f.cjs');
11
+ var compiler_host = require('./compiler_host-Jw4hNUf8.cjs');
12
+ var project_tsconfig_paths = require('./project_tsconfig_paths-C11WBTJF.cjs');
13
13
  var ts = require('typescript');
14
14
  var p = require('path');
15
15
  require('os');
@@ -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.
@@ -718,34 +719,6 @@ function getTemplates(template) {
718
719
  }
719
720
  return new Map();
720
721
  }
721
- function countTemplateUsage(nodes, templateName) {
722
- let count = 0;
723
- let isReferencedInTemplateOutlet = false;
724
- for (const node of nodes) {
725
- if (node.attrs) {
726
- for (const attr of node.attrs) {
727
- if (attr.name === '*ngTemplateOutlet' && attr.value === templateName.slice(1)) {
728
- isReferencedInTemplateOutlet = true;
729
- break;
730
- }
731
- if (attr.name.trim() === templateName) {
732
- count++;
733
- }
734
- }
735
- }
736
- if (node.children) {
737
- if (node.name === 'for') {
738
- for (const child of node.children) {
739
- if (child.value?.includes(templateName.slice(1))) {
740
- count++;
741
- }
742
- }
743
- }
744
- count += countTemplateUsage(node.children, templateName);
745
- }
746
- }
747
- return isReferencedInTemplateOutlet ? count + 2 : count;
748
- }
749
722
  function updateTemplates(template, templates) {
750
723
  const updatedTemplates = getTemplates(template);
751
724
  for (let [key, tmpl] of updatedTemplates) {
@@ -769,9 +742,10 @@ function processNgTemplates(template, sourceFile) {
769
742
  try {
770
743
  const templates = getTemplates(template);
771
744
  // swap placeholders and remove
772
- for (const [name, t] of templates) {
773
- const replaceRegex = new RegExp(getPlaceholder(name.slice(1)), 'g');
774
- const forRegex = new RegExp(getPlaceholder(name.slice(1), PlaceholderKind.Alternate), 'g');
745
+ for (const [nameWithHash, t] of templates) {
746
+ const name = nameWithHash.slice(1);
747
+ const replaceRegex = new RegExp(getPlaceholder(name), 'g');
748
+ const forRegex = new RegExp(getPlaceholder(nameWithHash.slice(1), PlaceholderKind.Alternate), 'g');
775
749
  const forMatches = [...template.matchAll(forRegex)];
776
750
  const matches = [...forMatches, ...template.matchAll(replaceRegex)];
777
751
  let safeToRemove = true;
@@ -796,7 +770,12 @@ function processNgTemplates(template, sourceFile) {
796
770
  template = template.replace(replaceRegex, t.children);
797
771
  }
798
772
  const dist = matches.filter((obj, index, self) => index === self.findIndex((t) => t.input === obj.input));
799
- if ((t.count === dist.length || t.count - matches.length === 1) && safeToRemove) {
773
+ // Check if template is used by ngTemplateOutlet in addition to control flow
774
+ const hasTemplateOutletUsage = checkForTemplateOutletUsage(template, nameWithHash.slice(1));
775
+ // Only remove template if it's safe to do so AND not used by ngTemplateOutlet
776
+ if ((t.count === dist.length || t.count - matches.length === 1) &&
777
+ safeToRemove &&
778
+ !hasTemplateOutletUsage) {
800
779
  const refsInComponentFile = getViewChildOrViewChildrenNames(sourceFile);
801
780
  if (refsInComponentFile?.length > 0) {
802
781
  const templateRefs = getTemplateReferences(template);
@@ -826,6 +805,59 @@ function processNgTemplates(template, sourceFile) {
826
805
  return { migrated: template, err: err };
827
806
  }
828
807
  }
808
+ function analyzeTemplateUsage(nodes, templateName) {
809
+ let count = 0;
810
+ let isReferencedInTemplateOutlet = false;
811
+ const templateNameWithHash = `#${templateName}`;
812
+ function traverseNodes(nodeList) {
813
+ for (const node of nodeList) {
814
+ if (node.attrs) {
815
+ for (const attr of node.attrs) {
816
+ if ((attr.name === '*ngTemplateOutlet' || attr.name === '[ngTemplateOutlet]') &&
817
+ attr.value === templateName) {
818
+ isReferencedInTemplateOutlet = true;
819
+ }
820
+ if (attr.name.trim() === templateNameWithHash) {
821
+ count++;
822
+ }
823
+ }
824
+ }
825
+ if (node.children) {
826
+ if (node.name === 'for') {
827
+ for (const child of node.children) {
828
+ if (child.value?.includes(templateName)) {
829
+ count++;
830
+ }
831
+ }
832
+ }
833
+ traverseNodes(node.children);
834
+ }
835
+ }
836
+ }
837
+ traverseNodes(nodes);
838
+ return {
839
+ isReferencedInTemplateOutlet,
840
+ totalCount: isReferencedInTemplateOutlet
841
+ ? count + PRIORITY_WEIGHT_TEMPLATE_REFERENCE_BY_OUTLET
842
+ : count,
843
+ };
844
+ }
845
+ /**
846
+ * Checks if a template is used by ngTemplateOutlet directive
847
+ */
848
+ function checkForTemplateOutletUsage(template, templateName) {
849
+ const parsed = parseTemplate(template);
850
+ if (parsed.tree === undefined) {
851
+ return false;
852
+ }
853
+ const result = analyzeTemplateUsage(parsed.tree.rootNodes, templateName);
854
+ return result.isReferencedInTemplateOutlet;
855
+ }
856
+ function countTemplateUsage(nodes, templateNameWithHash) {
857
+ const templateName = templateNameWithHash.slice(1);
858
+ const result = analyzeTemplateUsage(nodes, templateName);
859
+ return result.totalCount;
860
+ }
829
861
  function getViewChildOrViewChildrenNames(sourceFile) {
830
862
  const names = [];
831
863
  function visit(node) {
@@ -850,11 +882,11 @@ function getTemplateReferences(template) {
850
882
  if (parsed.tree === undefined) {
851
883
  return [];
852
884
  }
853
- const references = [];
885
+ const templateNameRefWithoutHash = [];
854
886
  function visitNodes(nodes) {
855
887
  for (const node of nodes) {
856
888
  if (node?.name === 'ng-template') {
857
- references.push(...node.attrs?.map((ref) => ref?.name?.slice(1)));
889
+ templateNameRefWithoutHash.push(...node.attrs?.map((ref) => ref?.name?.slice(1)));
858
890
  }
859
891
  if (node.children) {
860
892
  visitNodes(node.children);
@@ -862,7 +894,7 @@ function getTemplateReferences(template) {
862
894
  }
863
895
  }
864
896
  visitNodes(parsed.tree.rootNodes);
865
- return references;
897
+ return templateNameRefWithoutHash;
866
898
  }
867
899
  function replaceRemainingPlaceholders(template) {
868
900
  const pattern = '.*';
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.3.0
3
+ * @license Angular v20.3.2
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-RAvhwg8f.cjs');
9
+ var project_tsconfig_paths = require('./project_tsconfig_paths-C11WBTJF.cjs');
10
10
  require('typescript');
11
11
  require('os');
12
- var apply_import_manager = require('./apply_import_manager-CeOmw2t5.cjs');
13
- require('./index-CLpTl6rd.cjs');
12
+ var apply_import_manager = require('./apply_import_manager-Ch2ALAC9.cjs');
13
+ require('./index-Gg0PI_fh.cjs');
14
14
  require('path');
15
15
  require('node:path');
16
- var project_paths = require('./project_paths-CGqaSutM.cjs');
16
+ var project_paths = require('./project_paths-CfXVBYVk.cjs');
17
17
  var imports = require('./imports-CIX-JgAN.cjs');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.3.0
3
+ * @license Angular v20.3.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.3.0
3
+ * @license Angular v20.3.2
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-RAvhwg8f.cjs');
12
- var index = require('./index-CLpTl6rd.cjs');
11
+ var project_tsconfig_paths = require('./project_tsconfig_paths-C11WBTJF.cjs');
12
+ var index = require('./index-Gg0PI_fh.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-CGqaSutM.cjs');
15
+ var project_paths = require('./project_paths-CfXVBYVk.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 v20.3.0
3
+ * @license Angular v20.3.2
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-RAvhwg8f.cjs');
9
+ var project_tsconfig_paths = require('./project_tsconfig_paths-C11WBTJF.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('20.3.0'));
894
+ definitionMap.set('version', project_tsconfig_paths.literal('20.3.2'));
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('20.3.0'));
912
+ definitionMap.set('version', project_tsconfig_paths.literal('20.3.2'));
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('20.3.0'));
1007
+ definitionMap.set('version', project_tsconfig_paths.literal('20.3.2'));
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('20.3.0'));
1423
+ definitionMap.set('version', project_tsconfig_paths.literal('20.3.2'));
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('20.3.0'));
1458
+ definitionMap.set('version', project_tsconfig_paths.literal('20.3.2'));
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('20.3.0'));
1509
+ definitionMap.set('version', project_tsconfig_paths.literal('20.3.2'));
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('20.3.0'));
1542
+ definitionMap.set('version', project_tsconfig_paths.literal('20.3.2'));
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('20.3.0'));
1593
+ definitionMap.set('version', project_tsconfig_paths.literal('20.3.2'));
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
  /**
@@ -11532,11 +11523,12 @@ class ComponentDecoratorHandler {
11532
11523
  for (const [_, deps] of resolution.deferPerBlockDependencies) {
11533
11524
  for (const deferBlockDep of deps) {
11534
11525
  const node = deferBlockDep.declaration.node;
11535
- const importDecl = resolution.deferrableDeclToImportDecl.get(node) ?? null;
11536
- if (importDecl !== null && this.deferredSymbolTracker.canDefer(importDecl)) {
11526
+ const importInfo = resolution.deferrableDeclToImportDecl.get(node) ?? null;
11527
+ if (importInfo !== null && this.deferredSymbolTracker.canDefer(importInfo.node)) {
11537
11528
  deferBlockDep.isDeferrable = true;
11538
- deferBlockDep.importPath = importDecl.moduleSpecifier.text;
11539
- deferBlockDep.isDefaultImport = isDefaultImport(importDecl);
11529
+ deferBlockDep.symbolName = importInfo.name;
11530
+ deferBlockDep.importPath = importInfo.from;
11531
+ deferBlockDep.isDefaultImport = isDefaultImport(importInfo.node);
11540
11532
  // The same dependency may be used across multiple deferred blocks. De-duplicate it
11541
11533
  // because it can throw off other logic further down the compilation pipeline.
11542
11534
  // Note that the logic above needs to run even if the dependency is seen before,
@@ -11709,9 +11701,10 @@ class ComponentDecoratorHandler {
11709
11701
  // This is not a directive or a pipe.
11710
11702
  return;
11711
11703
  }
11712
- // Keep track of how this class made it into the current source file
11713
- // (which ts.ImportDeclaration was used for this symbol).
11714
- resolutionData.deferrableDeclToImportDecl.set(decl.node, imp.node);
11704
+ // Keep track of how this class made it into the current source file.
11705
+ // Store the full `Import` info so that callers can correctly determine the
11706
+ // exported name (handling aliasing) and the module specifier.
11707
+ resolutionData.deferrableDeclToImportDecl.set(decl.node, imp);
11715
11708
  this.deferredSymbolTracker.markAsDeferrableCandidate(node, imp.node, componentClassDecl, isDeferredImport);
11716
11709
  }
11717
11710
  compileDeferBlocks(resolution) {
@@ -12330,7 +12323,7 @@ class PipeDecoratorHandler {
12330
12323
  * @description
12331
12324
  * Entry point for all public APIs of the compiler-cli package.
12332
12325
  */
12333
- new project_tsconfig_paths.Version('20.3.0');
12326
+ new project_tsconfig_paths.Version('20.3.2');
12334
12327
 
12335
12328
  /**
12336
12329
  * Whether a given decorator should be treated as an Angular decorator.
@@ -16453,10 +16446,10 @@ class InterpolatedSignalCheck extends TemplateCheckWithVisitor {
16453
16446
  }
16454
16447
  // bound properties like `[prop]="mySignal"`
16455
16448
  else if (node instanceof project_tsconfig_paths.BoundAttribute) {
16456
- // we skip the check if the node is an input binding
16457
- const usedDirectives = ctx.templateTypeChecker.getUsedDirectives(component);
16458
- if (usedDirectives !== null &&
16459
- 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)) {
16460
16453
  return [];
16461
16454
  }
16462
16455
  // otherwise, we check if the node is
@@ -16786,13 +16779,24 @@ const factory$9 = {
16786
16779
  * otherwise it would produce inaccurate results.
16787
16780
  */
16788
16781
  class OptionalChainNotNullableCheck extends TemplateCheckWithVisitor {
16782
+ noUncheckedIndexedAccess;
16789
16783
  canVisitStructuralAttributes = false;
16790
16784
  code = project_tsconfig_paths.ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE;
16785
+ constructor(noUncheckedIndexedAccess) {
16786
+ super();
16787
+ this.noUncheckedIndexedAccess = noUncheckedIndexedAccess;
16788
+ }
16791
16789
  visitNode(ctx, component, node) {
16792
16790
  if (!(node instanceof project_tsconfig_paths.SafeCall) &&
16793
16791
  !(node instanceof project_tsconfig_paths.SafePropertyRead) &&
16794
- !(node instanceof project_tsconfig_paths.SafeKeyedRead))
16792
+ !(node instanceof project_tsconfig_paths.SafeKeyedRead)) {
16793
+ return [];
16794
+ }
16795
+ // When `noUncheckedIndexedAccess` is disabled, an indexed access is not checked
16796
+ // and may result in `undefined`.
16797
+ if (node.receiver instanceof project_tsconfig_paths.KeyedRead && !this.noUncheckedIndexedAccess) {
16795
16798
  return [];
16799
+ }
16796
16800
  const symbolLeft = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
16797
16801
  if (symbolLeft === null || symbolLeft.kind !== project_tsconfig_paths.SymbolKind.Expression) {
16798
16802
  return [];
@@ -16832,7 +16836,8 @@ const factory$8 = {
16832
16836
  if (!strictNullChecks) {
16833
16837
  return null;
16834
16838
  }
16835
- return new OptionalChainNotNullableCheck();
16839
+ const noUncheckedIndexedAccess = !!options.noUncheckedIndexedAccess;
16840
+ return new OptionalChainNotNullableCheck(noUncheckedIndexedAccess);
16836
16841
  },
16837
16842
  };
16838
16843
 
@@ -17367,7 +17372,7 @@ function unwrapAstWithSource(ast) {
17367
17372
  * found in the LICENSE file at https://angular.dev/license
17368
17373
  */
17369
17374
  /** APIs whose usages should be checked by the rule. */
17370
- const APIS_TO_CHECK = [
17375
+ const APIS_TO_CHECK$1 = [
17371
17376
  project_tsconfig_paths.INPUT_INITIALIZER_FN,
17372
17377
  project_tsconfig_paths.MODEL_INITIALIZER_FN,
17373
17378
  ...project_tsconfig_paths.OUTPUT_INITIALIZER_FNS,
@@ -17385,7 +17390,7 @@ class InitializerApiUsageRule {
17385
17390
  }
17386
17391
  shouldCheck(sourceFile) {
17387
17392
  // Skip the traversal if there are no imports of the initializer APIs.
17388
- return APIS_TO_CHECK.some(({ functionName, owningModule }) => {
17393
+ return APIS_TO_CHECK$1.some(({ functionName, owningModule }) => {
17389
17394
  return (this.importedSymbolsTracker.hasNamedImport(sourceFile, functionName, owningModule) ||
17390
17395
  this.importedSymbolsTracker.hasNamespaceImport(sourceFile, owningModule));
17391
17396
  });
@@ -17403,7 +17408,7 @@ class InitializerApiUsageRule {
17403
17408
  if (!node.parent || !ts.isCallExpression(node)) {
17404
17409
  return null;
17405
17410
  }
17406
- const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK, node, this.reflector, this.importedSymbolsTracker);
17411
+ const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK$1, node, this.reflector, this.importedSymbolsTracker);
17407
17412
  if (identifiedInitializer === null) {
17408
17413
  return null;
17409
17414
  }
@@ -17565,6 +17570,86 @@ function closestNode(start, predicate) {
17565
17570
  return null;
17566
17571
  }
17567
17572
 
17573
+ /*!
17574
+ * @license
17575
+ * Copyright Google LLC All Rights Reserved.
17576
+ *
17577
+ * Use of this source code is governed by an MIT-style license that can be
17578
+ * found in the LICENSE file at https://angular.dev/license
17579
+ */
17580
+ /** APIs whose usages should be checked by the rule. */
17581
+ const APIS_TO_CHECK = [
17582
+ project_tsconfig_paths.INPUT_INITIALIZER_FN,
17583
+ project_tsconfig_paths.MODEL_INITIALIZER_FN,
17584
+ ...project_tsconfig_paths.QUERY_INITIALIZER_FNS,
17585
+ ];
17586
+ /**
17587
+ * Rule that flags forbidden invocations of required initializers in property initializers and constructors.
17588
+ */
17589
+ class ForbiddenRequiredInitializersInvocationRule {
17590
+ reflector;
17591
+ importedSymbolsTracker;
17592
+ constructor(reflector, importedSymbolsTracker) {
17593
+ this.reflector = reflector;
17594
+ this.importedSymbolsTracker = importedSymbolsTracker;
17595
+ }
17596
+ shouldCheck(sourceFile) {
17597
+ // Skip the traversal if there are no imports of the initializer APIs.
17598
+ return APIS_TO_CHECK.some(({ functionName, owningModule }) => {
17599
+ return (this.importedSymbolsTracker.hasNamedImport(sourceFile, functionName, owningModule) ||
17600
+ this.importedSymbolsTracker.hasNamespaceImport(sourceFile, owningModule));
17601
+ });
17602
+ }
17603
+ checkNode(node) {
17604
+ if (!ts.isClassDeclaration(node))
17605
+ return null;
17606
+ const requiredInitializerDeclarations = node.members.filter((m) => ts.isPropertyDeclaration(m) && this.isPropDeclarationARequiredInitializer(m));
17607
+ const diagnostics = [];
17608
+ // Handling of the usages in props initializations
17609
+ for (let decl of node.members) {
17610
+ if (!ts.isPropertyDeclaration(decl))
17611
+ continue;
17612
+ const initiallizerExpr = decl.initializer;
17613
+ if (!initiallizerExpr)
17614
+ continue;
17615
+ checkForbiddenInvocation(initiallizerExpr);
17616
+ }
17617
+ function checkForbiddenInvocation(node) {
17618
+ if (ts.isArrowFunction(node) || ts.isFunctionExpression(node))
17619
+ return;
17620
+ if (ts.isPropertyAccessExpression(node) &&
17621
+ node.expression.kind === ts.SyntaxKind.ThisKeyword &&
17622
+ // With the following we make sure we only flag invoked required initializers
17623
+ ts.isCallExpression(node.parent) &&
17624
+ node.parent.expression === node) {
17625
+ const requiredProp = requiredInitializerDeclarations.find((prop) => prop.name.getText() === node.name.getText());
17626
+ if (requiredProp) {
17627
+ const initializerFn = requiredProp.initializer.expression.expression.getText();
17628
+ 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.`));
17629
+ }
17630
+ }
17631
+ return node.forEachChild(checkForbiddenInvocation);
17632
+ }
17633
+ const ctor = getConstructorFromClass(node);
17634
+ if (ctor) {
17635
+ checkForbiddenInvocation(ctor);
17636
+ }
17637
+ return diagnostics;
17638
+ }
17639
+ isPropDeclarationARequiredInitializer(node) {
17640
+ if (!node.initializer)
17641
+ return false;
17642
+ const identifiedInitializer = project_tsconfig_paths.tryParseInitializerApi(APIS_TO_CHECK, node.initializer, this.reflector, this.importedSymbolsTracker);
17643
+ if (identifiedInitializer === null || !identifiedInitializer.isRequired)
17644
+ return false;
17645
+ return true;
17646
+ }
17647
+ }
17648
+ function getConstructorFromClass(node) {
17649
+ // We also check for a constructor body to avoid picking up parent constructors.
17650
+ return node.members.find((m) => ts.isConstructorDeclaration(m) && m.body !== undefined);
17651
+ }
17652
+
17568
17653
  /*!
17569
17654
  * @license
17570
17655
  * Copyright Google LLC All Rights Reserved.
@@ -17580,6 +17665,7 @@ class SourceFileValidator {
17580
17665
  constructor(reflector, importedSymbolsTracker, templateTypeChecker, typeCheckingConfig) {
17581
17666
  this.rules = [new InitializerApiUsageRule(reflector, importedSymbolsTracker)];
17582
17667
  this.rules.push(new UnusedStandaloneImportsRule(templateTypeChecker, typeCheckingConfig, importedSymbolsTracker));
17668
+ this.rules.push(new ForbiddenRequiredInitializersInvocationRule(reflector, importedSymbolsTracker));
17583
17669
  }
17584
17670
  /**
17585
17671
  * Gets the diagnostics for a specific file, or null if the file is valid.
@@ -20341,7 +20427,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
20341
20427
  * @param minVersion Minimum required version for the feature.
20342
20428
  */
20343
20429
  function coreVersionSupportsFeature(coreVersion, minVersion) {
20344
- // A version of `20.3.0` usually means that core is at head so it supports
20430
+ // A version of `20.3.2` usually means that core is at head so it supports
20345
20431
  // all features. Use string interpolation prevent the placeholder from being replaced
20346
20432
  // with the current version during build time.
20347
20433
  if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
@@ -20667,7 +20753,7 @@ class NgCompiler {
20667
20753
  return {
20668
20754
  ...diag,
20669
20755
  messageText: diag.messageText +
20670
- `. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/NG${project_tsconfig_paths.ngErrorCode(diag.code)}`,
20756
+ `. Find more at ${project_tsconfig_paths.ERROR_DETAILS_PAGE_BASE_URL}/NG${project_tsconfig_paths.ngErrorCode(diag.code)}`,
20671
20757
  };
20672
20758
  }
20673
20759
  return diag;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.3.0
3
+ * @license Angular v20.3.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,12 +8,12 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var project_tsconfig_paths = require('./project_tsconfig_paths-RAvhwg8f.cjs');
12
- require('./index-CLpTl6rd.cjs');
11
+ var project_tsconfig_paths = require('./project_tsconfig_paths-C11WBTJF.cjs');
12
+ require('./index-Gg0PI_fh.cjs');
13
13
  require('path');
14
14
  require('node:path');
15
- var project_paths = require('./project_paths-CGqaSutM.cjs');
16
- var apply_import_manager = require('./apply_import_manager-CeOmw2t5.cjs');
15
+ var project_paths = require('./project_paths-CfXVBYVk.cjs');
16
+ var apply_import_manager = require('./apply_import_manager-Ch2ALAC9.cjs');
17
17
  var imports = require('./imports-CIX-JgAN.cjs');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.3.0
3
+ * @license Angular v20.3.2
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-CXabxf2P.cjs');
11
+ var compiler_host = require('./compiler_host-Jw4hNUf8.cjs');
12
12
  var ts = require('typescript');
13
13
  var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
14
14
  var imports = require('./imports-CIX-JgAN.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-RAvhwg8f.cjs');
17
+ var project_tsconfig_paths = require('./project_tsconfig_paths-C11WBTJF.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 v20.3.0
3
+ * @license Angular v20.3.2
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 v20.3.0
3
+ * @license Angular v20.3.2
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-RAvhwg8f.cjs');
9
+ var project_tsconfig_paths = require('./project_tsconfig_paths-C11WBTJF.cjs');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
12
  var assert = require('assert');
13
- var index = require('./index-CKtFJ_6n.cjs');
14
- var project_paths = require('./project_paths-CGqaSutM.cjs');
13
+ var index = require('./index-DWTTHy-7.cjs');
14
+ var project_paths = require('./project_paths-CfXVBYVk.cjs');
15
15
  var leading_space = require('./leading_space-D9nQ8UQC.cjs');
16
- require('./index-CLpTl6rd.cjs');
16
+ require('./index-Gg0PI_fh.cjs');
17
17
  require('path');
18
18
  require('node:path');
19
19
  var assert$1 = require('node:assert');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.3.0
3
+ * @license Angular v20.3.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.3.0
3
+ * @license Angular v20.3.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */