@angular/core 17.0.1 → 17.0.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 (33) hide show
  1. package/esm2022/src/core_private_export.mjs +2 -2
  2. package/esm2022/src/core_render3_private_export.mjs +2 -2
  3. package/esm2022/src/defer/instructions.mjs +3 -3
  4. package/esm2022/src/hydration/api.mjs +3 -3
  5. package/esm2022/src/image_performance_warning.mjs +4 -4
  6. package/esm2022/src/linker/component_factory.mjs +1 -3
  7. package/esm2022/src/render3/after_render_hooks.mjs +4 -4
  8. package/esm2022/src/render3/features/standalone_feature.mjs +3 -6
  9. package/esm2022/src/render3/instructions/control_flow.mjs +4 -7
  10. package/esm2022/src/render3/list_reconciliation.mjs +5 -4
  11. package/esm2022/src/render3/metadata.mjs +20 -20
  12. package/esm2022/src/util/performance.mjs +9 -4
  13. package/esm2022/src/version.mjs +1 -1
  14. package/esm2022/testing/src/logger.mjs +3 -3
  15. package/esm2022/testing/src/test_bed.mjs +3 -3
  16. package/esm2022/testing/src/test_bed_compiler.mjs +7 -7
  17. package/fesm2022/core.mjs +44 -46
  18. package/fesm2022/core.mjs.map +1 -1
  19. package/fesm2022/primitives/signals.mjs +1 -1
  20. package/fesm2022/rxjs-interop.mjs +1 -1
  21. package/fesm2022/testing.mjs +8 -8
  22. package/fesm2022/testing.mjs.map +1 -1
  23. package/index.d.ts +9 -10
  24. package/package.json +1 -1
  25. package/primitives/signals/index.d.ts +1 -1
  26. package/rxjs-interop/index.d.ts +1 -1
  27. package/schematics/migrations/block-template-entities/bundle.js +1 -1
  28. package/schematics/migrations/block-template-entities/bundle.js.map +1 -1
  29. package/schematics/ng-generate/control-flow-migration/bundle.js +1 -1
  30. package/schematics/ng-generate/control-flow-migration/bundle.js.map +1 -1
  31. package/schematics/ng-generate/standalone-migration/bundle.js +86 -32
  32. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  33. package/testing/index.d.ts +1 -1
@@ -25574,7 +25574,7 @@ function publishFacade(global) {
25574
25574
  }
25575
25575
 
25576
25576
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
25577
- var VERSION2 = new Version("17.0.1");
25577
+ var VERSION2 = new Version("17.0.2");
25578
25578
 
25579
25579
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25580
25580
  var _I18N_ATTR = "i18n";
@@ -26611,7 +26611,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
26611
26611
  function compileDeclareClassMetadata(metadata) {
26612
26612
  const definitionMap = new DefinitionMap();
26613
26613
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
26614
- definitionMap.set("version", literal("17.0.1"));
26614
+ definitionMap.set("version", literal("17.0.2"));
26615
26615
  definitionMap.set("ngImport", importExpr(Identifiers.core));
26616
26616
  definitionMap.set("type", metadata.type);
26617
26617
  definitionMap.set("decorators", metadata.decorators);
@@ -26682,7 +26682,7 @@ function createDirectiveDefinitionMap(meta) {
26682
26682
  const hasTransformFunctions = Object.values(meta.inputs).some((input) => input.transformFunction !== null);
26683
26683
  const minVersion = hasTransformFunctions ? MINIMUM_PARTIAL_LINKER_VERSION2 : "14.0.0";
26684
26684
  definitionMap.set("minVersion", literal(minVersion));
26685
- definitionMap.set("version", literal("17.0.1"));
26685
+ definitionMap.set("version", literal("17.0.2"));
26686
26686
  definitionMap.set("type", meta.type.value);
26687
26687
  if (meta.isStandalone) {
26688
26688
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -26914,7 +26914,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION3 = "12.0.0";
26914
26914
  function compileDeclareFactoryFunction(meta) {
26915
26915
  const definitionMap = new DefinitionMap();
26916
26916
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
26917
- definitionMap.set("version", literal("17.0.1"));
26917
+ definitionMap.set("version", literal("17.0.2"));
26918
26918
  definitionMap.set("ngImport", importExpr(Identifiers.core));
26919
26919
  definitionMap.set("type", meta.type.value);
26920
26920
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -26937,7 +26937,7 @@ function compileDeclareInjectableFromMetadata(meta) {
26937
26937
  function createInjectableDefinitionMap(meta) {
26938
26938
  const definitionMap = new DefinitionMap();
26939
26939
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
26940
- definitionMap.set("version", literal("17.0.1"));
26940
+ definitionMap.set("version", literal("17.0.2"));
26941
26941
  definitionMap.set("ngImport", importExpr(Identifiers.core));
26942
26942
  definitionMap.set("type", meta.type.value);
26943
26943
  if (meta.providedIn !== void 0) {
@@ -26975,7 +26975,7 @@ function compileDeclareInjectorFromMetadata(meta) {
26975
26975
  function createInjectorDefinitionMap(meta) {
26976
26976
  const definitionMap = new DefinitionMap();
26977
26977
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
26978
- definitionMap.set("version", literal("17.0.1"));
26978
+ definitionMap.set("version", literal("17.0.2"));
26979
26979
  definitionMap.set("ngImport", importExpr(Identifiers.core));
26980
26980
  definitionMap.set("type", meta.type.value);
26981
26981
  definitionMap.set("providers", meta.providers);
@@ -26999,7 +26999,7 @@ function createNgModuleDefinitionMap(meta) {
26999
26999
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
27000
27000
  }
27001
27001
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
27002
- definitionMap.set("version", literal("17.0.1"));
27002
+ definitionMap.set("version", literal("17.0.2"));
27003
27003
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27004
27004
  definitionMap.set("type", meta.type.value);
27005
27005
  if (meta.bootstrap.length > 0) {
@@ -27034,7 +27034,7 @@ function compileDeclarePipeFromMetadata(meta) {
27034
27034
  function createPipeDefinitionMap(meta) {
27035
27035
  const definitionMap = new DefinitionMap();
27036
27036
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION7));
27037
- definitionMap.set("version", literal("17.0.1"));
27037
+ definitionMap.set("version", literal("17.0.2"));
27038
27038
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27039
27039
  definitionMap.set("type", meta.type.value);
27040
27040
  if (meta.isStandalone) {
@@ -27051,7 +27051,7 @@ function createPipeDefinitionMap(meta) {
27051
27051
  publishFacade(_global);
27052
27052
 
27053
27053
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version.mjs
27054
- var VERSION3 = new Version("17.0.1");
27054
+ var VERSION3 = new Version("17.0.2");
27055
27055
 
27056
27056
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
27057
27057
  var EmitFlags;
@@ -29517,8 +29517,8 @@ var BINARY_OPERATORS2 = /* @__PURE__ */ new Map([
29517
29517
  [BinaryOperator.NullishCoalesce, "??"]
29518
29518
  ]);
29519
29519
  var ExpressionTranslatorVisitor = class {
29520
- constructor(factory8, imports, options) {
29521
- this.factory = factory8;
29520
+ constructor(factory9, imports, options) {
29521
+ this.factory = factory9;
29522
29522
  this.imports = imports;
29523
29523
  this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
29524
29524
  this.downlevelVariableDeclarations = options.downlevelVariableDeclarations === true;
@@ -39889,11 +39889,15 @@ function tsCreateElement(tagName) {
39889
39889
  );
39890
39890
  }
39891
39891
  function tsDeclareVariable(id, type) {
39892
+ let initializer = import_typescript79.default.factory.createNonNullExpression(import_typescript79.default.factory.createNull());
39893
+ if (type.kind === import_typescript79.default.SyntaxKind.BooleanKeyword) {
39894
+ initializer = import_typescript79.default.factory.createAsExpression(initializer, import_typescript79.default.factory.createKeywordTypeNode(import_typescript79.default.SyntaxKind.BooleanKeyword));
39895
+ }
39892
39896
  const decl = import_typescript79.default.factory.createVariableDeclaration(
39893
39897
  id,
39894
39898
  void 0,
39895
39899
  type,
39896
- import_typescript79.default.factory.createNonNullExpression(import_typescript79.default.factory.createNull())
39900
+ initializer
39897
39901
  );
39898
39902
  return import_typescript79.default.factory.createVariableStatement(
39899
39903
  void 0,
@@ -41689,7 +41693,7 @@ var Context2 = class {
41689
41693
  return this.pipes.get(name);
41690
41694
  }
41691
41695
  };
41692
- var Scope3 = class {
41696
+ var _Scope = class {
41693
41697
  constructor(tcb, parent = null, guard = null) {
41694
41698
  this.tcb = tcb;
41695
41699
  this.parent = parent;
@@ -41703,7 +41707,7 @@ var Scope3 = class {
41703
41707
  this.statements = [];
41704
41708
  }
41705
41709
  static forNodes(tcb, parentScope, scopedNode, children, guard) {
41706
- const scope = new Scope3(tcb, parentScope, guard);
41710
+ const scope = new _Scope(tcb, parentScope, guard);
41707
41711
  if (parentScope === null && tcb.env.config.enableTemplateTypeChecker) {
41708
41712
  scope.opQueue.push(new TcbComponentContextCompletionOp(scope));
41709
41713
  }
@@ -41725,8 +41729,11 @@ var Scope3 = class {
41725
41729
  }
41726
41730
  } else if (scopedNode instanceof ForLoopBlock) {
41727
41731
  this.registerVariable(scope, scopedNode.item, new TcbBlockVariableOp(tcb, scope, import_typescript89.default.factory.createIdentifier(scopedNode.item.name), scopedNode.item));
41728
- for (const variable2 of Object.values(scopedNode.contextVariables)) {
41729
- const type = import_typescript89.default.factory.createKeywordTypeNode(import_typescript89.default.SyntaxKind.NumberKeyword);
41732
+ for (const [name, variable2] of Object.entries(scopedNode.contextVariables)) {
41733
+ if (!this.forLoopContextVariableTypes.has(name)) {
41734
+ throw new Error(`Unrecognized for loop context variable ${name}`);
41735
+ }
41736
+ const type = import_typescript89.default.factory.createKeywordTypeNode(this.forLoopContextVariableTypes.get(name));
41730
41737
  this.registerVariable(scope, variable2, new TcbBlockImplicitVariableOp(tcb, scope, type, variable2));
41731
41738
  }
41732
41739
  }
@@ -42003,6 +42010,17 @@ var Scope3 = class {
42003
42010
  }
42004
42011
  }
42005
42012
  };
42013
+ var Scope3 = _Scope;
42014
+ (() => {
42015
+ _Scope.forLoopContextVariableTypes = /* @__PURE__ */ new Map([
42016
+ ["$first", import_typescript89.default.SyntaxKind.BooleanKeyword],
42017
+ ["$last", import_typescript89.default.SyntaxKind.BooleanKeyword],
42018
+ ["$even", import_typescript89.default.SyntaxKind.BooleanKeyword],
42019
+ ["$odd", import_typescript89.default.SyntaxKind.BooleanKeyword],
42020
+ ["$index", import_typescript89.default.SyntaxKind.NumberKeyword],
42021
+ ["$count", import_typescript89.default.SyntaxKind.NumberKeyword]
42022
+ ]);
42023
+ })();
42006
42024
  function tcbThisParam(name, typeArguments) {
42007
42025
  return import_typescript89.default.factory.createParameterDeclaration(
42008
42026
  void 0,
@@ -43904,6 +43922,41 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor2 {
43904
43922
  }
43905
43923
  };
43906
43924
 
43925
+ // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
43926
+ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
43927
+ constructor() {
43928
+ super(...arguments);
43929
+ this.code = ErrorCode.INTERPOLATED_SIGNAL_NOT_INVOKED;
43930
+ }
43931
+ visitNode(ctx, component, node) {
43932
+ if (node instanceof Interpolation) {
43933
+ return node.expressions.filter((item) => item instanceof PropertyRead).flatMap((item) => {
43934
+ if (item instanceof PropertyRead) {
43935
+ return buildDiagnosticForSignal(ctx, item, component);
43936
+ }
43937
+ return [];
43938
+ });
43939
+ }
43940
+ return [];
43941
+ }
43942
+ };
43943
+ function buildDiagnosticForSignal(ctx, node, component) {
43944
+ var _a2, _b2;
43945
+ const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
43946
+ if ((symbol == null ? void 0 : symbol.kind) === SymbolKind.Expression && (((_a2 = symbol.tsType.symbol) == null ? void 0 : _a2.escapedName) === "WritableSignal" || ((_b2 = symbol.tsType.symbol) == null ? void 0 : _b2.escapedName) === "Signal") && symbol.tsType.symbol.parent.escapedName.includes("@angular/core")) {
43947
+ const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbol.tcbLocation);
43948
+ const errorString = `${node.name} is a function and should be invoked: ${node.name}()`;
43949
+ const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
43950
+ return [diagnostic];
43951
+ }
43952
+ return [];
43953
+ }
43954
+ var factory = {
43955
+ code: ErrorCode.INTERPOLATED_SIGNAL_NOT_INVOKED,
43956
+ name: ExtendedTemplateDiagnosticName.INTERPOLATED_SIGNAL_NOT_INVOKED,
43957
+ create: () => new InterpolatedSignalCheck()
43958
+ };
43959
+
43907
43960
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
43908
43961
  var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
43909
43962
  constructor() {
@@ -43923,7 +43976,7 @@ var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
43923
43976
  return [diagnostic];
43924
43977
  }
43925
43978
  };
43926
- var factory = {
43979
+ var factory2 = {
43927
43980
  code: ErrorCode.INVALID_BANANA_IN_BOX,
43928
43981
  name: ExtendedTemplateDiagnosticName.INVALID_BANANA_IN_BOX,
43929
43982
  create: () => new InvalidBananaInBoxCheck()
@@ -43965,7 +44018,7 @@ var MissingControlFlowDirectiveCheck = class extends TemplateCheckWithVisitor {
43965
44018
  return [diagnostic];
43966
44019
  }
43967
44020
  };
43968
- var factory2 = {
44021
+ var factory3 = {
43969
44022
  code: ErrorCode.MISSING_CONTROL_FLOW_DIRECTIVE,
43970
44023
  name: ExtendedTemplateDiagnosticName.MISSING_CONTROL_FLOW_DIRECTIVE,
43971
44024
  create: (options) => {
@@ -43999,7 +44052,7 @@ var MissingNgForOfLetCheck = class extends TemplateCheckWithVisitor {
43999
44052
  return [diagnostic];
44000
44053
  }
44001
44054
  };
44002
- var factory3 = {
44055
+ var factory4 = {
44003
44056
  code: ErrorCode.MISSING_NGFOROF_LET,
44004
44057
  name: ExtendedTemplateDiagnosticName.MISSING_NGFOROF_LET,
44005
44058
  create: () => new MissingNgForOfLetCheck()
@@ -44037,7 +44090,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
44037
44090
  return [diagnostic];
44038
44091
  }
44039
44092
  };
44040
- var factory4 = {
44093
+ var factory5 = {
44041
44094
  code: ErrorCode.NULLISH_COALESCING_NOT_NULLABLE,
44042
44095
  name: ExtendedTemplateDiagnosticName.NULLISH_COALESCING_NOT_NULLABLE,
44043
44096
  create: (options) => {
@@ -44082,7 +44135,7 @@ var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
44082
44135
  return [diagnostic];
44083
44136
  }
44084
44137
  };
44085
- var factory5 = {
44138
+ var factory6 = {
44086
44139
  code: ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE,
44087
44140
  name: ExtendedTemplateDiagnosticName.OPTIONAL_CHAIN_NOT_NULLABLE,
44088
44141
  create: (options) => {
@@ -44111,7 +44164,7 @@ var SuffixNotSupportedCheck = class extends TemplateCheckWithVisitor {
44111
44164
  return [diagnostic];
44112
44165
  }
44113
44166
  };
44114
- var factory6 = {
44167
+ var factory7 = {
44115
44168
  code: ErrorCode.SUFFIX_NOT_SUPPORTED,
44116
44169
  name: ExtendedTemplateDiagnosticName.SUFFIX_NOT_SUPPORTED,
44117
44170
  create: () => new SuffixNotSupportedCheck()
@@ -44149,7 +44202,7 @@ var TextAttributeNotBindingSpec = class extends TemplateCheckWithVisitor {
44149
44202
  return [diagnostic];
44150
44203
  }
44151
44204
  };
44152
- var factory7 = {
44205
+ var factory8 = {
44153
44206
  code: ErrorCode.TEXT_ATTRIBUTE_NOT_BINDING,
44154
44207
  name: ExtendedTemplateDiagnosticName.TEXT_ATTRIBUTE_NOT_BINDING,
44155
44208
  create: () => new TextAttributeNotBindingSpec()
@@ -44172,12 +44225,12 @@ var ExtendedTemplateCheckerImpl = class {
44172
44225
  var _a2, _b2, _c2, _d2, _e2;
44173
44226
  this.partialCtx = { templateTypeChecker, typeChecker };
44174
44227
  this.templateChecks = /* @__PURE__ */ new Map();
44175
- for (const factory8 of templateCheckFactories) {
44176
- const category = diagnosticLabelToCategory((_e2 = (_d2 = (_b2 = (_a2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a2.checks) == null ? void 0 : _b2[factory8.name]) != null ? _d2 : (_c2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _c2.defaultCategory) != null ? _e2 : DiagnosticCategoryLabel.Warning);
44228
+ for (const factory9 of templateCheckFactories) {
44229
+ const category = diagnosticLabelToCategory((_e2 = (_d2 = (_b2 = (_a2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a2.checks) == null ? void 0 : _b2[factory9.name]) != null ? _d2 : (_c2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _c2.defaultCategory) != null ? _e2 : DiagnosticCategoryLabel.Warning);
44177
44230
  if (category === null) {
44178
44231
  continue;
44179
44232
  }
44180
- const check = factory8.create(options);
44233
+ const check = factory9.create(options);
44181
44234
  if (check === null) {
44182
44235
  continue;
44183
44236
  }
@@ -44220,13 +44273,14 @@ ${value}`);
44220
44273
 
44221
44274
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/index.mjs
44222
44275
  var ALL_DIAGNOSTIC_FACTORIES = [
44223
- factory,
44224
- factory4,
44225
- factory5,
44226
44276
  factory2,
44227
- factory7,
44277
+ factory5,
44278
+ factory6,
44228
44279
  factory3,
44229
- factory6
44280
+ factory8,
44281
+ factory4,
44282
+ factory7,
44283
+ factory
44230
44284
  ];
44231
44285
 
44232
44286
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
@@ -44889,7 +44943,7 @@ ${allowedCategoryLabels.join("\n")}
44889
44943
  `.trim()
44890
44944
  });
44891
44945
  }
44892
- const allExtendedDiagnosticNames = ALL_DIAGNOSTIC_FACTORIES.map((factory8) => factory8.name);
44946
+ const allExtendedDiagnosticNames = ALL_DIAGNOSTIC_FACTORIES.map((factory9) => factory9.name);
44893
44947
  for (const [checkName, category] of Object.entries((_c2 = (_b2 = options.extendedDiagnostics) == null ? void 0 : _b2.checks) != null ? _c2 : {})) {
44894
44948
  if (!allExtendedDiagnosticNames.includes(checkName)) {
44895
44949
  yield makeConfigDiagnostic({