@angular/core 17.2.2 → 17.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/esm2022/rxjs-interop/src/to_observable.mjs +1 -1
  2. package/esm2022/src/application/application_ref.mjs +21 -6
  3. package/esm2022/src/authoring/input/input_type_checking.mjs +1 -1
  4. package/esm2022/src/authoring/model/model_signal.mjs +3 -2
  5. package/esm2022/src/cached_injector_service.mjs +49 -0
  6. package/esm2022/src/core_private_export.mjs +2 -1
  7. package/esm2022/src/defer/instructions.mjs +29 -3
  8. package/esm2022/src/defer/interfaces.mjs +1 -1
  9. package/esm2022/src/di/interface/provider.mjs +1 -1
  10. package/esm2022/src/di/metadata.mjs +1 -1
  11. package/esm2022/src/di/r3_injector.mjs +26 -15
  12. package/esm2022/src/event_emitter.mjs +9 -2
  13. package/esm2022/src/render3/after_render_hooks.mjs +9 -6
  14. package/esm2022/src/render3/component_ref.mjs +103 -93
  15. package/esm2022/src/render3/instructions/listener.mjs +4 -1
  16. package/esm2022/src/render3/instructions/render.mjs +3 -2
  17. package/esm2022/src/render3/node_manipulation.mjs +13 -4
  18. package/esm2022/src/render3/queue_state_update.mjs +41 -0
  19. package/esm2022/src/render3/reactivity/computed.mjs +3 -1
  20. package/esm2022/src/render3/reactivity/effect.mjs +13 -7
  21. package/esm2022/src/render3/reactivity/signal.mjs +4 -2
  22. package/esm2022/src/render3/view_manipulation.mjs +24 -17
  23. package/esm2022/src/util/assert.mjs +7 -1
  24. package/esm2022/src/version.mjs +1 -1
  25. package/esm2022/testing/src/logger.mjs +3 -3
  26. package/esm2022/testing/src/test_bed_compiler.mjs +26 -4
  27. package/fesm2022/core.mjs +11601 -11435
  28. package/fesm2022/core.mjs.map +1 -1
  29. package/fesm2022/primitives/signals.mjs +1 -1
  30. package/fesm2022/rxjs-interop.mjs +1 -1
  31. package/fesm2022/rxjs-interop.mjs.map +1 -1
  32. package/fesm2022/testing.mjs +26 -4
  33. package/fesm2022/testing.mjs.map +1 -1
  34. package/index.d.ts +47 -18
  35. package/package.json +1 -1
  36. package/primitives/signals/index.d.ts +1 -1
  37. package/rxjs-interop/index.d.ts +1 -1
  38. package/schematics/migrations/block-template-entities/bundle.js +18 -33
  39. package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
  40. package/schematics/ng-generate/control-flow-migration/bundle.js +20 -35
  41. package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
  42. package/schematics/ng-generate/standalone-migration/bundle.js +2927 -2851
  43. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  44. package/testing/index.d.ts +1 -1
@@ -7158,13 +7158,10 @@ var ExpressionKind;
7158
7158
  ExpressionKind2[ExpressionKind2["EmptyExpr"] = 17] = "EmptyExpr";
7159
7159
  ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 18] = "AssignTemporaryExpr";
7160
7160
  ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 19] = "ReadTemporaryExpr";
7161
- ExpressionKind2[ExpressionKind2["SanitizerExpr"] = 20] = "SanitizerExpr";
7162
- ExpressionKind2[ExpressionKind2["TrustedValueFnExpr"] = 21] = "TrustedValueFnExpr";
7163
- ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 22] = "SlotLiteralExpr";
7164
- ExpressionKind2[ExpressionKind2["ConditionalCase"] = 23] = "ConditionalCase";
7165
- ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 24] = "DerivedRepeaterVar";
7166
- ExpressionKind2[ExpressionKind2["ConstCollected"] = 25] = "ConstCollected";
7167
- ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 26] = "TwoWayBindingSet";
7161
+ ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 20] = "SlotLiteralExpr";
7162
+ ExpressionKind2[ExpressionKind2["ConditionalCase"] = 21] = "ConditionalCase";
7163
+ ExpressionKind2[ExpressionKind2["ConstCollected"] = 22] = "ConstCollected";
7164
+ ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 23] = "TwoWayBindingSet";
7168
7165
  })(ExpressionKind || (ExpressionKind = {}));
7169
7166
  var VariableFlags;
7170
7167
  (function(VariableFlags2) {
@@ -7183,12 +7180,6 @@ var CompatibilityMode;
7183
7180
  CompatibilityMode2[CompatibilityMode2["Normal"] = 0] = "Normal";
7184
7181
  CompatibilityMode2[CompatibilityMode2["TemplateDefinitionBuilder"] = 1] = "TemplateDefinitionBuilder";
7185
7182
  })(CompatibilityMode || (CompatibilityMode = {}));
7186
- var DeferSecondaryKind;
7187
- (function(DeferSecondaryKind2) {
7188
- DeferSecondaryKind2[DeferSecondaryKind2["Loading"] = 0] = "Loading";
7189
- DeferSecondaryKind2[DeferSecondaryKind2["Placeholder"] = 1] = "Placeholder";
7190
- DeferSecondaryKind2[DeferSecondaryKind2["Error"] = 2] = "Error";
7191
- })(DeferSecondaryKind || (DeferSecondaryKind = {}));
7192
7183
  var BindingKind;
7193
7184
  (function(BindingKind2) {
7194
7185
  BindingKind2[BindingKind2["Attribute"] = 0] = "Attribute";
@@ -7262,10 +7253,6 @@ var TRAIT_DEPENDS_ON_SLOT_CONTEXT = {
7262
7253
  var TRAIT_CONSUMES_VARS = {
7263
7254
  [ConsumesVarsTrait]: true
7264
7255
  };
7265
- var TRAIT_USES_VAR_OFFSET = {
7266
- [UsesVarOffset]: true,
7267
- varOffset: null
7268
- };
7269
7256
  function hasConsumesSlotTrait(op) {
7270
7257
  return op[ConsumesSlot] === true;
7271
7258
  }
@@ -9530,7 +9517,7 @@ var ElementAttributes = class {
9530
9517
  this.propertyBindings = null;
9531
9518
  this.projectAs = null;
9532
9519
  }
9533
- isKnown(kind, name, value) {
9520
+ isKnown(kind, name) {
9534
9521
  var _a2;
9535
9522
  const nameToValue = (_a2 = this.known.get(kind)) != null ? _a2 : /* @__PURE__ */ new Set();
9536
9523
  this.known.set(kind, nameToValue);
@@ -9543,7 +9530,7 @@ var ElementAttributes = class {
9543
9530
  add(kind, name, value, namespace, trustedValueFn) {
9544
9531
  var _a2;
9545
9532
  const allowDuplicates = this.compatibility === CompatibilityMode.TemplateDefinitionBuilder && (kind === BindingKind.Attribute || kind === BindingKind.ClassName || kind === BindingKind.StyleProperty);
9546
- if (!allowDuplicates && this.isKnown(kind, name, value)) {
9533
+ if (!allowDuplicates && this.isKnown(kind, name)) {
9547
9534
  return;
9548
9535
  }
9549
9536
  if (name === "ngProjectAs") {
@@ -10143,7 +10130,7 @@ function createI18nMessage(job, context, messagePlaceholder) {
10143
10130
  }
10144
10131
  function formatIcuPlaceholder(op) {
10145
10132
  if (op.strings.length !== op.expressionPlaceholders.length + 1) {
10146
- throw Error(`AsserionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);
10133
+ throw Error(`AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);
10147
10134
  }
10148
10135
  const values = op.expressionPlaceholders.map(formatValue);
10149
10136
  return op.strings.flatMap((str, i) => [str, values[i] || ""]).join("");
@@ -16789,7 +16776,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
16789
16776
  }
16790
16777
  if (op.emptyView !== null) {
16791
16778
  const emptyView = unit.job.views.get(op.emptyView);
16792
- addNamesToView(emptyView, `${baseName}_${`${op.functionNameSuffix}Empty`}_${op.handle.slot + 2}`, state, compatibility);
16779
+ addNamesToView(emptyView, `${baseName}_${op.functionNameSuffix}Empty_${op.handle.slot + 2}`, state, compatibility);
16793
16780
  }
16794
16781
  addNamesToView(unit.job.views.get(op.xref), `${baseName}_${op.functionNameSuffix}_${op.handle.slot + 1}`, state, compatibility);
16795
16782
  break;
@@ -17210,7 +17197,7 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
17210
17197
  break;
17211
17198
  case OpKind.RepeaterCreate:
17212
17199
  const forView = unit.job.views.get(op.xref);
17213
- subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex);
17200
+ subTemplateIndex = propagateI18nBlocksForView(forView, i18nBlock, op.i18nPlaceholder, subTemplateIndex);
17214
17201
  if (op.emptyView !== null) {
17215
17202
  subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex);
17216
17203
  }
@@ -18310,11 +18297,11 @@ function processLexicalScope(view, ops) {
18310
18297
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
18311
18298
  function resolveDollarEvent(job) {
18312
18299
  for (const unit of job.units) {
18313
- transformDollarEvent(unit, unit.create);
18314
- transformDollarEvent(unit, unit.update);
18300
+ transformDollarEvent(unit.create);
18301
+ transformDollarEvent(unit.update);
18315
18302
  }
18316
18303
  }
18317
- function transformDollarEvent(unit, ops) {
18304
+ function transformDollarEvent(ops) {
18318
18305
  for (const op of ops) {
18319
18306
  if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
18320
18307
  transformExpressionsInOp(op, (expr) => {
@@ -18485,7 +18472,7 @@ function recordTemplateStart(job, view, slot, i18nPlaceholder, i18nContext, i18n
18485
18472
  addParam(i18nContext.params, startName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
18486
18473
  }
18487
18474
  function recordTemplateClose(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
18488
- const { startName, closeName } = i18nPlaceholder;
18475
+ const { closeName } = i18nPlaceholder;
18489
18476
  const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
18490
18477
  if (closeName) {
18491
18478
  addParam(i18nContext.params, closeName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
@@ -18512,14 +18499,14 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
18512
18499
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
18513
18500
  function resolveI18nExpressionPlaceholders(job) {
18514
18501
  var _a2;
18515
- const subTemplateIndicies = /* @__PURE__ */ new Map();
18502
+ const subTemplateIndices = /* @__PURE__ */ new Map();
18516
18503
  const i18nContexts = /* @__PURE__ */ new Map();
18517
18504
  const icuPlaceholders = /* @__PURE__ */ new Map();
18518
18505
  for (const unit of job.units) {
18519
18506
  for (const op of unit.create) {
18520
18507
  switch (op.kind) {
18521
18508
  case OpKind.I18nStart:
18522
- subTemplateIndicies.set(op.xref, op.subTemplateIndex);
18509
+ subTemplateIndices.set(op.xref, op.subTemplateIndex);
18523
18510
  break;
18524
18511
  case OpKind.I18nContext:
18525
18512
  i18nContexts.set(op.xref, op);
@@ -18536,7 +18523,7 @@ function resolveI18nExpressionPlaceholders(job) {
18536
18523
  for (const op of unit.update) {
18537
18524
  if (op.kind === OpKind.I18nExpression) {
18538
18525
  const index = expressionIndices.get(referenceIndex(op)) || 0;
18539
- const subTemplateIndex = (_a2 = subTemplateIndicies.get(op.i18nOwner)) != null ? _a2 : null;
18526
+ const subTemplateIndex = (_a2 = subTemplateIndices.get(op.i18nOwner)) != null ? _a2 : null;
18540
18527
  const value = {
18541
18528
  value: index,
18542
18529
  subTemplateIndex,
@@ -18600,7 +18587,7 @@ function processLexicalScope2(unit, ops, savedView) {
18600
18587
  if (op.kind == OpKind.Listener || op.kind === OpKind.TwoWayListener) {
18601
18588
  continue;
18602
18589
  }
18603
- transformExpressionsInOp(op, (expr, flags) => {
18590
+ transformExpressionsInOp(op, (expr) => {
18604
18591
  if (expr instanceof LexicalReadExpr) {
18605
18592
  if (scope.has(expr.name)) {
18606
18593
  return new ReadVariableExpr(scope.get(expr.name));
@@ -19202,7 +19189,6 @@ function optimizeVariablesInOpList(ops, compatibility) {
19202
19189
  const toInline = [];
19203
19190
  for (const [id, count] of varUsages) {
19204
19191
  const decl = varDecls.get(id);
19205
- const varInfo = opMap.get(decl);
19206
19192
  const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
19207
19193
  if (count !== 1 || isAlwaysInline) {
19208
19194
  continue;
@@ -19905,7 +19891,6 @@ function ingestIcu(unit, icu) {
19905
19891
  var _a2;
19906
19892
  if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
19907
19893
  const xref = unit.job.allocateXrefId();
19908
- const icuNode = icu.i18n.nodes[0];
19909
19894
  unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
19910
19895
  for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
19911
19896
  if (text2 instanceof BoundText) {
@@ -26001,7 +25986,7 @@ function publishFacade(global) {
26001
25986
  }
26002
25987
 
26003
25988
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
26004
- var VERSION2 = new Version("17.2.2");
25989
+ var VERSION2 = new Version("17.2.4");
26005
25990
 
26006
25991
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
26007
25992
  var _VisitorMode;
@@ -26813,10 +26798,10 @@ function formatTemplate(tmpl, templateType) {
26813
26798
  const selfClosingRegex = new RegExp(`^\\s*<(${selfClosingList}).+\\/?>`);
26814
26799
  const openSelfClosingRegex = new RegExp(`^\\s*<(${selfClosingList})(?![^>]*\\/>)[^>]*$`);
26815
26800
  const closeBlockRegex = /^\s*\}\s*$|^\s*\}\s\@else/;
26816
- const closeElRegex = /\s*<\/([a-zA-Z0-9\-_]+)*>/;
26801
+ const closeElRegex = /\s*<\/([a-zA-Z0-9\-_]+)\s*>/m;
26817
26802
  const closeMultiLineElRegex = /^\s*([a-zA-Z0-9\-_\[\]]+)?=?"?([^”<]+)?"?\s?\/>$/;
26818
26803
  const closeSelfClosingMultiLineRegex = /^\s*([a-zA-Z0-9\-_\[\]]+)?=?"?([^”\/<]+)?"?\s?>$/;
26819
- const singleLineElRegex = /\s*<([a-zA-Z0-9]+)(?![^>]*\/>)[^>]*>.*<\/([a-zA-Z0-9\-_]+)*>/;
26804
+ const singleLineElRegex = /\s*<([a-zA-Z0-9]+)(?![^>]*\/>)[^>]*>.*<\/([a-zA-Z0-9\-_]+)\s*>/;
26820
26805
  const lines = tmpl.split("\n");
26821
26806
  const formatted = [];
26822
26807
  let indent = "";