@angular/core 17.3.0-next.1 → 17.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/esm2022/rxjs-interop/src/index.mjs +3 -1
  2. package/esm2022/rxjs-interop/src/output_from_observable.mjs +68 -0
  3. package/esm2022/rxjs-interop/src/output_to_observable.mjs +29 -0
  4. package/esm2022/rxjs-interop/src/to_observable.mjs +1 -1
  5. package/esm2022/src/application/application_ref.mjs +56 -40
  6. package/esm2022/src/authoring/input/input.mjs +4 -1
  7. package/esm2022/src/authoring/input/input_type_checking.mjs +1 -1
  8. package/esm2022/src/authoring/model/model.mjs +4 -1
  9. package/esm2022/src/authoring/model/model_signal.mjs +9 -18
  10. package/esm2022/src/authoring/output/output.mjs +35 -0
  11. package/esm2022/src/authoring/output/output_emitter_ref.mjs +85 -0
  12. package/esm2022/src/authoring/output/output_ref.mjs +9 -0
  13. package/esm2022/src/authoring/queries.mjs +7 -1
  14. package/esm2022/src/authoring.mjs +3 -2
  15. package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +1 -1
  16. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +10 -4
  17. package/esm2022/src/core_private_export.mjs +4 -4
  18. package/esm2022/src/di/contextual.mjs +9 -3
  19. package/esm2022/src/di/interface/provider.mjs +1 -1
  20. package/esm2022/src/di/metadata.mjs +1 -1
  21. package/esm2022/src/di/r3_injector.mjs +26 -15
  22. package/esm2022/src/errors.mjs +1 -1
  23. package/esm2022/src/event_emitter.mjs +18 -2
  24. package/esm2022/src/hydration/annotate.mjs +4 -2
  25. package/esm2022/src/hydration/api.mjs +28 -3
  26. package/esm2022/src/hydration/cleanup.mjs +18 -2
  27. package/esm2022/src/hydration/interfaces.mjs +1 -1
  28. package/esm2022/src/hydration/node_lookup_utils.mjs +59 -39
  29. package/esm2022/src/hydration/tokens.mjs +6 -1
  30. package/esm2022/src/i18n/utils.mjs +16 -0
  31. package/esm2022/src/render3/after_render_hooks.mjs +12 -9
  32. package/esm2022/src/render3/component_ref.mjs +103 -93
  33. package/esm2022/src/render3/i18n/i18n_apply.mjs +32 -7
  34. package/esm2022/src/render3/i18n/i18n_parse.mjs +50 -16
  35. package/esm2022/src/render3/instructions/control_flow.mjs +4 -2
  36. package/esm2022/src/render3/instructions/element.mjs +5 -3
  37. package/esm2022/src/render3/instructions/element_container.mjs +3 -2
  38. package/esm2022/src/render3/instructions/listener.mjs +7 -9
  39. package/esm2022/src/render3/instructions/render.mjs +3 -2
  40. package/esm2022/src/render3/instructions/template.mjs +4 -2
  41. package/esm2022/src/render3/instructions/text.mjs +4 -2
  42. package/esm2022/src/render3/interfaces/i18n.mjs +1 -1
  43. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  44. package/esm2022/src/render3/node_manipulation.mjs +18 -5
  45. package/esm2022/src/render3/node_selector_matcher.mjs +37 -51
  46. package/esm2022/src/render3/queue_state_update.mjs +2 -4
  47. package/esm2022/src/render3/reactivity/effect.mjs +11 -7
  48. package/esm2022/src/render3/reactivity/signal.mjs +3 -4
  49. package/esm2022/src/render3/util/view_utils.mjs +2 -1
  50. package/esm2022/src/render3/view_manipulation.mjs +24 -17
  51. package/esm2022/src/sanitization/html_sanitizer.mjs +54 -14
  52. package/esm2022/src/util/assert.mjs +7 -1
  53. package/esm2022/src/version.mjs +1 -1
  54. package/esm2022/testing/src/component_fixture.mjs +15 -11
  55. package/esm2022/testing/src/logger.mjs +3 -3
  56. package/esm2022/testing/src/test_bed_compiler.mjs +26 -4
  57. package/fesm2022/core.mjs +14049 -13736
  58. package/fesm2022/core.mjs.map +1 -1
  59. package/fesm2022/primitives/signals.mjs +1 -1
  60. package/fesm2022/rxjs-interop.mjs +82 -3
  61. package/fesm2022/rxjs-interop.mjs.map +1 -1
  62. package/fesm2022/testing.mjs +38 -12
  63. package/fesm2022/testing.mjs.map +1 -1
  64. package/index.d.ts +210 -78
  65. package/package.json +1 -1
  66. package/primitives/signals/index.d.ts +1 -1
  67. package/rxjs-interop/index.d.ts +39 -1
  68. package/schematics/migrations/block-template-entities/bundle.js +25 -34
  69. package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
  70. package/schematics/migrations/invalid-two-way-bindings/bundle.js +26387 -0
  71. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +7 -0
  72. package/schematics/migrations.json +5 -0
  73. package/schematics/ng-generate/control-flow-migration/bundle.js +25 -34
  74. package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
  75. package/schematics/ng-generate/standalone-migration/bundle.js +424 -351
  76. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  77. package/testing/index.d.ts +1 -1
  78. package/esm2022/src/authoring/output.mjs +0 -33
  79. package/esm2022/src/is_internal.mjs +0 -15
@@ -7227,13 +7227,10 @@ var ExpressionKind;
7227
7227
  ExpressionKind2[ExpressionKind2["EmptyExpr"] = 17] = "EmptyExpr";
7228
7228
  ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 18] = "AssignTemporaryExpr";
7229
7229
  ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 19] = "ReadTemporaryExpr";
7230
- ExpressionKind2[ExpressionKind2["SanitizerExpr"] = 20] = "SanitizerExpr";
7231
- ExpressionKind2[ExpressionKind2["TrustedValueFnExpr"] = 21] = "TrustedValueFnExpr";
7232
- ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 22] = "SlotLiteralExpr";
7233
- ExpressionKind2[ExpressionKind2["ConditionalCase"] = 23] = "ConditionalCase";
7234
- ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 24] = "DerivedRepeaterVar";
7235
- ExpressionKind2[ExpressionKind2["ConstCollected"] = 25] = "ConstCollected";
7236
- ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 26] = "TwoWayBindingSet";
7230
+ ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 20] = "SlotLiteralExpr";
7231
+ ExpressionKind2[ExpressionKind2["ConditionalCase"] = 21] = "ConditionalCase";
7232
+ ExpressionKind2[ExpressionKind2["ConstCollected"] = 22] = "ConstCollected";
7233
+ ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 23] = "TwoWayBindingSet";
7237
7234
  })(ExpressionKind || (ExpressionKind = {}));
7238
7235
  var VariableFlags;
7239
7236
  (function(VariableFlags2) {
@@ -7252,12 +7249,6 @@ var CompatibilityMode;
7252
7249
  CompatibilityMode2[CompatibilityMode2["Normal"] = 0] = "Normal";
7253
7250
  CompatibilityMode2[CompatibilityMode2["TemplateDefinitionBuilder"] = 1] = "TemplateDefinitionBuilder";
7254
7251
  })(CompatibilityMode || (CompatibilityMode = {}));
7255
- var DeferSecondaryKind;
7256
- (function(DeferSecondaryKind2) {
7257
- DeferSecondaryKind2[DeferSecondaryKind2["Loading"] = 0] = "Loading";
7258
- DeferSecondaryKind2[DeferSecondaryKind2["Placeholder"] = 1] = "Placeholder";
7259
- DeferSecondaryKind2[DeferSecondaryKind2["Error"] = 2] = "Error";
7260
- })(DeferSecondaryKind || (DeferSecondaryKind = {}));
7261
7252
  var BindingKind;
7262
7253
  (function(BindingKind2) {
7263
7254
  BindingKind2[BindingKind2["Attribute"] = 0] = "Attribute";
@@ -7331,10 +7322,6 @@ var TRAIT_DEPENDS_ON_SLOT_CONTEXT = {
7331
7322
  var TRAIT_CONSUMES_VARS = {
7332
7323
  [ConsumesVarsTrait]: true
7333
7324
  };
7334
- var TRAIT_USES_VAR_OFFSET = {
7335
- [UsesVarOffset]: true,
7336
- varOffset: null
7337
- };
7338
7325
  function hasConsumesSlotTrait(op) {
7339
7326
  return op[ConsumesSlot] === true;
7340
7327
  }
@@ -9599,7 +9586,7 @@ var ElementAttributes = class {
9599
9586
  this.propertyBindings = null;
9600
9587
  this.projectAs = null;
9601
9588
  }
9602
- isKnown(kind, name, value) {
9589
+ isKnown(kind, name) {
9603
9590
  var _a2;
9604
9591
  const nameToValue = (_a2 = this.known.get(kind)) != null ? _a2 : /* @__PURE__ */ new Set();
9605
9592
  this.known.set(kind, nameToValue);
@@ -9612,7 +9599,7 @@ var ElementAttributes = class {
9612
9599
  add(kind, name, value, namespace, trustedValueFn) {
9613
9600
  var _a2;
9614
9601
  const allowDuplicates = this.compatibility === CompatibilityMode.TemplateDefinitionBuilder && (kind === BindingKind.Attribute || kind === BindingKind.ClassName || kind === BindingKind.StyleProperty);
9615
- if (!allowDuplicates && this.isKnown(kind, name, value)) {
9602
+ if (!allowDuplicates && this.isKnown(kind, name)) {
9616
9603
  return;
9617
9604
  }
9618
9605
  if (name === "ngProjectAs") {
@@ -10212,7 +10199,7 @@ function createI18nMessage(job, context, messagePlaceholder) {
10212
10199
  }
10213
10200
  function formatIcuPlaceholder(op) {
10214
10201
  if (op.strings.length !== op.expressionPlaceholders.length + 1) {
10215
- throw Error(`AsserionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);
10202
+ throw Error(`AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);
10216
10203
  }
10217
10204
  const values = op.expressionPlaceholders.map(formatValue);
10218
10205
  return op.strings.flatMap((str, i) => [str, values[i] || ""]).join("");
@@ -16858,7 +16845,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
16858
16845
  }
16859
16846
  if (op.emptyView !== null) {
16860
16847
  const emptyView = unit.job.views.get(op.emptyView);
16861
- addNamesToView(emptyView, `${baseName}_${`${op.functionNameSuffix}Empty`}_${op.handle.slot + 2}`, state, compatibility);
16848
+ addNamesToView(emptyView, `${baseName}_${op.functionNameSuffix}Empty_${op.handle.slot + 2}`, state, compatibility);
16862
16849
  }
16863
16850
  addNamesToView(unit.job.views.get(op.xref), `${baseName}_${op.functionNameSuffix}_${op.handle.slot + 1}`, state, compatibility);
16864
16851
  break;
@@ -17279,7 +17266,7 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
17279
17266
  break;
17280
17267
  case OpKind.RepeaterCreate:
17281
17268
  const forView = unit.job.views.get(op.xref);
17282
- subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex);
17269
+ subTemplateIndex = propagateI18nBlocksForView(forView, i18nBlock, op.i18nPlaceholder, subTemplateIndex);
17283
17270
  if (op.emptyView !== null) {
17284
17271
  subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex);
17285
17272
  }
@@ -18379,11 +18366,11 @@ function processLexicalScope(view, ops) {
18379
18366
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
18380
18367
  function resolveDollarEvent(job) {
18381
18368
  for (const unit of job.units) {
18382
- transformDollarEvent(unit, unit.create);
18383
- transformDollarEvent(unit, unit.update);
18369
+ transformDollarEvent(unit.create);
18370
+ transformDollarEvent(unit.update);
18384
18371
  }
18385
18372
  }
18386
- function transformDollarEvent(unit, ops) {
18373
+ function transformDollarEvent(ops) {
18387
18374
  for (const op of ops) {
18388
18375
  if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
18389
18376
  transformExpressionsInOp(op, (expr) => {
@@ -18554,7 +18541,7 @@ function recordTemplateStart(job, view, slot, i18nPlaceholder, i18nContext, i18n
18554
18541
  addParam(i18nContext.params, startName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
18555
18542
  }
18556
18543
  function recordTemplateClose(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
18557
- const { startName, closeName } = i18nPlaceholder;
18544
+ const { closeName } = i18nPlaceholder;
18558
18545
  const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
18559
18546
  if (closeName) {
18560
18547
  addParam(i18nContext.params, closeName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
@@ -18581,14 +18568,14 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
18581
18568
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
18582
18569
  function resolveI18nExpressionPlaceholders(job) {
18583
18570
  var _a2;
18584
- const subTemplateIndicies = /* @__PURE__ */ new Map();
18571
+ const subTemplateIndices = /* @__PURE__ */ new Map();
18585
18572
  const i18nContexts = /* @__PURE__ */ new Map();
18586
18573
  const icuPlaceholders = /* @__PURE__ */ new Map();
18587
18574
  for (const unit of job.units) {
18588
18575
  for (const op of unit.create) {
18589
18576
  switch (op.kind) {
18590
18577
  case OpKind.I18nStart:
18591
- subTemplateIndicies.set(op.xref, op.subTemplateIndex);
18578
+ subTemplateIndices.set(op.xref, op.subTemplateIndex);
18592
18579
  break;
18593
18580
  case OpKind.I18nContext:
18594
18581
  i18nContexts.set(op.xref, op);
@@ -18605,7 +18592,7 @@ function resolveI18nExpressionPlaceholders(job) {
18605
18592
  for (const op of unit.update) {
18606
18593
  if (op.kind === OpKind.I18nExpression) {
18607
18594
  const index = expressionIndices.get(referenceIndex(op)) || 0;
18608
- const subTemplateIndex = (_a2 = subTemplateIndicies.get(op.i18nOwner)) != null ? _a2 : null;
18595
+ const subTemplateIndex = (_a2 = subTemplateIndices.get(op.i18nOwner)) != null ? _a2 : null;
18609
18596
  const value = {
18610
18597
  value: index,
18611
18598
  subTemplateIndex,
@@ -18669,7 +18656,7 @@ function processLexicalScope2(unit, ops, savedView) {
18669
18656
  if (op.kind == OpKind.Listener || op.kind === OpKind.TwoWayListener) {
18670
18657
  continue;
18671
18658
  }
18672
- transformExpressionsInOp(op, (expr, flags) => {
18659
+ transformExpressionsInOp(op, (expr) => {
18673
18660
  if (expr instanceof LexicalReadExpr) {
18674
18661
  if (scope.has(expr.name)) {
18675
18662
  return new ReadVariableExpr(scope.get(expr.name));
@@ -18782,10 +18769,13 @@ function transformTwoWayBindingSet(job) {
18782
18769
  }
18783
18770
  }
18784
18771
  function wrapSetOperation(target, value) {
18772
+ if (target instanceof ReadVariableExpr) {
18773
+ return twoWayBindingSet(target, value);
18774
+ }
18785
18775
  return twoWayBindingSet(target, value).or(target.set(value));
18786
18776
  }
18787
18777
  function isReadExpression2(value) {
18788
- return value instanceof ReadPropExpr || value instanceof ReadKeyExpr;
18778
+ return value instanceof ReadPropExpr || value instanceof ReadKeyExpr || value instanceof ReadVariableExpr;
18789
18779
  }
18790
18780
  function wrapAction(target, value) {
18791
18781
  if (isReadExpression2(target)) {
@@ -19271,7 +19261,6 @@ function optimizeVariablesInOpList(ops, compatibility) {
19271
19261
  const toInline = [];
19272
19262
  for (const [id, count] of varUsages) {
19273
19263
  const decl = varDecls.get(id);
19274
- const varInfo = opMap.get(decl);
19275
19264
  const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
19276
19265
  if (count !== 1 || isAlwaysInline) {
19277
19266
  continue;
@@ -19974,7 +19963,6 @@ function ingestIcu(unit, icu) {
19974
19963
  var _a2;
19975
19964
  if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
19976
19965
  const xref = unit.job.allocateXrefId();
19977
- const icuNode = icu.i18n.nodes[0];
19978
19966
  unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
19979
19967
  for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
19980
19968
  if (text2 instanceof BoundText) {
@@ -20989,6 +20977,9 @@ function parseForLoopParameters(block, errors, bindingParser) {
20989
20977
  errors.push(new ParseError(param.sourceSpan, '@for loop can only have one "track" expression'));
20990
20978
  } else {
20991
20979
  const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);
20980
+ if (expression.ast instanceof EmptyExpr) {
20981
+ errors.push(new ParseError(param.sourceSpan, '@for loop must have a "track" expression'));
20982
+ }
20992
20983
  const keywordSpan = new ParseSourceSpan(param.sourceSpan.start, param.sourceSpan.start.moveBy("track".length));
20993
20984
  result.trackBy = { expression, keywordSpan };
20994
20985
  }
@@ -26070,7 +26061,7 @@ function publishFacade(global) {
26070
26061
  }
26071
26062
 
26072
26063
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
26073
- var VERSION2 = new Version("17.3.0-next.1");
26064
+ var VERSION2 = new Version("17.3.0");
26074
26065
 
26075
26066
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
26076
26067
  var _VisitorMode;