@angular/compiler 21.0.2 → 21.0.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.2
2
+ * @license Angular v21.0.4
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -21800,6 +21800,10 @@ function ingestElement(unit, element) {
21800
21800
  ingestNodes(unit, element.children);
21801
21801
  const endOp = createElementEndOp(id, element.endSourceSpan ?? element.startSourceSpan);
21802
21802
  unit.create.push(endOp);
21803
+ const fieldInput = element.inputs.find(input => input.name === 'field' && input.type === BindingType.Property);
21804
+ if (fieldInput) {
21805
+ unit.create.push(createControlCreateOp(fieldInput.sourceSpan));
21806
+ }
21803
21807
  if (i18nBlockId !== null) {
21804
21808
  OpList.insertBefore(createI18nEndOp(i18nBlockId, element.endSourceSpan ?? element.startSourceSpan), endOp);
21805
21809
  }
@@ -22276,9 +22280,6 @@ function ingestElementBindings(unit, op, element) {
22276
22280
  console.error(`On component ${unit.job.componentName}, the binding ${input.name} is both an i18n attribute and a property. You may want to remove the property binding. This will become a compilation error in future versions of Angular.`);
22277
22281
  }
22278
22282
  bindings.push(createBindingOp(op.xref, BINDING_KINDS.get(input.type), input.name, convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n), input.unit, input.securityContext, false, false, null, asMessage(input.i18n) ?? null, input.sourceSpan));
22279
- if (input.type === BindingType.Property && input.name === 'field') {
22280
- unit.create.push(createControlCreateOp(input.sourceSpan));
22281
- }
22282
22283
  }
22283
22284
  unit.create.push(bindings.filter(b => b?.kind === OpKind.ExtractedAttribute));
22284
22285
  unit.update.push(bindings.filter(b => b?.kind === OpKind.Binding));
@@ -22487,7 +22488,7 @@ function getQueryPredicate(query, constantPool) {
22487
22488
  }
22488
22489
  }
22489
22490
  }
22490
- function createQueryCreateCall(query, constantPool, queryTypeFns, prependParams) {
22491
+ function getQueryCreateParameters(query, constantPool, prependParams) {
22491
22492
  const parameters = [];
22492
22493
  if (prependParams !== undefined) {
22493
22494
  parameters.push(...prependParams);
@@ -22499,8 +22500,7 @@ function createQueryCreateCall(query, constantPool, queryTypeFns, prependParams)
22499
22500
  if (query.read) {
22500
22501
  parameters.push(query.read);
22501
22502
  }
22502
- const queryCreateFn = query.isSignal ? queryTypeFns.signalBased : queryTypeFns.nonSignal;
22503
- return importExpr(queryCreateFn).callFn(parameters);
22503
+ return parameters;
22504
22504
  }
22505
22505
  const queryAdvancePlaceholder = Symbol('queryAdvancePlaceholder');
22506
22506
  function collapseAdvanceStatements(statements) {
@@ -22528,12 +22528,17 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
22528
22528
  const createStatements = [];
22529
22529
  const updateStatements = [];
22530
22530
  const tempAllocator = temporaryAllocator(st => updateStatements.push(st), TEMPORARY_NAME);
22531
+ let viewQuerySignalCall = null;
22532
+ let viewQueryCall = null;
22531
22533
  viewQueries.forEach(query => {
22532
- const queryDefinitionCall = createQueryCreateCall(query, constantPool, {
22533
- signalBased: Identifiers.viewQuerySignal,
22534
- nonSignal: Identifiers.viewQuery
22535
- });
22536
- createStatements.push(queryDefinitionCall.toStmt());
22534
+ const params = getQueryCreateParameters(query, constantPool);
22535
+ if (query.isSignal) {
22536
+ viewQuerySignalCall ??= importExpr(Identifiers.viewQuerySignal);
22537
+ viewQuerySignalCall = viewQuerySignalCall.callFn(params);
22538
+ } else {
22539
+ viewQueryCall ??= importExpr(Identifiers.viewQuery);
22540
+ viewQueryCall = viewQueryCall.callFn(params);
22541
+ }
22537
22542
  if (query.isSignal) {
22538
22543
  updateStatements.push(queryAdvancePlaceholder);
22539
22544
  return;
@@ -22544,6 +22549,12 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
22544
22549
  const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop('first') : temporary);
22545
22550
  updateStatements.push(refresh.and(updateDirective).toStmt());
22546
22551
  });
22552
+ if (viewQuerySignalCall !== null) {
22553
+ createStatements.push(new ExpressionStatement(viewQuerySignalCall));
22554
+ }
22555
+ if (viewQueryCall !== null) {
22556
+ createStatements.push(new ExpressionStatement(viewQueryCall));
22557
+ }
22547
22558
  const viewQueryFnName = name ? `${name}_Query` : null;
22548
22559
  return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [renderFlagCheckIfStmt(1, createStatements), renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, viewQueryFnName);
22549
22560
  }
@@ -22551,11 +22562,17 @@ function createContentQueriesFunction(queries, constantPool, name) {
22551
22562
  const createStatements = [];
22552
22563
  const updateStatements = [];
22553
22564
  const tempAllocator = temporaryAllocator(st => updateStatements.push(st), TEMPORARY_NAME);
22565
+ let contentQuerySignalCall = null;
22566
+ let contentQueryCall = null;
22554
22567
  for (const query of queries) {
22555
- createStatements.push(createQueryCreateCall(query, constantPool, {
22556
- nonSignal: Identifiers.contentQuery,
22557
- signalBased: Identifiers.contentQuerySignal
22558
- }, [variable('dirIndex')]).toStmt());
22568
+ const params = getQueryCreateParameters(query, constantPool, [variable('dirIndex')]);
22569
+ if (query.isSignal) {
22570
+ contentQuerySignalCall ??= importExpr(Identifiers.contentQuerySignal);
22571
+ contentQuerySignalCall = contentQuerySignalCall.callFn(params);
22572
+ } else {
22573
+ contentQueryCall ??= importExpr(Identifiers.contentQuery);
22574
+ contentQueryCall = contentQueryCall.callFn(params);
22575
+ }
22559
22576
  if (query.isSignal) {
22560
22577
  updateStatements.push(queryAdvancePlaceholder);
22561
22578
  continue;
@@ -22566,6 +22583,12 @@ function createContentQueriesFunction(queries, constantPool, name) {
22566
22583
  const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop('first') : temporary);
22567
22584
  updateStatements.push(refresh.and(updateDirective).toStmt());
22568
22585
  }
22586
+ if (contentQuerySignalCall !== null) {
22587
+ createStatements.push(new ExpressionStatement(contentQuerySignalCall));
22588
+ }
22589
+ if (contentQueryCall !== null) {
22590
+ createStatements.push(new ExpressionStatement(contentQueryCall));
22591
+ }
22569
22592
  const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
22570
22593
  return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null), new FnParam('dirIndex', null)], [renderFlagCheckIfStmt(1, createStatements), renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, contentQueriesFnName);
22571
22594
  }
@@ -28023,7 +28046,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
28023
28046
  function compileDeclareClassMetadata(metadata) {
28024
28047
  const definitionMap = new DefinitionMap();
28025
28048
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
28026
- definitionMap.set('version', literal('21.0.2'));
28049
+ definitionMap.set('version', literal('21.0.4'));
28027
28050
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28028
28051
  definitionMap.set('type', metadata.type);
28029
28052
  definitionMap.set('decorators', metadata.decorators);
@@ -28041,7 +28064,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
28041
28064
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
28042
28065
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
28043
28066
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
28044
- definitionMap.set('version', literal('21.0.2'));
28067
+ definitionMap.set('version', literal('21.0.4'));
28045
28068
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28046
28069
  definitionMap.set('type', metadata.type);
28047
28070
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -28114,7 +28137,7 @@ function createDirectiveDefinitionMap(meta) {
28114
28137
  const definitionMap = new DefinitionMap();
28115
28138
  const minVersion = getMinimumVersionForPartialOutput(meta);
28116
28139
  definitionMap.set('minVersion', literal(minVersion));
28117
- definitionMap.set('version', literal('21.0.2'));
28140
+ definitionMap.set('version', literal('21.0.4'));
28118
28141
  definitionMap.set('type', meta.type.value);
28119
28142
  if (meta.isStandalone !== undefined) {
28120
28143
  definitionMap.set('isStandalone', literal(meta.isStandalone));
@@ -28446,7 +28469,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
28446
28469
  function compileDeclareFactoryFunction(meta) {
28447
28470
  const definitionMap = new DefinitionMap();
28448
28471
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
28449
- definitionMap.set('version', literal('21.0.2'));
28472
+ definitionMap.set('version', literal('21.0.4'));
28450
28473
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28451
28474
  definitionMap.set('type', meta.type.value);
28452
28475
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -28472,7 +28495,7 @@ function compileDeclareInjectableFromMetadata(meta) {
28472
28495
  function createInjectableDefinitionMap(meta) {
28473
28496
  const definitionMap = new DefinitionMap();
28474
28497
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
28475
- definitionMap.set('version', literal('21.0.2'));
28498
+ definitionMap.set('version', literal('21.0.4'));
28476
28499
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28477
28500
  definitionMap.set('type', meta.type.value);
28478
28501
  if (meta.providedIn !== undefined) {
@@ -28513,7 +28536,7 @@ function compileDeclareInjectorFromMetadata(meta) {
28513
28536
  function createInjectorDefinitionMap(meta) {
28514
28537
  const definitionMap = new DefinitionMap();
28515
28538
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
28516
- definitionMap.set('version', literal('21.0.2'));
28539
+ definitionMap.set('version', literal('21.0.4'));
28517
28540
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28518
28541
  definitionMap.set('type', meta.type.value);
28519
28542
  definitionMap.set('providers', meta.providers);
@@ -28540,7 +28563,7 @@ function createNgModuleDefinitionMap(meta) {
28540
28563
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
28541
28564
  }
28542
28565
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
28543
- definitionMap.set('version', literal('21.0.2'));
28566
+ definitionMap.set('version', literal('21.0.4'));
28544
28567
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28545
28568
  definitionMap.set('type', meta.type.value);
28546
28569
  if (meta.bootstrap.length > 0) {
@@ -28578,7 +28601,7 @@ function compileDeclarePipeFromMetadata(meta) {
28578
28601
  function createPipeDefinitionMap(meta) {
28579
28602
  const definitionMap = new DefinitionMap();
28580
28603
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
28581
- definitionMap.set('version', literal('21.0.2'));
28604
+ definitionMap.set('version', literal('21.0.4'));
28582
28605
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28583
28606
  definitionMap.set('type', meta.type.value);
28584
28607
  if (meta.isStandalone !== undefined) {
@@ -28652,7 +28675,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
28652
28675
  return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
28653
28676
  }
28654
28677
 
28655
- const VERSION = new Version('21.0.2');
28678
+ const VERSION = new Version('21.0.4');
28656
28679
 
28657
28680
  publishFacade(_global);
28658
28681