@angular/compiler 21.2.0-next.1 → 21.2.0-next.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-next.1
2
+ * @license Angular v21.2.0-next.2
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -330,6 +330,7 @@ var ChangeDetectionStrategy;
330
330
  (function (ChangeDetectionStrategy) {
331
331
  ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
332
332
  ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
333
+ ChangeDetectionStrategy[ChangeDetectionStrategy["Eager"] = 1] = "Eager";
333
334
  })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
334
335
  var InputFlags;
335
336
  (function (InputFlags) {
@@ -3005,6 +3006,10 @@ class Identifiers {
3005
3006
  name: 'ɵɵNgOnChangesFeature',
3006
3007
  moduleName: CORE
3007
3008
  };
3009
+ static ControlFeature = {
3010
+ name: 'ɵɵControlFeature',
3011
+ moduleName: CORE
3012
+ };
3008
3013
  static InheritDefinitionFeature = {
3009
3014
  name: 'ɵɵInheritDefinitionFeature',
3010
3015
  moduleName: CORE
@@ -8059,22 +8064,12 @@ function createStoreLetOp(target, declaredName, value, sourceSpan) {
8059
8064
  ...NEW_OP
8060
8065
  };
8061
8066
  }
8062
- function createControlOp(op) {
8067
+ function createControlOp(target, sourceSpan) {
8063
8068
  return {
8064
8069
  kind: OpKind.Control,
8065
- target: op.target,
8066
- name: op.name,
8067
- expression: op.expression,
8068
- bindingKind: op.bindingKind,
8069
- securityContext: op.securityContext,
8070
- sanitizer: null,
8071
- isStructuralTemplateAttribute: op.isStructuralTemplateAttribute,
8072
- templateKind: op.templateKind,
8073
- i18nContext: op.i18nContext,
8074
- i18nMessage: op.i18nMessage,
8075
- sourceSpan: op.sourceSpan,
8070
+ sourceSpan,
8071
+ target,
8076
8072
  ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,
8077
- ...TRAIT_CONSUMES_VARS,
8078
8073
  ...NEW_OP
8079
8074
  };
8080
8075
  }
@@ -8825,7 +8820,6 @@ function transformExpressionsInOp(op, transform, flags) {
8825
8820
  case OpKind.Property:
8826
8821
  case OpKind.DomProperty:
8827
8822
  case OpKind.Attribute:
8828
- case OpKind.Control:
8829
8823
  if (op.expression instanceof Interpolation) {
8830
8824
  transformExpressionsInInterpolation(op.expression, transform, flags);
8831
8825
  } else {
@@ -8944,6 +8938,7 @@ function transformExpressionsInOp(op, transform, flags) {
8944
8938
  case OpKind.SourceLocation:
8945
8939
  case OpKind.ConditionalCreate:
8946
8940
  case OpKind.ConditionalBranchCreate:
8941
+ case OpKind.Control:
8947
8942
  case OpKind.ControlCreate:
8948
8943
  break;
8949
8944
  default:
@@ -9824,9 +9819,6 @@ function extractAttributes(job) {
9824
9819
  OpList.insertBefore(createExtractedAttributeOp(op.target, bindingKind, null, op.name, null, null, null, op.securityContext), lookupElement$3(elements, op.target));
9825
9820
  }
9826
9821
  break;
9827
- case OpKind.Control:
9828
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, null, null, null, op.securityContext), lookupElement$3(elements, op.target));
9829
- break;
9830
9822
  case OpKind.TwoWayProperty:
9831
9823
  OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.TwoWayProperty, null, op.name, null, null, null, op.securityContext), lookupElement$3(elements, op.target));
9832
9824
  break;
@@ -9935,8 +9927,6 @@ function specializeBindings(job) {
9935
9927
  OpList.replace(op, createAttributeOp(op.target, null, op.name, op.expression, op.securityContext, false, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));
9936
9928
  } else if (job.kind === CompilationJobKind.Host) {
9937
9929
  OpList.replace(op, createDomPropertyOp(op.name, op.expression, op.bindingKind, op.i18nContext, op.securityContext, op.sourceSpan));
9938
- } else if (op.name === 'formField') {
9939
- OpList.replace(op, createControlOp(op));
9940
9930
  } else {
9941
9931
  OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
9942
9932
  }
@@ -19763,18 +19753,8 @@ function ariaProperty(name, expression, sourceSpan) {
19763
19753
  function property(name, expression, sanitizer, sourceSpan) {
19764
19754
  return propertyBase(Identifiers.property, name, expression, sanitizer, sourceSpan);
19765
19755
  }
19766
- function control(name, expression, sanitizer, sourceSpan) {
19767
- const args = [];
19768
- if (expression instanceof Interpolation) {
19769
- args.push(interpolationToExpression(expression, sourceSpan));
19770
- } else {
19771
- args.push(expression);
19772
- }
19773
- args.push(literal(name));
19774
- if (sanitizer !== null) {
19775
- args.push(sanitizer);
19776
- }
19777
- return call(Identifiers.control, args, sourceSpan);
19756
+ function control(sourceSpan) {
19757
+ return call(Identifiers.control, [], sourceSpan);
19778
19758
  }
19779
19759
  function controlCreate(sourceSpan) {
19780
19760
  return call(Identifiers.controlCreate, [], sourceSpan);
@@ -20324,7 +20304,7 @@ function reifyProperty(op) {
20324
20304
  return isAriaAttribute(op.name) ? ariaProperty(op.name, op.expression, op.sourceSpan) : property(op.name, op.expression, op.sanitizer, op.sourceSpan);
20325
20305
  }
20326
20306
  function reifyControl(op) {
20327
- return control(op.name, op.expression, op.sanitizer, op.sourceSpan);
20307
+ return control(op.sourceSpan);
20328
20308
  }
20329
20309
  function reifyIrExpression(unit, expr) {
20330
20310
  if (!isIrExpression(expr)) {
@@ -21811,6 +21791,46 @@ function addArrowFunctions(unit, op) {
21811
21791
  }, VisitorContextFlag.None);
21812
21792
  }
21813
21793
 
21794
+ const ELIGIBLE_CONTROL_PROPERTIES = new Set(['formField']);
21795
+ function specializeControlProperties(job) {
21796
+ for (const unit of job.units) {
21797
+ processView(unit);
21798
+ }
21799
+ }
21800
+ function processView(view) {
21801
+ for (const op of view.update) {
21802
+ if (op.kind !== OpKind.Property) {
21803
+ continue;
21804
+ }
21805
+ if (ELIGIBLE_CONTROL_PROPERTIES.has(op.name)) {
21806
+ addControlInstruction(view, op);
21807
+ }
21808
+ }
21809
+ }
21810
+ const CONTROL_OP_CREATE_KINDS = new Set([OpKind.Container, OpKind.ContainerStart, OpKind.ContainerEnd, OpKind.Element, OpKind.ElementStart, OpKind.ElementEnd, OpKind.Template]);
21811
+ function isRelevantCreateOp(createOp) {
21812
+ return CONTROL_OP_CREATE_KINDS.has(createOp.kind);
21813
+ }
21814
+ function findCreateInstruction(view, target) {
21815
+ let lastFoundOp = null;
21816
+ for (const createOp of view.create) {
21817
+ if (!isRelevantCreateOp(createOp) || createOp.xref !== target) {
21818
+ continue;
21819
+ }
21820
+ lastFoundOp = createOp;
21821
+ }
21822
+ return lastFoundOp;
21823
+ }
21824
+ function addControlInstruction(view, propertyOp) {
21825
+ const targetCreateOp = findCreateInstruction(view, propertyOp.target);
21826
+ if (targetCreateOp === null) {
21827
+ throw new Error(`No create instruction found for control target ${propertyOp.target}`);
21828
+ }
21829
+ const controlCreateOp = createControlCreateOp(propertyOp.sourceSpan);
21830
+ OpList.insertAfter(controlCreateOp, targetCreateOp);
21831
+ OpList.insertAfter(createControlOp(propertyOp.target, propertyOp.sourceSpan), propertyOp);
21832
+ }
21833
+
21814
21834
  /**
21815
21835
  *
21816
21836
  * @license
@@ -21846,6 +21866,9 @@ const phases = [{
21846
21866
  }, {
21847
21867
  kind: CompilationJobKind.Both,
21848
21868
  fn: specializeBindings
21869
+ }, {
21870
+ kind: CompilationJobKind.Tmpl,
21871
+ fn: specializeControlProperties
21849
21872
  }, {
21850
21873
  kind: CompilationJobKind.Both,
21851
21874
  fn: convertAnimations
@@ -22209,10 +22232,6 @@ function ingestElement(unit, element) {
22209
22232
  ingestNodes(unit, element.children);
22210
22233
  const endOp = createElementEndOp(id, element.endSourceSpan ?? element.startSourceSpan);
22211
22234
  unit.create.push(endOp);
22212
- const fieldInput = element.inputs.find(input => input.name === 'formField' && input.type === BindingType.Property);
22213
- if (fieldInput) {
22214
- unit.create.push(createControlCreateOp(fieldInput.sourceSpan));
22215
- }
22216
22235
  if (i18nBlockId !== null) {
22217
22236
  OpList.insertBefore(createI18nEndOp(i18nBlockId, element.endSourceSpan ?? element.startSourceSpan), endOp);
22218
22237
  }
@@ -25109,6 +25128,9 @@ function addFeatures(definitionMap, meta) {
25109
25128
  if (meta.lifecycle.usesOnChanges) {
25110
25129
  features.push(importExpr(Identifiers.NgOnChangesFeature));
25111
25130
  }
25131
+ if (meta.controlCreate !== null) {
25132
+ features.push(importExpr(Identifiers.ControlFeature).callFn([literal(meta.controlCreate.passThroughInput)]));
25133
+ }
25112
25134
  if ('externalStyles' in meta && meta.externalStyles?.length) {
25113
25135
  const externalStyleNodes = meta.externalStyles.map(externalStyle => literal(externalStyle));
25114
25136
  features.push(importExpr(Identifiers.ExternalStylesFeature).callFn([literalArr(externalStyleNodes)]));
@@ -26616,6 +26638,7 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
26616
26638
  providers: declaration.providers !== undefined ? new WrappedNodeExpr(declaration.providers) : null,
26617
26639
  exportAs: declaration.exportAs ?? null,
26618
26640
  usesInheritance: declaration.usesInheritance ?? false,
26641
+ controlCreate: declaration.controlCreate ?? null,
26619
26642
  lifecycle: {
26620
26643
  usesOnChanges: declaration.usesOnChanges ?? false
26621
26644
  },
@@ -28499,7 +28522,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
28499
28522
  function compileDeclareClassMetadata(metadata) {
28500
28523
  const definitionMap = new DefinitionMap();
28501
28524
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
28502
- definitionMap.set('version', literal('21.2.0-next.1'));
28525
+ definitionMap.set('version', literal('21.2.0-next.2'));
28503
28526
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28504
28527
  definitionMap.set('type', metadata.type);
28505
28528
  definitionMap.set('decorators', metadata.decorators);
@@ -28517,7 +28540,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
28517
28540
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
28518
28541
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
28519
28542
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
28520
- definitionMap.set('version', literal('21.2.0-next.1'));
28543
+ definitionMap.set('version', literal('21.2.0-next.2'));
28521
28544
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28522
28545
  definitionMap.set('type', metadata.type);
28523
28546
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -28590,7 +28613,7 @@ function createDirectiveDefinitionMap(meta) {
28590
28613
  const definitionMap = new DefinitionMap();
28591
28614
  const minVersion = getMinimumVersionForPartialOutput(meta);
28592
28615
  definitionMap.set('minVersion', literal(minVersion));
28593
- definitionMap.set('version', literal('21.2.0-next.1'));
28616
+ definitionMap.set('version', literal('21.2.0-next.2'));
28594
28617
  definitionMap.set('type', meta.type.value);
28595
28618
  if (meta.isStandalone !== undefined) {
28596
28619
  definitionMap.set('isStandalone', literal(meta.isStandalone));
@@ -28620,6 +28643,13 @@ function createDirectiveDefinitionMap(meta) {
28620
28643
  if (meta.lifecycle.usesOnChanges) {
28621
28644
  definitionMap.set('usesOnChanges', literal(true));
28622
28645
  }
28646
+ if (meta.controlCreate) {
28647
+ definitionMap.set('controlCreate', literalMap([{
28648
+ key: 'passThroughInput',
28649
+ value: literal(meta.controlCreate.passThroughInput),
28650
+ quoted: false
28651
+ }]));
28652
+ }
28623
28653
  if (meta.hostDirectives?.length) {
28624
28654
  definitionMap.set('hostDirectives', createHostDirectives(meta.hostDirectives));
28625
28655
  }
@@ -28925,7 +28955,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
28925
28955
  function compileDeclareFactoryFunction(meta) {
28926
28956
  const definitionMap = new DefinitionMap();
28927
28957
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
28928
- definitionMap.set('version', literal('21.2.0-next.1'));
28958
+ definitionMap.set('version', literal('21.2.0-next.2'));
28929
28959
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28930
28960
  definitionMap.set('type', meta.type.value);
28931
28961
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -28951,7 +28981,7 @@ function compileDeclareInjectableFromMetadata(meta) {
28951
28981
  function createInjectableDefinitionMap(meta) {
28952
28982
  const definitionMap = new DefinitionMap();
28953
28983
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
28954
- definitionMap.set('version', literal('21.2.0-next.1'));
28984
+ definitionMap.set('version', literal('21.2.0-next.2'));
28955
28985
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28956
28986
  definitionMap.set('type', meta.type.value);
28957
28987
  if (meta.providedIn !== undefined) {
@@ -28992,7 +29022,7 @@ function compileDeclareInjectorFromMetadata(meta) {
28992
29022
  function createInjectorDefinitionMap(meta) {
28993
29023
  const definitionMap = new DefinitionMap();
28994
29024
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
28995
- definitionMap.set('version', literal('21.2.0-next.1'));
29025
+ definitionMap.set('version', literal('21.2.0-next.2'));
28996
29026
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28997
29027
  definitionMap.set('type', meta.type.value);
28998
29028
  definitionMap.set('providers', meta.providers);
@@ -29019,7 +29049,7 @@ function createNgModuleDefinitionMap(meta) {
29019
29049
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
29020
29050
  }
29021
29051
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
29022
- definitionMap.set('version', literal('21.2.0-next.1'));
29052
+ definitionMap.set('version', literal('21.2.0-next.2'));
29023
29053
  definitionMap.set('ngImport', importExpr(Identifiers.core));
29024
29054
  definitionMap.set('type', meta.type.value);
29025
29055
  if (meta.bootstrap.length > 0) {
@@ -29057,7 +29087,7 @@ function compileDeclarePipeFromMetadata(meta) {
29057
29087
  function createPipeDefinitionMap(meta) {
29058
29088
  const definitionMap = new DefinitionMap();
29059
29089
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
29060
- definitionMap.set('version', literal('21.2.0-next.1'));
29090
+ definitionMap.set('version', literal('21.2.0-next.2'));
29061
29091
  definitionMap.set('ngImport', importExpr(Identifiers.core));
29062
29092
  definitionMap.set('type', meta.type.value);
29063
29093
  if (meta.isStandalone !== undefined) {
@@ -29131,7 +29161,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
29131
29161
  return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
29132
29162
  }
29133
29163
 
29134
- const VERSION = new Version('21.2.0-next.1');
29164
+ const VERSION = new Version('21.2.0-next.2');
29135
29165
 
29136
29166
  publishFacade(_global);
29137
29167