@angular/core 17.0.0-next.2 → 17.0.0-next.3

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 (47) hide show
  1. package/esm2022/src/core_render3_private_export.mjs +2 -2
  2. package/esm2022/src/hydration/annotate.mjs +9 -6
  3. package/esm2022/src/hydration/cleanup.mjs +2 -2
  4. package/esm2022/src/linker/template_ref.mjs +3 -3
  5. package/esm2022/src/linker/view_container_ref.mjs +80 -25
  6. package/esm2022/src/render3/after_render_hooks.mjs +69 -41
  7. package/esm2022/src/render3/component.mjs +4 -3
  8. package/esm2022/src/render3/di.mjs +1 -1
  9. package/esm2022/src/render3/index.mjs +2 -2
  10. package/esm2022/src/render3/instructions/all.mjs +2 -1
  11. package/esm2022/src/render3/instructions/change_detection.mjs +5 -6
  12. package/esm2022/src/render3/instructions/component_instance.mjs +23 -0
  13. package/esm2022/src/render3/instructions/control_flow.mjs +20 -4
  14. package/esm2022/src/render3/instructions/defer.mjs +100 -39
  15. package/esm2022/src/render3/instructions/shared.mjs +20 -14
  16. package/esm2022/src/render3/interfaces/defer.mjs +1 -1
  17. package/esm2022/src/render3/interfaces/injector.mjs +1 -1
  18. package/esm2022/src/render3/interfaces/node.mjs +16 -1
  19. package/esm2022/src/render3/interfaces/styling.mjs +4 -7
  20. package/esm2022/src/render3/jit/environment.mjs +2 -1
  21. package/esm2022/src/render3/node_manipulation.mjs +4 -3
  22. package/esm2022/src/render3/reactive_lview_consumer.mjs +25 -45
  23. package/esm2022/src/render3/reactivity/effect.mjs +8 -8
  24. package/esm2022/src/render3/util/injector_utils.mjs +1 -1
  25. package/esm2022/src/render3/view_manipulation.mjs +13 -2
  26. package/esm2022/src/signals/index.mjs +4 -4
  27. package/esm2022/src/signals/src/api.mjs +2 -11
  28. package/esm2022/src/signals/src/computed.mjs +43 -93
  29. package/esm2022/src/signals/src/graph.mjs +238 -162
  30. package/esm2022/src/signals/src/signal.mjs +59 -79
  31. package/esm2022/src/signals/src/watch.mjs +38 -52
  32. package/esm2022/src/signals/src/weak_ref.mjs +2 -29
  33. package/esm2022/src/util/security/trusted_type_defs.mjs +1 -1
  34. package/esm2022/src/util/security/trusted_types.mjs +1 -1
  35. package/esm2022/src/version.mjs +1 -1
  36. package/esm2022/src/zone/ng_zone.mjs +16 -1
  37. package/esm2022/testing/src/logger.mjs +3 -3
  38. package/fesm2022/core.mjs +1977 -1815
  39. package/fesm2022/core.mjs.map +1 -1
  40. package/fesm2022/rxjs-interop.mjs +1 -1
  41. package/fesm2022/testing.mjs +1 -1
  42. package/index.d.ts +143 -125
  43. package/package.json +1 -1
  44. package/rxjs-interop/index.d.ts +1 -1
  45. package/schematics/ng-generate/standalone-migration/bundle.js +192 -53
  46. package/schematics/ng-generate/standalone-migration/bundle.js.map +3 -3
  47. package/testing/index.d.ts +1 -1
@@ -1803,7 +1803,7 @@ var FunctionExpr = class extends Expression {
1803
1803
  this.name = name;
1804
1804
  }
1805
1805
  isEquivalent(e) {
1806
- return e instanceof FunctionExpr && areAllEquivalent(this.params, e.params) && areAllEquivalent(this.statements, e.statements);
1806
+ return (e instanceof FunctionExpr || e instanceof DeclareFunctionStmt) && areAllEquivalent(this.params, e.params) && areAllEquivalent(this.statements, e.statements);
1807
1807
  }
1808
1808
  isConstant() {
1809
1809
  return false;
@@ -1845,6 +1845,9 @@ var ArrowFunctionExpr = class extends Expression {
1845
1845
  clone() {
1846
1846
  return new ArrowFunctionExpr(this.params.map((p2) => p2.clone()), Array.isArray(this.body) ? this.body : this.body.clone(), this.type, this.sourceSpan);
1847
1847
  }
1848
+ toDeclStmt(name, modifiers) {
1849
+ return new DeclareVarStmt(name, this, INFERRED_TYPE, modifiers, this.sourceSpan);
1850
+ }
1848
1851
  };
1849
1852
  var UnaryOperatorExpr = class extends Expression {
1850
1853
  constructor(operator, expr, type, sourceSpan, parens = true) {
@@ -2478,13 +2481,28 @@ var ConstantPool = class {
2478
2481
  }))));
2479
2482
  }
2480
2483
  }
2484
+ getSharedFunctionReference(fn2, prefix) {
2485
+ var _a2;
2486
+ const isArrow = fn2 instanceof ArrowFunctionExpr;
2487
+ for (const current of this.statements) {
2488
+ if (isArrow && current instanceof DeclareVarStmt && ((_a2 = current.value) == null ? void 0 : _a2.isEquivalent(fn2))) {
2489
+ return variable(current.name);
2490
+ }
2491
+ if (!isArrow && current instanceof DeclareFunctionStmt && fn2.isEquivalent(current)) {
2492
+ return variable(current.name);
2493
+ }
2494
+ }
2495
+ const name = this.uniqueName(prefix);
2496
+ this.statements.push(fn2.toDeclStmt(name, StmtModifier.Final));
2497
+ return variable(name);
2498
+ }
2481
2499
  _getLiteralFactory(key, values, resultMap) {
2482
2500
  let literalFactory = this.literalFactories.get(key);
2483
2501
  const literalFactoryArguments = values.filter((e) => !e.isConstant());
2484
2502
  if (!literalFactory) {
2485
2503
  const resultExpressions = values.map((e, index) => e.isConstant() ? this.getConstLiteral(e, true) : variable(`a${index}`));
2486
2504
  const parameters = resultExpressions.filter(isVariable).map((e) => new FnParam(e.name, DYNAMIC_TYPE));
2487
- const pureFunctionDeclaration = fn(parameters, [new ReturnStatement(resultMap(resultExpressions))], INFERRED_TYPE);
2505
+ const pureFunctionDeclaration = arrowFn(parameters, resultMap(resultExpressions), INFERRED_TYPE);
2488
2506
  const name = this.freshName();
2489
2507
  this.statements.push(variable(name).set(pureFunctionDeclaration).toDeclStmt(INFERRED_TYPE, StmtModifier.Final));
2490
2508
  literalFactory = variable(name);
@@ -2788,6 +2806,9 @@ var Identifiers = _Identifiers;
2788
2806
  (() => {
2789
2807
  _Identifiers.repeaterTrackByIdentity = { name: "\u0275\u0275repeaterTrackByIdentity", moduleName: CORE };
2790
2808
  })();
2809
+ (() => {
2810
+ _Identifiers.componentInstance = { name: "\u0275\u0275componentInstance", moduleName: CORE };
2811
+ })();
2791
2812
  (() => {
2792
2813
  _Identifiers.text = { name: "\u0275\u0275text", moduleName: CORE };
2793
2814
  })();
@@ -6787,6 +6808,25 @@ function convertPropertyBinding(localResolver, implicitReceiver, expressionWitho
6787
6808
  }
6788
6809
  return new ConvertPropertyBindingResult(stmts, outputExpr);
6789
6810
  }
6811
+ function convertPureComponentScopeFunction(ast, localResolver, implicitReceiver, bindingId) {
6812
+ const converted = convertPropertyBindingBuiltins({
6813
+ createLiteralArrayConverter: () => (args) => literalArr(args),
6814
+ createLiteralMapConverter: (keys) => (values) => literalMap(keys.map((key, index) => {
6815
+ return {
6816
+ key: key.key,
6817
+ value: values[index],
6818
+ quoted: key.quoted
6819
+ };
6820
+ })),
6821
+ createPipeConverter: () => {
6822
+ throw new Error("Illegal State: Pipes are not allowed in this context");
6823
+ }
6824
+ }, ast);
6825
+ const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, false);
6826
+ const statements = [];
6827
+ flattenStatements(converted.visit(visitor, _Mode.Statement), statements);
6828
+ return statements;
6829
+ }
6790
6830
  function convertUpdateArguments(localResolver, contextVariableExpression, expressionWithArgumentsToExtract, bindingId) {
6791
6831
  const visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId, true);
6792
6832
  const outputExpr = visitor.visitInterpolation(expressionWithArgumentsToExtract, _Mode.Expression);
@@ -19433,7 +19473,10 @@ function validateSwitchBlock(ast) {
19433
19473
  const [primaryBlock, ...secondaryBlocks] = ast.blocks;
19434
19474
  const errors = [];
19435
19475
  let hasDefault = false;
19436
- if (primaryBlock.children.length > 0) {
19476
+ const hasPrimary = primaryBlock.children.length > 0 && primaryBlock.children.some((child) => {
19477
+ return !(child instanceof Text4) || child.value.trim().length > 0;
19478
+ });
19479
+ if (hasPrimary) {
19437
19480
  errors.push(new ParseError(primaryBlock.sourceSpan, 'Switch block can only contain "case" and "default" blocks'));
19438
19481
  }
19439
19482
  if (primaryBlock.parameters.length !== 1) {
@@ -20505,9 +20548,10 @@ function createComponentDefConsts() {
20505
20548
  };
20506
20549
  }
20507
20550
  var TemplateData = class {
20508
- constructor(name, index, visitor) {
20551
+ constructor(name, index, scope, visitor) {
20509
20552
  this.name = name;
20510
20553
  this.index = index;
20554
+ this.scope = scope;
20511
20555
  this.visitor = visitor;
20512
20556
  }
20513
20557
  getConstCount() {
@@ -20999,7 +21043,7 @@ var TemplateDefinitionBuilder = class {
20999
21043
  this._ngContentReservedSlots.push(...visitor._ngContentReservedSlots);
21000
21044
  }
21001
21045
  });
21002
- return new TemplateData(name, index, visitor);
21046
+ return new TemplateData(name, index, visitor._bindingScope, visitor);
21003
21047
  }
21004
21048
  createEmbeddedTemplateFn(tagName, children, contextNameSuffix, sourceSpan, variables = [], attrsExprs, references, i18n2) {
21005
21049
  const data = this.prepareEmbeddedTemplateFn(children, contextNameSuffix, variables, i18n2);
@@ -21194,15 +21238,15 @@ var TemplateDefinitionBuilder = class {
21194
21238
  const dependencyExp = [];
21195
21239
  for (const deferredDep of deferredDeps) {
21196
21240
  if (deferredDep.isDeferrable) {
21197
- const innerFn = fn([new FnParam("m", DYNAMIC_TYPE)], [new ReturnStatement(variable("m").prop(deferredDep.symbolName))]);
21241
+ const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(deferredDep.symbolName));
21198
21242
  const importExpr2 = new DynamicImportExpr(deferredDep.importPath).prop("then").callFn([innerFn]);
21199
21243
  dependencyExp.push(importExpr2);
21200
21244
  } else {
21201
21245
  dependencyExp.push(deferredDep.type);
21202
21246
  }
21203
21247
  }
21204
- const depsFnExpr = fn([], [new ReturnStatement(literalArr(dependencyExp))], INFERRED_TYPE, null, name);
21205
- this.constantPool.statements.push(depsFnExpr.toDeclStmt(name));
21248
+ const depsFnExpr = arrowFn([], literalArr(dependencyExp));
21249
+ this.constantPool.statements.push(depsFnExpr.toDeclStmt(name, StmtModifier.Final));
21206
21250
  return variable(name);
21207
21251
  }
21208
21252
  createDeferTriggerInstructions(deferredIndex, triggers, prefetch) {
@@ -21236,55 +21280,95 @@ var TemplateDefinitionBuilder = class {
21236
21280
  }
21237
21281
  visitForLoopBlock(block) {
21238
21282
  const blockIndex = this.allocateDataSlot();
21239
- const templateVariables = this.createForLoopVariables(block);
21240
- const primaryData = this.prepareEmbeddedTemplateFn(block.children, "_For", templateVariables);
21283
+ const primaryData = this.prepareEmbeddedTemplateFn(block.children, "_For", [
21284
+ new Variable(block.itemName, "$implicit", block.sourceSpan, block.sourceSpan),
21285
+ new Variable(getLoopLocalName(block, "$index"), "$index", block.sourceSpan, block.sourceSpan),
21286
+ new Variable(getLoopLocalName(block, "$count"), "$count", block.sourceSpan, block.sourceSpan)
21287
+ ]);
21241
21288
  const emptyData = block.empty === null ? null : this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty");
21242
- const trackByFn = this.createTrackByFunction(block);
21289
+ const { expression: trackByExpression, usesComponentInstance: trackByUsesComponentInstance } = this.createTrackByFunction(block);
21243
21290
  const value = block.expression.visit(this._valueConverter);
21244
21291
  this.allocateBindingSlots(value);
21292
+ this.registerComputedLoopVariables(block, primaryData.scope);
21245
21293
  this.creationInstruction(block.sourceSpan, Identifiers.repeaterCreate, () => {
21246
21294
  const params = [
21247
21295
  literal(blockIndex),
21248
21296
  variable(primaryData.name),
21249
21297
  literal(primaryData.getConstCount()),
21250
21298
  literal(primaryData.getVarCount()),
21251
- trackByFn
21299
+ trackByExpression
21252
21300
  ];
21253
21301
  if (emptyData !== null) {
21254
- params.push(variable(emptyData.name), literal(emptyData.getConstCount()), literal(emptyData.getVarCount()));
21302
+ params.push(literal(trackByUsesComponentInstance), variable(emptyData.name), literal(emptyData.getConstCount()), literal(emptyData.getVarCount()));
21303
+ } else if (trackByUsesComponentInstance) {
21304
+ params.push(literal(trackByUsesComponentInstance));
21255
21305
  }
21256
21306
  return params;
21257
21307
  });
21258
21308
  this.updateInstruction(block.sourceSpan, Identifiers.repeater, () => [literal(blockIndex), this.convertPropertyBinding(value)]);
21259
21309
  }
21260
- createForLoopVariables(block) {
21310
+ registerComputedLoopVariables(block, bindingScope) {
21261
21311
  const indexLocalName = getLoopLocalName(block, "$index");
21262
21312
  const countLocalName = getLoopLocalName(block, "$count");
21263
- this._bindingScope.set(this.level, getLoopLocalName(block, "$odd"), (scope) => scope.get(indexLocalName).modulo(literal(2)).notIdentical(literal(0)));
21264
- this._bindingScope.set(this.level, getLoopLocalName(block, "$even"), (scope) => scope.get(indexLocalName).modulo(literal(2)).identical(literal(0)));
21265
- this._bindingScope.set(this.level, getLoopLocalName(block, "$first"), (scope) => scope.get(indexLocalName).identical(literal(0)));
21266
- this._bindingScope.set(this.level, getLoopLocalName(block, "$last"), (scope) => scope.get(indexLocalName).identical(scope.get(countLocalName).minus(literal(1))));
21267
- return [
21268
- new Variable(block.itemName, "$implicit", block.sourceSpan, block.sourceSpan),
21269
- new Variable(indexLocalName, "$index", block.sourceSpan, block.sourceSpan),
21270
- new Variable(countLocalName, "$count", block.sourceSpan, block.sourceSpan)
21271
- ];
21313
+ const level = bindingScope.bindingLevel;
21314
+ bindingScope.set(level, getLoopLocalName(block, "$odd"), (scope) => scope.get(indexLocalName).modulo(literal(2)).notIdentical(literal(0)));
21315
+ bindingScope.set(level, getLoopLocalName(block, "$even"), (scope) => scope.get(indexLocalName).modulo(literal(2)).identical(literal(0)));
21316
+ bindingScope.set(level, getLoopLocalName(block, "$first"), (scope) => scope.get(indexLocalName).identical(literal(0)));
21317
+ bindingScope.set(level, getLoopLocalName(block, "$last"), (scope) => scope.get(indexLocalName).identical(scope.get(countLocalName).minus(literal(1))));
21272
21318
  }
21273
- createTrackByFunction(block) {
21319
+ optimizeTrackByFunction(block) {
21274
21320
  const ast = block.trackBy.ast;
21275
21321
  if (ast instanceof PropertyRead && ast.receiver instanceof ImplicitReceiver && ast.name === getLoopLocalName(block, "$index")) {
21276
- return importExpr(Identifiers.repeaterTrackByIndex);
21322
+ return { expression: importExpr(Identifiers.repeaterTrackByIndex), usesComponentInstance: false };
21277
21323
  }
21278
21324
  if (ast instanceof PropertyRead && ast.receiver instanceof ImplicitReceiver && ast.name === block.itemName) {
21279
- return importExpr(Identifiers.repeaterTrackByIdentity);
21325
+ return { expression: importExpr(Identifiers.repeaterTrackByIdentity), usesComponentInstance: false };
21280
21326
  }
21281
- if (ast instanceof PropertyRead && ast.receiver instanceof PropertyRead && ast.receiver.receiver instanceof ImplicitReceiver && ast.receiver.name === block.itemName) {
21282
- const params = [getLoopLocalName(block, "$index"), block.itemName];
21283
- const scope = this._bindingScope.nestedScope(this.level + 1, new Set(params));
21284
- const binding = convertPropertyBinding(scope, variable(CONTEXT_NAME), block.trackBy, "trackBy");
21285
- return arrowFn(params.map((param) => new FnParam(param)), binding.currValExpr);
21327
+ if (ast instanceof Call && ast.receiver instanceof PropertyRead && ast.receiver.receiver instanceof ImplicitReceiver && ast.args.length === 2) {
21328
+ const firstIsIndex = ast.args[0] instanceof PropertyRead && ast.args[0].receiver instanceof ImplicitReceiver && ast.args[0].name === getLoopLocalName(block, "$index");
21329
+ const secondIsItem = ast.args[1] instanceof PropertyRead && ast.args[1].receiver instanceof ImplicitReceiver && ast.args[1].name === block.itemName;
21330
+ if (firstIsIndex && secondIsItem) {
21331
+ const receiver = this.level === 0 ? variable(CONTEXT_NAME) : new ExternalExpr(Identifiers.componentInstance).callFn([]);
21332
+ return { expression: receiver.prop(ast.receiver.name), usesComponentInstance: false };
21333
+ }
21334
+ }
21335
+ return null;
21336
+ }
21337
+ createTrackByFunction(block) {
21338
+ const optimizedFn = this.optimizeTrackByFunction(block);
21339
+ if (optimizedFn !== null) {
21340
+ return optimizedFn;
21341
+ }
21342
+ const bannedGlobals = /* @__PURE__ */ new Set([
21343
+ getLoopLocalName(block, "$count"),
21344
+ getLoopLocalName(block, "$first"),
21345
+ getLoopLocalName(block, "$last"),
21346
+ getLoopLocalName(block, "$even"),
21347
+ getLoopLocalName(block, "$odd")
21348
+ ]);
21349
+ const scope = new TrackByBindingScope(this._bindingScope, {
21350
+ [getLoopLocalName(block, "$index")]: "$index",
21351
+ [block.itemName]: "$item"
21352
+ }, bannedGlobals);
21353
+ const params = [new FnParam("$index"), new FnParam("$item")];
21354
+ const stmts = convertPureComponentScopeFunction(block.trackBy.ast, scope, variable(CONTEXT_NAME), "track");
21355
+ const usesComponentInstance = scope.getComponentAccessCount() > 0;
21356
+ let fn2;
21357
+ if (!usesComponentInstance && stmts.length === 1 && stmts[0] instanceof ExpressionStatement) {
21358
+ fn2 = arrowFn(params, stmts[0].expr);
21359
+ } else {
21360
+ if (stmts.length > 0) {
21361
+ const lastStatement = stmts[stmts.length - 1];
21362
+ if (lastStatement instanceof ExpressionStatement) {
21363
+ stmts[stmts.length - 1] = new ReturnStatement(lastStatement.expr);
21364
+ }
21365
+ }
21366
+ fn2 = fn(params, stmts);
21286
21367
  }
21287
- throw new Error("Unsupported track expression");
21368
+ return {
21369
+ expression: this.constantPool.getSharedFunctionReference(fn2, "_forTrack"),
21370
+ usesComponentInstance
21371
+ };
21288
21372
  }
21289
21373
  getConstCount() {
21290
21374
  return this._dataIndex;
@@ -21645,6 +21729,9 @@ var BindingScope = class {
21645
21729
  }
21646
21730
  return this.bindingLevel === 0 ? null : this.getComponentProperty(name);
21647
21731
  }
21732
+ hasLocal(name) {
21733
+ return this.map.has(name);
21734
+ }
21648
21735
  set(retrievalLevel, name, lhs, priority = 0, declareLocalCallback, localRef) {
21649
21736
  if (this.map.has(name)) {
21650
21737
  if (localRef) {
@@ -21761,6 +21848,37 @@ var BindingScope = class {
21761
21848
  this.usesRestoredViewContext = true;
21762
21849
  }
21763
21850
  };
21851
+ var TrackByBindingScope = class extends BindingScope {
21852
+ constructor(parentScope, globalAliases, bannedGlobals) {
21853
+ super(parentScope.bindingLevel + 1, parentScope);
21854
+ this.globalAliases = globalAliases;
21855
+ this.bannedGlobals = bannedGlobals;
21856
+ this.componentAccessCount = 0;
21857
+ }
21858
+ get(name) {
21859
+ let current = this.parent;
21860
+ while (current) {
21861
+ if (current.hasLocal(name)) {
21862
+ this.forbiddenAccessError(name);
21863
+ }
21864
+ current = current.parent;
21865
+ }
21866
+ if (this.bannedGlobals.has(name)) {
21867
+ this.forbiddenAccessError(name);
21868
+ }
21869
+ if (this.globalAliases[name]) {
21870
+ return variable(this.globalAliases[name]);
21871
+ }
21872
+ this.componentAccessCount++;
21873
+ return variable("this").prop(name);
21874
+ }
21875
+ getComponentAccessCount() {
21876
+ return this.componentAccessCount;
21877
+ }
21878
+ forbiddenAccessError(propertyName) {
21879
+ throw new Error(`Accessing ${propertyName} inside of a track expression is not allowed. Tracking expressions can only access the item, $index and properties on the containing component.`);
21880
+ }
21881
+ };
21764
21882
  function createCssSelector(elementName, attributes) {
21765
21883
  const cssSelector = new CssSelector();
21766
21884
  const elementNameNoNs = splitNsName(elementName)[1];
@@ -23125,7 +23243,7 @@ function publishFacade(global) {
23125
23243
  }
23126
23244
 
23127
23245
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
23128
- var VERSION2 = new Version("17.0.0-next.2");
23246
+ var VERSION2 = new Version("17.0.0-next.3");
23129
23247
 
23130
23248
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
23131
23249
  var _I18N_ATTR = "i18n";
@@ -24662,7 +24780,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
24662
24780
  function compileDeclareClassMetadata(metadata) {
24663
24781
  const definitionMap = new DefinitionMap();
24664
24782
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
24665
- definitionMap.set("version", literal("17.0.0-next.2"));
24783
+ definitionMap.set("version", literal("17.0.0-next.3"));
24666
24784
  definitionMap.set("ngImport", importExpr(Identifiers.core));
24667
24785
  definitionMap.set("type", metadata.type);
24668
24786
  definitionMap.set("decorators", metadata.decorators);
@@ -24733,7 +24851,7 @@ function createDirectiveDefinitionMap(meta) {
24733
24851
  const hasTransformFunctions = Object.values(meta.inputs).some((input) => input.transformFunction !== null);
24734
24852
  const minVersion = hasTransformFunctions ? MINIMUM_PARTIAL_LINKER_VERSION2 : "14.0.0";
24735
24853
  definitionMap.set("minVersion", literal(minVersion));
24736
- definitionMap.set("version", literal("17.0.0-next.2"));
24854
+ definitionMap.set("version", literal("17.0.0-next.3"));
24737
24855
  definitionMap.set("type", meta.type.value);
24738
24856
  if (meta.isStandalone) {
24739
24857
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -24921,7 +25039,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION3 = "12.0.0";
24921
25039
  function compileDeclareFactoryFunction(meta) {
24922
25040
  const definitionMap = new DefinitionMap();
24923
25041
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
24924
- definitionMap.set("version", literal("17.0.0-next.2"));
25042
+ definitionMap.set("version", literal("17.0.0-next.3"));
24925
25043
  definitionMap.set("ngImport", importExpr(Identifiers.core));
24926
25044
  definitionMap.set("type", meta.type.value);
24927
25045
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -24944,7 +25062,7 @@ function compileDeclareInjectableFromMetadata(meta) {
24944
25062
  function createInjectableDefinitionMap(meta) {
24945
25063
  const definitionMap = new DefinitionMap();
24946
25064
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
24947
- definitionMap.set("version", literal("17.0.0-next.2"));
25065
+ definitionMap.set("version", literal("17.0.0-next.3"));
24948
25066
  definitionMap.set("ngImport", importExpr(Identifiers.core));
24949
25067
  definitionMap.set("type", meta.type.value);
24950
25068
  if (meta.providedIn !== void 0) {
@@ -24982,7 +25100,7 @@ function compileDeclareInjectorFromMetadata(meta) {
24982
25100
  function createInjectorDefinitionMap(meta) {
24983
25101
  const definitionMap = new DefinitionMap();
24984
25102
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
24985
- definitionMap.set("version", literal("17.0.0-next.2"));
25103
+ definitionMap.set("version", literal("17.0.0-next.3"));
24986
25104
  definitionMap.set("ngImport", importExpr(Identifiers.core));
24987
25105
  definitionMap.set("type", meta.type.value);
24988
25106
  definitionMap.set("providers", meta.providers);
@@ -25006,7 +25124,7 @@ function createNgModuleDefinitionMap(meta) {
25006
25124
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
25007
25125
  }
25008
25126
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
25009
- definitionMap.set("version", literal("17.0.0-next.2"));
25127
+ definitionMap.set("version", literal("17.0.0-next.3"));
25010
25128
  definitionMap.set("ngImport", importExpr(Identifiers.core));
25011
25129
  definitionMap.set("type", meta.type.value);
25012
25130
  if (meta.bootstrap.length > 0) {
@@ -25041,7 +25159,7 @@ function compileDeclarePipeFromMetadata(meta) {
25041
25159
  function createPipeDefinitionMap(meta) {
25042
25160
  const definitionMap = new DefinitionMap();
25043
25161
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION7));
25044
- definitionMap.set("version", literal("17.0.0-next.2"));
25162
+ definitionMap.set("version", literal("17.0.0-next.3"));
25045
25163
  definitionMap.set("ngImport", importExpr(Identifiers.core));
25046
25164
  definitionMap.set("type", meta.type.value);
25047
25165
  if (meta.isStandalone) {
@@ -25058,7 +25176,7 @@ function createPipeDefinitionMap(meta) {
25058
25176
  publishFacade(_global);
25059
25177
 
25060
25178
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version.mjs
25061
- var VERSION3 = new Version("17.0.0-next.2");
25179
+ var VERSION3 = new Version("17.0.0-next.3");
25062
25180
 
25063
25181
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
25064
25182
  var EmitFlags;
@@ -25235,7 +25353,6 @@ var ErrorCode;
25235
25353
  ErrorCode2[ErrorCode2["NGMODULE_DECLARATION_IS_STANDALONE"] = 6008] = "NGMODULE_DECLARATION_IS_STANDALONE";
25236
25354
  ErrorCode2[ErrorCode2["NGMODULE_BOOTSTRAP_IS_STANDALONE"] = 6009] = "NGMODULE_BOOTSTRAP_IS_STANDALONE";
25237
25355
  ErrorCode2[ErrorCode2["WARN_NGMODULE_ID_UNNECESSARY"] = 6100] = "WARN_NGMODULE_ID_UNNECESSARY";
25238
- ErrorCode2[ErrorCode2["NGMODULE_VE_DEPENDENCY_ON_IVY_LIB"] = 6999] = "NGMODULE_VE_DEPENDENCY_ON_IVY_LIB";
25239
25356
  ErrorCode2[ErrorCode2["SCHEMA_INVALID_ELEMENT"] = 8001] = "SCHEMA_INVALID_ELEMENT";
25240
25357
  ErrorCode2[ErrorCode2["SCHEMA_INVALID_ATTRIBUTE"] = 8002] = "SCHEMA_INVALID_ATTRIBUTE";
25241
25358
  ErrorCode2[ErrorCode2["MISSING_REFERENCE_TARGET"] = 8003] = "MISSING_REFERENCE_TARGET";
@@ -33452,7 +33569,8 @@ function parseExtractedTemplate(template2, sourceStr, sourceParseRange, escapedS
33452
33569
  enableI18nLegacyMessageIdFormat: options.enableI18nLegacyMessageIdFormat,
33453
33570
  i18nNormalizeLineEndingsInICUs,
33454
33571
  leadingTriviaChars: [],
33455
- alwaysAttemptHtmlToR3AstConversion: options.usePoisonedData
33572
+ alwaysAttemptHtmlToR3AstConversion: options.usePoisonedData,
33573
+ enabledBlockTypes: options.enabledBlockTypes
33456
33574
  });
33457
33575
  return __spreadProps(__spreadValues({}, parsedTemplate), {
33458
33576
  diagNodes,
@@ -38324,18 +38442,18 @@ var TcbTemplateBodyOp = class extends TcbOp {
38324
38442
  return null;
38325
38443
  }
38326
38444
  };
38327
- var TcbTextInterpolationOp = class extends TcbOp {
38328
- constructor(tcb, scope, binding) {
38445
+ var TcbExpressionOp = class extends TcbOp {
38446
+ constructor(tcb, scope, expression) {
38329
38447
  super();
38330
38448
  this.tcb = tcb;
38331
38449
  this.scope = scope;
38332
- this.binding = binding;
38450
+ this.expression = expression;
38333
38451
  }
38334
38452
  get optional() {
38335
38453
  return false;
38336
38454
  }
38337
38455
  execute() {
38338
- const expr = tcbExpression(this.binding.value, this.tcb, this.scope);
38456
+ const expr = tcbExpression(this.expression, this.tcb, this.scope);
38339
38457
  this.scope.addStatement(import_typescript83.default.factory.createExpressionStatement(expr));
38340
38458
  return null;
38341
38459
  }
@@ -38912,9 +39030,7 @@ var Scope2 = class {
38912
39030
  this.elementOpMap.set(node, opIndex);
38913
39031
  this.appendDirectivesAndInputsOfNode(node);
38914
39032
  this.appendOutputsOfNode(node);
38915
- for (const child of node.children) {
38916
- this.appendNode(child);
38917
- }
39033
+ this.appendChildren(node);
38918
39034
  this.checkAndAppendReferencesOfNode(node);
38919
39035
  } else if (node instanceof Template) {
38920
39036
  this.appendDirectivesAndInputsOfNode(node);
@@ -38927,12 +39043,35 @@ var Scope2 = class {
38927
39043
  this.appendDeepSchemaChecks(node.children);
38928
39044
  }
38929
39045
  this.checkAndAppendReferencesOfNode(node);
39046
+ } else if (node instanceof DeferredBlock) {
39047
+ node.triggers.when !== void 0 && this.opQueue.push(new TcbExpressionOp(this.tcb, this, node.triggers.when.value));
39048
+ node.prefetchTriggers.when !== void 0 && this.opQueue.push(new TcbExpressionOp(this.tcb, this, node.prefetchTriggers.when.value));
39049
+ this.appendChildren(node);
39050
+ node.placeholder !== null && this.appendChildren(node.placeholder);
39051
+ node.loading !== null && this.appendChildren(node.loading);
39052
+ node.error !== null && this.appendChildren(node.error);
39053
+ } else if (node instanceof IfBlock) {
39054
+ for (const branch of node.branches) {
39055
+ this.appendChildren(branch);
39056
+ }
39057
+ } else if (node instanceof SwitchBlock) {
39058
+ for (const currentCase of node.cases) {
39059
+ this.appendChildren(currentCase);
39060
+ }
39061
+ } else if (node instanceof ForLoopBlock) {
39062
+ this.appendChildren(node);
39063
+ node.empty && this.appendChildren(node.empty);
38930
39064
  } else if (node instanceof BoundText) {
38931
- this.opQueue.push(new TcbTextInterpolationOp(this.tcb, this, node));
39065
+ this.opQueue.push(new TcbExpressionOp(this.tcb, this, node.value));
38932
39066
  } else if (node instanceof Icu) {
38933
39067
  this.appendIcuExpressions(node);
38934
39068
  }
38935
39069
  }
39070
+ appendChildren(node) {
39071
+ for (const child of node.children) {
39072
+ this.appendNode(child);
39073
+ }
39074
+ }
38936
39075
  checkAndAppendReferencesOfNode(node) {
38937
39076
  for (const ref of node.references) {
38938
39077
  const target = this.tcb.boundTarget.getReferenceTarget(ref);
@@ -39033,11 +39172,11 @@ var Scope2 = class {
39033
39172
  }
39034
39173
  appendIcuExpressions(node) {
39035
39174
  for (const variable2 of Object.values(node.vars)) {
39036
- this.opQueue.push(new TcbTextInterpolationOp(this.tcb, this, variable2));
39175
+ this.opQueue.push(new TcbExpressionOp(this.tcb, this, variable2.value));
39037
39176
  }
39038
39177
  for (const placeholder of Object.values(node.placeholders)) {
39039
39178
  if (placeholder instanceof BoundText) {
39040
- this.opQueue.push(new TcbTextInterpolationOp(this.tcb, this, placeholder));
39179
+ this.opQueue.push(new TcbExpressionOp(this.tcb, this, placeholder.value));
39041
39180
  }
39042
39181
  }
39043
39182
  }