@angular/core 17.3.0-next.0 → 17.3.0-rc.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 (64) 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 +66 -40
  6. package/esm2022/src/authoring/input/input_type_checking.mjs +1 -1
  7. package/esm2022/src/authoring/model/model.mjs +4 -1
  8. package/esm2022/src/authoring/model/model_signal.mjs +9 -18
  9. package/esm2022/src/authoring/output/output.mjs +35 -0
  10. package/esm2022/src/authoring/output/output_emitter_ref.mjs +74 -0
  11. package/esm2022/src/authoring/output/output_ref.mjs +9 -0
  12. package/esm2022/src/authoring.mjs +3 -2
  13. package/esm2022/src/cached_injector_service.mjs +49 -0
  14. package/esm2022/src/core_private_export.mjs +4 -2
  15. package/esm2022/src/defer/instructions.mjs +29 -3
  16. package/esm2022/src/defer/interfaces.mjs +1 -1
  17. package/esm2022/src/di/host_attribute_token.mjs +40 -0
  18. package/esm2022/src/di/index.mjs +2 -1
  19. package/esm2022/src/di/injector_compatibility.mjs +3 -1
  20. package/esm2022/src/di/interface/provider.mjs +1 -1
  21. package/esm2022/src/di/metadata.mjs +1 -1
  22. package/esm2022/src/di/r3_injector.mjs +26 -15
  23. package/esm2022/src/errors.mjs +1 -1
  24. package/esm2022/src/event_emitter.mjs +19 -2
  25. package/esm2022/src/hydration/api.mjs +2 -2
  26. package/esm2022/src/is_internal.mjs +15 -0
  27. package/esm2022/src/render3/after_render_hooks.mjs +9 -6
  28. package/esm2022/src/render3/component_ref.mjs +103 -93
  29. package/esm2022/src/render3/instructions/listener.mjs +7 -9
  30. package/esm2022/src/render3/instructions/render.mjs +3 -2
  31. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  32. package/esm2022/src/render3/node_manipulation.mjs +13 -4
  33. package/esm2022/src/render3/queue_state_update.mjs +41 -0
  34. package/esm2022/src/render3/reactivity/computed.mjs +3 -1
  35. package/esm2022/src/render3/reactivity/effect.mjs +13 -7
  36. package/esm2022/src/render3/reactivity/signal.mjs +5 -4
  37. package/esm2022/src/render3/view_manipulation.mjs +24 -17
  38. package/esm2022/src/util/assert.mjs +7 -1
  39. package/esm2022/src/version.mjs +1 -1
  40. package/esm2022/testing/src/component_fixture.mjs +78 -19
  41. package/esm2022/testing/src/logger.mjs +3 -3
  42. package/esm2022/testing/src/test_bed_compiler.mjs +26 -4
  43. package/fesm2022/core.mjs +13346 -13065
  44. package/fesm2022/core.mjs.map +1 -1
  45. package/fesm2022/primitives/signals.mjs +1 -1
  46. package/fesm2022/rxjs-interop.mjs +82 -3
  47. package/fesm2022/rxjs-interop.mjs.map +1 -1
  48. package/fesm2022/testing.mjs +102 -21
  49. package/fesm2022/testing.mjs.map +1 -1
  50. package/index.d.ts +219 -78
  51. package/package.json +1 -1
  52. package/primitives/signals/index.d.ts +1 -1
  53. package/rxjs-interop/index.d.ts +39 -1
  54. package/schematics/migrations/block-template-entities/bundle.js +19 -34
  55. package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
  56. package/schematics/migrations/invalid-two-way-bindings/bundle.js +26381 -0
  57. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +7 -0
  58. package/schematics/migrations.json +5 -0
  59. package/schematics/ng-generate/control-flow-migration/bundle.js +21 -36
  60. package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
  61. package/schematics/ng-generate/standalone-migration/bundle.js +6201 -3670
  62. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  63. package/testing/index.d.ts +1 -1
  64. package/esm2022/src/authoring/output.mjs +0 -33
@@ -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));
@@ -19271,7 +19258,6 @@ function optimizeVariablesInOpList(ops, compatibility) {
19271
19258
  const toInline = [];
19272
19259
  for (const [id, count] of varUsages) {
19273
19260
  const decl = varDecls.get(id);
19274
- const varInfo = opMap.get(decl);
19275
19261
  const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
19276
19262
  if (count !== 1 || isAlwaysInline) {
19277
19263
  continue;
@@ -19974,7 +19960,6 @@ function ingestIcu(unit, icu) {
19974
19960
  var _a2;
19975
19961
  if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
19976
19962
  const xref = unit.job.allocateXrefId();
19977
- const icuNode = icu.i18n.nodes[0];
19978
19963
  unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
19979
19964
  for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
19980
19965
  if (text2 instanceof BoundText) {
@@ -25489,7 +25474,7 @@ var ResourceLoader = class {
25489
25474
  };
25490
25475
 
25491
25476
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
25492
- var SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT = false;
25477
+ var SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT = true;
25493
25478
  var CompilerFacadeImpl = class {
25494
25479
  constructor(jitEvaluator = new JitEvaluator()) {
25495
25480
  this.jitEvaluator = jitEvaluator;
@@ -26070,7 +26055,7 @@ function publishFacade(global) {
26070
26055
  }
26071
26056
 
26072
26057
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
26073
- var VERSION2 = new Version("17.3.0-next.0");
26058
+ var VERSION2 = new Version("17.3.0-rc.0");
26074
26059
 
26075
26060
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
26076
26061
  var _VisitorMode;