@angular/compiler-cli 20.3.4 → 20.3.5

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.
@@ -16,7 +16,7 @@ import {
16
16
  tryParseSignalInputMapping,
17
17
  tryParseSignalModelMapping,
18
18
  tryParseSignalQueryFromInitializer
19
- } from "./chunk-SZUJOV4Y.js";
19
+ } from "./chunk-NR7S7ISS.js";
20
20
 
21
21
  // packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.js
22
22
  import ts from "typescript";
@@ -455,7 +455,7 @@ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSo
455
455
  // packages/compiler-cli/linker/src/file_linker/partial_linkers/util.js
456
456
  import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
457
457
  import semver from "semver";
458
- var PLACEHOLDER_VERSION = "20.3.4";
458
+ var PLACEHOLDER_VERSION = "20.3.5";
459
459
  function wrapReference(wrapped) {
460
460
  return { value: wrapped, type: wrapped };
461
461
  }
@@ -3144,8 +3144,8 @@ var StaticInterpreter = class {
3144
3144
  if (ts13.isIdentifier(node) || ts13.isStringLiteral(node) || ts13.isNumericLiteral(node)) {
3145
3145
  return node.text;
3146
3146
  } else if (ts13.isComputedPropertyName(node)) {
3147
- const literal3 = this.visitExpression(node.expression, context);
3148
- return typeof literal3 === "string" ? literal3 : void 0;
3147
+ const literal4 = this.visitExpression(node.expression, context);
3148
+ return typeof literal4 === "string" ? literal4 : void 0;
3149
3149
  } else {
3150
3150
  return void 0;
3151
3151
  }
@@ -7358,7 +7358,7 @@ var InjectableClassRegistry = class {
7358
7358
  // packages/compiler-cli/src/ngtsc/annotations/common/src/metadata.js
7359
7359
  import { ArrowFunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
7360
7360
  import ts35 from "typescript";
7361
- function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
7361
+ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec, undecoratedMetadataExtractor = () => null) {
7362
7362
  if (!reflection.isClass(clazz)) {
7363
7363
  return null;
7364
7364
  }
@@ -7379,15 +7379,41 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
7379
7379
  metaCtorParameters = new ArrowFunctionExpr([], new LiteralArrayExpr(ctorParameters));
7380
7380
  }
7381
7381
  let metaPropDecorators = null;
7382
- const classMembers = reflection.getMembersOfClass(clazz).filter((member) => !member.isStatic && member.decorators !== null && member.decorators.length > 0 && // Private fields are not supported in the metadata emit
7382
+ const classMembers = reflection.getMembersOfClass(clazz).filter((member) => !member.isStatic && // Private fields are not supported in the metadata emit
7383
7383
  member.accessLevel !== ClassMemberAccessLevel.EcmaScriptPrivate);
7384
- const duplicateDecoratedMembers = classMembers.filter((member, i, arr) => arr.findIndex((arrayMember) => arrayMember.name === member.name) < i);
7385
- if (duplicateDecoratedMembers.length > 0) {
7384
+ const decoratedMembers = [];
7385
+ const seenMemberNames = /* @__PURE__ */ new Set();
7386
+ let duplicateDecoratedMembers = null;
7387
+ for (const member of classMembers) {
7388
+ const shouldQuoteName = member.nameNode !== null && ts35.isStringLiteralLike(member.nameNode);
7389
+ if (member.decorators !== null && member.decorators.length > 0) {
7390
+ decoratedMembers.push({
7391
+ key: member.name,
7392
+ quoted: shouldQuoteName,
7393
+ value: decoratedClassMemberToMetadata(member.decorators, isCore)
7394
+ });
7395
+ if (seenMemberNames.has(member.name)) {
7396
+ duplicateDecoratedMembers ??= [];
7397
+ duplicateDecoratedMembers.push(member);
7398
+ } else {
7399
+ seenMemberNames.add(member.name);
7400
+ }
7401
+ } else {
7402
+ const undecoratedMetadata = undecoratedMetadataExtractor(member);
7403
+ if (undecoratedMetadata !== null) {
7404
+ decoratedMembers.push({
7405
+ key: member.name,
7406
+ quoted: shouldQuoteName,
7407
+ value: undecoratedMetadata
7408
+ });
7409
+ }
7410
+ }
7411
+ }
7412
+ if (duplicateDecoratedMembers !== null) {
7386
7413
  throw new FatalDiagnosticError(ErrorCode.DUPLICATE_DECORATED_PROPERTIES, duplicateDecoratedMembers[0].nameNode ?? clazz, `Duplicate decorated properties found on class '${clazz.name.text}': ` + duplicateDecoratedMembers.map((member) => member.name).join(", "));
7387
7414
  }
7388
- const decoratedMembers = classMembers.map((member) => classMemberToMetadata(member.nameNode ?? member.name, member.decorators, isCore));
7389
7415
  if (decoratedMembers.length > 0) {
7390
- metaPropDecorators = new WrappedNodeExpr4(ts35.factory.createObjectLiteralExpression(decoratedMembers));
7416
+ metaPropDecorators = literalMap(decoratedMembers);
7391
7417
  }
7392
7418
  return {
7393
7419
  type: new WrappedNodeExpr4(id),
@@ -7408,10 +7434,9 @@ function ctorParameterToMetadata(param, isCore) {
7408
7434
  }
7409
7435
  return literalMap(mapEntries);
7410
7436
  }
7411
- function classMemberToMetadata(name, decorators, isCore) {
7412
- const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
7413
- const decoratorMeta = ts35.factory.createArrayLiteralExpression(ngDecorators);
7414
- return ts35.factory.createPropertyAssignment(name, decoratorMeta);
7437
+ function decoratedClassMemberToMetadata(decorators, isCore) {
7438
+ const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => new WrappedNodeExpr4(decoratorToMetadata(decorator)));
7439
+ return new LiteralArrayExpr(ngDecorators);
7415
7440
  }
7416
7441
  function decoratorToMetadata(decorator, wrapFunctionsInParens) {
7417
7442
  if (decorator.identifier === null) {
@@ -8640,7 +8665,7 @@ import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirect
8640
8665
  import ts65 from "typescript";
8641
8666
 
8642
8667
  // packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.js
8643
- import { createMayBeForwardRefExpression as createMayBeForwardRefExpression2, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr6, ExternalReference as ExternalReference2, getSafePropertyAccessString, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
8668
+ import { createMayBeForwardRefExpression as createMayBeForwardRefExpression2, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr6, ExternalReference as ExternalReference2, getSafePropertyAccessString, LiteralArrayExpr as LiteralArrayExpr2, literalMap as literalMap2, parseHostBindings, verifyHostBindings, R3Identifiers, ArrowFunctionExpr as ArrowFunctionExpr2, WrappedNodeExpr as WrappedNodeExpr6, literal as literal3 } from "@angular/compiler";
8644
8669
  import ts43 from "typescript";
8645
8670
 
8646
8671
  // packages/compiler-cli/src/ngtsc/annotations/directive/src/initializer_function_access.js
@@ -9315,6 +9340,108 @@ function parseFieldStringArrayValue(directive, field, evaluator) {
9315
9340
  }
9316
9341
  return value;
9317
9342
  }
9343
+ function getDirectiveUndecoratedMetadataExtractor(reflector, importTracker) {
9344
+ return (member) => {
9345
+ const input = tryParseSignalInputMapping(member, reflector, importTracker);
9346
+ if (input !== null) {
9347
+ return getDecoratorMetaArray([
9348
+ [new ExternalExpr6(R3Identifiers.inputDecorator), memberMetadataFromSignalInput(input)]
9349
+ ]);
9350
+ }
9351
+ const output = tryParseInitializerBasedOutput(member, reflector, importTracker);
9352
+ if (output !== null) {
9353
+ return getDecoratorMetaArray([
9354
+ [
9355
+ new ExternalExpr6(R3Identifiers.outputDecorator),
9356
+ memberMetadataFromInitializerOutput(output.metadata)
9357
+ ]
9358
+ ]);
9359
+ }
9360
+ const model = tryParseSignalModelMapping(member, reflector, importTracker);
9361
+ if (model !== null) {
9362
+ return getDecoratorMetaArray([
9363
+ [
9364
+ new ExternalExpr6(R3Identifiers.inputDecorator),
9365
+ memberMetadataFromSignalInput(model.input)
9366
+ ],
9367
+ [
9368
+ new ExternalExpr6(R3Identifiers.outputDecorator),
9369
+ memberMetadataFromInitializerOutput(model.output)
9370
+ ]
9371
+ ]);
9372
+ }
9373
+ const query = tryParseSignalQueryFromInitializer(member, reflector, importTracker);
9374
+ if (query !== null) {
9375
+ let identifier;
9376
+ if (query.name === "viewChild") {
9377
+ identifier = R3Identifiers.viewChildDecorator;
9378
+ } else if (query.name === "viewChildren") {
9379
+ identifier = R3Identifiers.viewChildrenDecorator;
9380
+ } else if (query.name === "contentChild") {
9381
+ identifier = R3Identifiers.contentChildDecorator;
9382
+ } else if (query.name === "contentChildren") {
9383
+ identifier = R3Identifiers.contentChildrenDecorator;
9384
+ } else {
9385
+ return null;
9386
+ }
9387
+ return getDecoratorMetaArray([
9388
+ [new ExternalExpr6(identifier), memberMetadataFromSignalQuery(query.call)]
9389
+ ]);
9390
+ }
9391
+ return null;
9392
+ };
9393
+ }
9394
+ function getDecoratorMetaArray(decorators) {
9395
+ return new LiteralArrayExpr2(decorators.map(([type, args]) => literalMap2([
9396
+ { key: "type", value: type, quoted: false },
9397
+ { key: "args", value: args, quoted: false }
9398
+ ])));
9399
+ }
9400
+ function memberMetadataFromSignalInput(input) {
9401
+ return new LiteralArrayExpr2([
9402
+ literalMap2([
9403
+ {
9404
+ key: "isSignal",
9405
+ value: literal3(true),
9406
+ quoted: false
9407
+ },
9408
+ {
9409
+ key: "alias",
9410
+ value: literal3(input.bindingPropertyName),
9411
+ quoted: false
9412
+ },
9413
+ {
9414
+ key: "required",
9415
+ value: literal3(input.required),
9416
+ quoted: false
9417
+ }
9418
+ ])
9419
+ ]);
9420
+ }
9421
+ function memberMetadataFromInitializerOutput(output) {
9422
+ return new LiteralArrayExpr2([literal3(output.bindingPropertyName)]);
9423
+ }
9424
+ function memberMetadataFromSignalQuery(call) {
9425
+ const firstArg = call.arguments[0];
9426
+ const firstArgMeta = ts43.isStringLiteralLike(firstArg) || ts43.isCallExpression(firstArg) ? new WrappedNodeExpr6(firstArg) : (
9427
+ // If the first argument is a class reference, we need to wrap it in a `forwardRef`
9428
+ // because the reference might occur after the current class. This wouldn't be flagged
9429
+ // on the query initializer, because it executes after the class is initialized, whereas
9430
+ // `setClassMetadata` runs immediately.
9431
+ new ExternalExpr6(R3Identifiers.forwardRef).callFn([
9432
+ new ArrowFunctionExpr2([], new WrappedNodeExpr6(firstArg))
9433
+ ])
9434
+ );
9435
+ const entries = [
9436
+ // We use wrapped nodes here, because the output AST doesn't support spread assignments.
9437
+ firstArgMeta,
9438
+ new WrappedNodeExpr6(ts43.factory.createObjectLiteralExpression([
9439
+ ...call.arguments.length > 1 ? [ts43.factory.createSpreadAssignment(call.arguments[1])] : [],
9440
+ ts43.factory.createPropertyAssignment("isSignal", ts43.factory.createTrue())
9441
+ ]))
9442
+ ];
9443
+ return new LiteralArrayExpr2(entries);
9444
+ }
9318
9445
  function isStringArrayOrDie(value, name, node) {
9319
9446
  if (!Array.isArray(value)) {
9320
9447
  return false;
@@ -12171,11 +12298,11 @@ var ReferenceEmitEnvironment = class {
12171
12298
  };
12172
12299
 
12173
12300
  // packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.js
12174
- import { ExpressionType as ExpressionType2, R3Identifiers as R3Identifiers2, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
12301
+ import { ExpressionType as ExpressionType2, R3Identifiers as R3Identifiers3, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
12175
12302
  import ts54 from "typescript";
12176
12303
 
12177
12304
  // packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.js
12178
- import { R3Identifiers } from "@angular/compiler";
12305
+ import { R3Identifiers as R3Identifiers2 } from "@angular/compiler";
12179
12306
  import ts53 from "typescript";
12180
12307
 
12181
12308
  // packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.js
@@ -12270,12 +12397,12 @@ var TypeParameterEmitter = class {
12270
12397
  import { BindingType, CssSelector as CssSelector2, makeBindingParser, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstHostElement, AbsoluteSourceSpan as AbsoluteSourceSpan2, ParseSpan, PropertyRead as PropertyRead2, ParsedEventType, Call, ThisReceiver, KeyedRead, LiteralPrimitive, RecursiveAstVisitor, ASTWithName, SafeCall, ImplicitReceiver as ImplicitReceiver2 } from "@angular/compiler";
12271
12398
  import ts52 from "typescript";
12272
12399
  var GUARD_COMMENT_TEXT = "hostBindingsBlockGuard";
12273
- function createHostElement(type, selector, sourceNode, literal3, bindingDecorators, listenerDecorators) {
12400
+ function createHostElement(type, selector, sourceNode, literal4, bindingDecorators, listenerDecorators) {
12274
12401
  const bindings = [];
12275
12402
  const listeners = [];
12276
12403
  let parser = null;
12277
- if (literal3 !== null) {
12278
- for (const prop of literal3.properties) {
12404
+ if (literal4 !== null) {
12405
+ for (const prop of literal4.properties) {
12279
12406
  if (ts52.isPropertyAssignment(prop) && ts52.isStringLiteralLike(prop.initializer) && isStaticName(prop.name)) {
12280
12407
  parser ??= makeBindingParser();
12281
12408
  createNodeFromHostLiteralProperty(prop, parser, bindings, listeners);
@@ -12501,7 +12628,7 @@ var TCB_FILE_IMPORT_GRAPH_PREPARE_IDENTIFIERS = [
12501
12628
  // Imports may be added for signal input checking. We wouldn't want to change the
12502
12629
  // import graph for incremental compilations when suddenly a signal input is used,
12503
12630
  // or removed.
12504
- R3Identifiers.InputSignalBrandWriteType
12631
+ R3Identifiers2.InputSignalBrandWriteType
12505
12632
  ];
12506
12633
  var TcbInliningRequirement;
12507
12634
  (function(TcbInliningRequirement2) {
@@ -12735,7 +12862,7 @@ function constructTypeCtorParameter(env, meta, rawType) {
12735
12862
  }
12736
12863
  if (signalInputKeys.length > 0) {
12737
12864
  const keyTypeUnion = ts54.factory.createUnionTypeNode(signalInputKeys);
12738
- const unwrapDirectiveSignalInputsExpr = env.referenceExternalType(R3Identifiers2.UnwrapDirectiveSignalInputs.moduleName, R3Identifiers2.UnwrapDirectiveSignalInputs.name, [
12865
+ const unwrapDirectiveSignalInputsExpr = env.referenceExternalType(R3Identifiers3.UnwrapDirectiveSignalInputs.moduleName, R3Identifiers3.UnwrapDirectiveSignalInputs.name, [
12739
12866
  // TODO:
12740
12867
  new ExpressionType2(new WrappedNodeExpr7(rawType)),
12741
12868
  new ExpressionType2(new WrappedNodeExpr7(keyTypeUnion))
@@ -13142,7 +13269,7 @@ var TypeCheckShimGenerator = class {
13142
13269
  };
13143
13270
 
13144
13271
  // packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.js
13145
- import { BindingPipe, BindingType as BindingType2, Call as Call3, createCssSelectorFromNode, CssSelector as CssSelector3, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver3, ParsedEventType as ParsedEventType2, PropertyRead as PropertyRead4, R3Identifiers as R3Identifiers3, SafeCall as SafeCall2, SafePropertyRead as SafePropertyRead3, SelectorMatcher as SelectorMatcher2, ThisReceiver as ThisReceiver2, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundText, TmplAstContent, TmplAstDeferredBlock, TmplAstElement as TmplAstElement2, TmplAstForLoopBlock, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstLetDeclaration as TmplAstLetDeclaration2, TmplAstReference as TmplAstReference2, TmplAstSwitchBlock, TmplAstTemplate, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable, TmplAstHostElement as TmplAstHostElement2, TransplantedType, TmplAstComponent as TmplAstComponent2, TmplAstDirective as TmplAstDirective2, Binary } from "@angular/compiler";
13272
+ import { BindingPipe, BindingType as BindingType2, Call as Call3, createCssSelectorFromNode, CssSelector as CssSelector3, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver3, ParsedEventType as ParsedEventType2, PropertyRead as PropertyRead4, R3Identifiers as R3Identifiers4, SafeCall as SafeCall2, SafePropertyRead as SafePropertyRead3, SelectorMatcher as SelectorMatcher2, ThisReceiver as ThisReceiver2, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundText, TmplAstContent, TmplAstDeferredBlock, TmplAstElement as TmplAstElement2, TmplAstForLoopBlock, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstLetDeclaration as TmplAstLetDeclaration2, TmplAstReference as TmplAstReference2, TmplAstSwitchBlock, TmplAstTemplate, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable, TmplAstHostElement as TmplAstHostElement2, TransplantedType, TmplAstComponent as TmplAstComponent2, TmplAstDirective as TmplAstDirective2, Binary } from "@angular/compiler";
13146
13273
  import ts60 from "typescript";
13147
13274
 
13148
13275
  // packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.js
@@ -13329,8 +13456,8 @@ var AstTranslator = class {
13329
13456
  }
13330
13457
  visitLiteralArray(ast) {
13331
13458
  const elements = ast.expressions.map((expr) => this.translate(expr));
13332
- const literal3 = ts59.factory.createArrayLiteralExpression(elements);
13333
- const node = this.config.strictLiteralTypes ? literal3 : tsCastToAny(literal3);
13459
+ const literal4 = ts59.factory.createArrayLiteralExpression(elements);
13460
+ const node = this.config.strictLiteralTypes ? literal4 : tsCastToAny(literal4);
13334
13461
  addParseSpanInfo(node, ast.sourceSpan);
13335
13462
  return node;
13336
13463
  }
@@ -13339,8 +13466,8 @@ var AstTranslator = class {
13339
13466
  const value = this.translate(ast.values[idx]);
13340
13467
  return ts59.factory.createPropertyAssignment(ts59.factory.createStringLiteral(key), value);
13341
13468
  });
13342
- const literal3 = ts59.factory.createObjectLiteralExpression(properties, true);
13343
- const node = this.config.strictLiteralTypes ? literal3 : tsCastToAny(literal3);
13469
+ const literal4 = ts59.factory.createObjectLiteralExpression(properties, true);
13470
+ const node = this.config.strictLiteralTypes ? literal4 : tsCastToAny(literal4);
13344
13471
  addParseSpanInfo(node, ast.sourceSpan);
13345
13472
  return node;
13346
13473
  }
@@ -14111,9 +14238,9 @@ var TcbDirectiveInputsOp = class extends TcbOp {
14111
14238
  target = this.dir.stringLiteralInputFields.has(fieldName) ? ts60.factory.createElementAccessExpression(dirId, ts60.factory.createStringLiteral(fieldName)) : ts60.factory.createPropertyAccessExpression(dirId, ts60.factory.createIdentifier(fieldName));
14112
14239
  }
14113
14240
  if (isSignal) {
14114
- const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(R3Identifiers3.InputSignalBrandWriteType.moduleName, R3Identifiers3.InputSignalBrandWriteType.name);
14241
+ const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(R3Identifiers4.InputSignalBrandWriteType.moduleName, R3Identifiers4.InputSignalBrandWriteType.name);
14115
14242
  if (!ts60.isIdentifier(inputSignalBrandWriteSymbol) && !ts60.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
14116
- throw new Error(`Expected identifier or property access for reference to ${R3Identifiers3.InputSignalBrandWriteType.name}`);
14243
+ throw new Error(`Expected identifier or property access for reference to ${R3Identifiers4.InputSignalBrandWriteType.name}`);
14117
14244
  }
14118
14245
  target = ts60.factory.createElementAccessExpression(target, inputSignalBrandWriteSymbol);
14119
14246
  }
@@ -15624,7 +15751,7 @@ function widenBinding(expr, tcb) {
15624
15751
  }
15625
15752
  }
15626
15753
  function unwrapWritableSignal(expression, tcb) {
15627
- const unwrapRef = tcb.env.referenceExternalSymbol(R3Identifiers3.unwrapWritableSignal.moduleName, R3Identifiers3.unwrapWritableSignal.name);
15754
+ const unwrapRef = tcb.env.referenceExternalSymbol(R3Identifiers4.unwrapWritableSignal.moduleName, R3Identifiers4.unwrapWritableSignal.name);
15628
15755
  return ts60.factory.createCallExpression(unwrapRef, void 0, [expression]);
15629
15756
  }
15630
15757
  var EVENT_PARAMETER = "$event";
@@ -16241,7 +16368,7 @@ var DirectiveSourceManager = class {
16241
16368
  };
16242
16369
 
16243
16370
  // packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.js
16244
- import { AST, ASTWithName as ASTWithName2, ASTWithSource as ASTWithSource2, Binary as Binary2, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, R3Identifiers as R3Identifiers4, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute3, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstComponent as TmplAstComponent3, TmplAstDirective as TmplAstDirective3, TmplAstElement as TmplAstElement3, TmplAstLetDeclaration as TmplAstLetDeclaration3, TmplAstReference as TmplAstReference3, TmplAstTemplate as TmplAstTemplate2, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
16371
+ import { AST, ASTWithName as ASTWithName2, ASTWithSource as ASTWithSource2, Binary as Binary2, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, R3Identifiers as R3Identifiers5, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute3, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstComponent as TmplAstComponent3, TmplAstDirective as TmplAstDirective3, TmplAstElement as TmplAstElement3, TmplAstLetDeclaration as TmplAstLetDeclaration3, TmplAstReference as TmplAstReference3, TmplAstTemplate as TmplAstTemplate2, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
16245
16372
  import ts63 from "typescript";
16246
16373
  var SymbolBuilder = class {
16247
16374
  tcbPath;
@@ -16871,7 +16998,7 @@ function unwrapSignalInputWriteTAccessor(expr) {
16871
16998
  if (!ts63.isElementAccessExpression(expr) || !ts63.isPropertyAccessExpression(expr.argumentExpression)) {
16872
16999
  return null;
16873
17000
  }
16874
- if (!ts63.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== R3Identifiers4.InputSignalBrandWriteType.name) {
17001
+ if (!ts63.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== R3Identifiers5.InputSignalBrandWriteType.name) {
16875
17002
  return null;
16876
17003
  }
16877
17004
  if (!ts63.isPropertyAccessExpression(expr.expression) && !ts63.isElementAccessExpression(expr.expression) && !ts63.isIdentifier(expr.expression)) {
@@ -16977,6 +17104,9 @@ var TemplateTypeCheckerImpl = class {
16977
17104
  const { data } = this.getLatestComponentState(directive, optimizeFor);
16978
17105
  return data?.hostElement ?? null;
16979
17106
  }
17107
+ getDirectivesOfNode(component, node) {
17108
+ return this.getLatestComponentState(component).data?.boundTarget.getDirectivesOfNode(node) ?? null;
17109
+ }
16980
17110
  getUsedDirectives(component) {
16981
17111
  return this.getLatestComponentState(component).data?.boundTarget.getUsedDirectives() ?? null;
16982
17112
  }
@@ -18135,9 +18265,11 @@ var DirectiveDecoratorHandler = class {
18135
18265
  this.usePoisonedData = usePoisonedData;
18136
18266
  this.typeCheckHostBindings = typeCheckHostBindings;
18137
18267
  this.emitDeclarationOnly = emitDeclarationOnly;
18268
+ this.undecoratedMetadataExtractor = getDirectiveUndecoratedMetadataExtractor(reflector, importTracker);
18138
18269
  }
18139
18270
  precedence = HandlerPrecedence.PRIMARY;
18140
18271
  name = "DirectiveDecoratorHandler";
18272
+ undecoratedMetadataExtractor;
18141
18273
  detect(node, decorators) {
18142
18274
  if (!decorators) {
18143
18275
  const angularField = this.findClassFieldWithAngularFeatures(node);
@@ -18189,7 +18321,7 @@ var DirectiveDecoratorHandler = class {
18189
18321
  meta: analysis,
18190
18322
  hostDirectives: directiveResult.hostDirectives,
18191
18323
  rawHostDirectives: directiveResult.rawHostDirectives,
18192
- classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler) : null,
18324
+ classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler, void 0, this.undecoratedMetadataExtractor) : null,
18193
18325
  baseClass: readBaseClass(node, this.reflector, this.evaluator),
18194
18326
  typeCheckMeta: extractDirectiveTypeCheckMeta(node, directiveResult.inputs, this.reflector),
18195
18327
  providersRequiringFactory,
@@ -18363,7 +18495,7 @@ var DirectiveDecoratorHandler = class {
18363
18495
  };
18364
18496
 
18365
18497
  // packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.js
18366
- import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr9, FactoryTarget as FactoryTarget2, FunctionExpr, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, R3Identifiers as R3Identifiers5, R3NgModuleMetadataKind, R3SelectorScopeMode, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr10 } from "@angular/compiler";
18498
+ import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr9, FactoryTarget as FactoryTarget2, FunctionExpr, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr3, R3Identifiers as R3Identifiers6, R3NgModuleMetadataKind, R3SelectorScopeMode, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr10 } from "@angular/compiler";
18367
18499
  import ts67 from "typescript";
18368
18500
 
18369
18501
  // packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.js
@@ -18999,14 +19131,14 @@ var NgModuleDecoratorHandler = class {
18999
19131
  assertSuccessfulReferenceEmit(type, node, "pipe");
19000
19132
  return type.expression;
19001
19133
  });
19002
- const directiveArray = new LiteralArrayExpr2(directives);
19003
- const pipesArray = new LiteralArrayExpr2(pipes);
19134
+ const directiveArray = new LiteralArrayExpr3(directives);
19135
+ const pipesArray = new LiteralArrayExpr3(pipes);
19004
19136
  const directiveExpr = remoteScopesMayRequireCycleProtection && directives.length > 0 ? new FunctionExpr([], [new ReturnStatement(directiveArray)]) : directiveArray;
19005
19137
  const pipesExpr = remoteScopesMayRequireCycleProtection && pipes.length > 0 ? new FunctionExpr([], [new ReturnStatement(pipesArray)]) : pipesArray;
19006
19138
  const componentType = this.refEmitter.emit(decl, context);
19007
19139
  assertSuccessfulReferenceEmit(componentType, node, "component");
19008
19140
  const declExpr = componentType.expression;
19009
- const setComponentScope = new ExternalExpr9(R3Identifiers5.setComponentScope);
19141
+ const setComponentScope = new ExternalExpr9(R3Identifiers6.setComponentScope);
19010
19142
  const callExpr = new InvokeFunctionExpr(setComponentScope, [
19011
19143
  declExpr,
19012
19144
  directiveExpr,
@@ -20080,10 +20212,12 @@ var ComponentDecoratorHandler = class {
20080
20212
  enableSelectorless: this.enableSelectorless,
20081
20213
  preserveSignificantWhitespace: this.i18nPreserveSignificantWhitespace
20082
20214
  };
20215
+ this.undecoratedMetadataExtractor = getDirectiveUndecoratedMetadataExtractor(reflector, importTracker);
20083
20216
  this.canDeferDeps = !enableHmr;
20084
20217
  }
20085
20218
  literalCache = /* @__PURE__ */ new Map();
20086
20219
  elementSchemaRegistry = new DomElementSchemaRegistry3();
20220
+ undecoratedMetadataExtractor;
20087
20221
  /**
20088
20222
  * During the asynchronous preanalyze phase, it's necessary to parse the template to extract
20089
20223
  * any potential <link> tags which might need to be loaded. This cache ensures that work is not
@@ -20470,7 +20604,7 @@ var ComponentDecoratorHandler = class {
20470
20604
  relativeTemplatePath
20471
20605
  },
20472
20606
  typeCheckMeta: extractDirectiveTypeCheckMeta(node, inputs, this.reflector),
20473
- classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler, (dec) => transformDecoratorResources(dec, component, styles, template)) : null,
20607
+ classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler, (dec) => transformDecoratorResources(dec, component, styles, template), this.undecoratedMetadataExtractor) : null,
20474
20608
  classDebugInfo: extractClassDebugInfo(
20475
20609
  node,
20476
20610
  this.reflector,
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "./chunk-Y3D2VBHK.js";
7
+ } from "./chunk-2WL2LMYD.js";
8
8
  import {
9
9
  AbsoluteModuleStrategy,
10
10
  ActivePerfRecorder,
@@ -92,7 +92,7 @@ import {
92
92
  toUnredirectedSourceFile,
93
93
  tryParseInitializerApi,
94
94
  untagAllTsFiles
95
- } from "./chunk-SZUJOV4Y.js";
95
+ } from "./chunk-NR7S7ISS.js";
96
96
  import {
97
97
  LogicalFileSystem,
98
98
  absoluteFrom,
@@ -2804,7 +2804,7 @@ var StandaloneComponentScopeReader = class {
2804
2804
  };
2805
2805
 
2806
2806
  // packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.js
2807
- import { ASTWithSource as ASTWithSource2, BindingType, Interpolation, PrefixNot, PropertyRead as PropertyRead2, TmplAstBoundAttribute, TmplAstIfBlock, TmplAstSwitchBlock } from "@angular/compiler";
2807
+ import { ASTWithSource as ASTWithSource2, BindingType, Interpolation, PrefixNot, PropertyRead as PropertyRead2, TmplAstBoundAttribute, TmplAstElement as TmplAstElement2, TmplAstIfBlock, TmplAstSwitchBlock, TmplAstTemplate as TmplAstTemplate2 } from "@angular/compiler";
2808
2808
 
2809
2809
  // packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.js
2810
2810
  import ts18 from "typescript";
@@ -2895,23 +2895,21 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
2895
2895
  visitNode(ctx, component, node) {
2896
2896
  if (node instanceof Interpolation) {
2897
2897
  return node.expressions.map((item) => item instanceof PrefixNot ? item.expression : item).filter((item) => item instanceof PropertyRead2).flatMap((item) => buildDiagnosticForSignal(ctx, item, component));
2898
- } else if (node instanceof TmplAstBoundAttribute) {
2899
- const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
2900
- if (symbol?.kind === SymbolKind.Input && symbol.bindings.length > 0 && symbol.bindings.some((binding) => binding.target.kind === SymbolKind.Directive)) {
2901
- return [];
2902
- }
2903
- const nodeAst = isPropertyReadNodeAst(node);
2904
- if (
2905
- // a bound property like `[prop]="mySignal"`
2906
- (node.type === BindingType.Property || // or a class binding like `[class.myClass]="mySignal"`
2907
- node.type === BindingType.Class || // or a style binding like `[style.width]="mySignal"`
2908
- node.type === BindingType.Style || // or an attribute binding like `[attr.role]="mySignal"`
2909
- node.type === BindingType.Attribute || // or an animation binding like `[animate.enter]="mySignal"`
2910
- node.type === BindingType.Animation || // or an animation binding like `[@myAnimation]="mySignal"`
2911
- node.type === BindingType.LegacyAnimation) && nodeAst
2912
- ) {
2913
- return buildDiagnosticForSignal(ctx, nodeAst, component);
2914
- }
2898
+ } else if (node instanceof TmplAstElement2 && node.inputs.length > 0) {
2899
+ const directivesOfElement = ctx.templateTypeChecker.getDirectivesOfNode(component, node);
2900
+ return node.inputs.flatMap((input) => checkBoundAttribute(ctx, component, directivesOfElement, input));
2901
+ } else if (node instanceof TmplAstTemplate2 && node.tagName === "ng-template") {
2902
+ const directivesOfElement = ctx.templateTypeChecker.getDirectivesOfNode(component, node);
2903
+ const inputDiagnostics = node.inputs.flatMap((input) => {
2904
+ return checkBoundAttribute(ctx, component, directivesOfElement, input);
2905
+ });
2906
+ const templateAttrDiagnostics = node.templateAttrs.flatMap((attr) => {
2907
+ if (!(attr instanceof TmplAstBoundAttribute)) {
2908
+ return [];
2909
+ }
2910
+ return checkBoundAttribute(ctx, component, directivesOfElement, attr);
2911
+ });
2912
+ return inputDiagnostics.concat(templateAttrDiagnostics);
2915
2913
  } else if (node instanceof TmplAstIfBlock) {
2916
2914
  return node.branches.map((branch) => branch.expression).filter((expr) => expr instanceof ASTWithSource2).map((expr) => {
2917
2915
  const ast = expr.ast;
@@ -2926,6 +2924,24 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
2926
2924
  return [];
2927
2925
  }
2928
2926
  };
2927
+ function checkBoundAttribute(ctx, component, directivesOfElement, node) {
2928
+ if (directivesOfElement !== null && directivesOfElement.some((dir) => dir.inputs.getByBindingPropertyName(node.name) !== null)) {
2929
+ return [];
2930
+ }
2931
+ const nodeAst = isPropertyReadNodeAst(node);
2932
+ if (
2933
+ // a bound property like `[prop]="mySignal"`
2934
+ (node.type === BindingType.Property || // or a class binding like `[class.myClass]="mySignal"`
2935
+ node.type === BindingType.Class || // or a style binding like `[style.width]="mySignal"`
2936
+ node.type === BindingType.Style || // or an attribute binding like `[attr.role]="mySignal"`
2937
+ node.type === BindingType.Attribute || // or an animation binding like `[animate.enter]="mySignal"`
2938
+ node.type === BindingType.Animation || // or an animation binding like `[@myAnimation]="mySignal"`
2939
+ node.type === BindingType.LegacyAnimation) && nodeAst
2940
+ ) {
2941
+ return buildDiagnosticForSignal(ctx, nodeAst, component);
2942
+ }
2943
+ return [];
2944
+ }
2929
2945
  function isPropertyReadNodeAst(node) {
2930
2946
  if (node.value instanceof ASTWithSource2 === false) {
2931
2947
  return void 0;
@@ -2952,8 +2968,11 @@ function buildDiagnosticForSignal(ctx, node, component) {
2952
2968
  const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
2953
2969
  return [diagnostic];
2954
2970
  }
2971
+ if (!isFunctionInstanceProperty(node.name) && !isSignalInstanceProperty(node.name)) {
2972
+ return [];
2973
+ }
2955
2974
  const symbolOfReceiver = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
2956
- if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) && symbolOfReceiver !== null && symbolOfReceiver.kind === SymbolKind.Expression && isSignalReference(symbolOfReceiver)) {
2975
+ if (symbolOfReceiver !== null && symbolOfReceiver.kind === SymbolKind.Expression && isSignalReference(symbolOfReceiver)) {
2957
2976
  const templateMapping = ctx.templateTypeChecker.getSourceMappingAtTcbLocation(symbolOfReceiver.tcbLocation);
2958
2977
  const errorString = `${node.receiver.name} is a function and should be invoked: ${node.receiver.name}()`;
2959
2978
  const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
@@ -2991,7 +3010,7 @@ var factory2 = {
2991
3010
  };
2992
3011
 
2993
3012
  // packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_control_flow_directive/index.js
2994
- import { TmplAstTemplate as TmplAstTemplate2 } from "@angular/compiler";
3013
+ import { TmplAstTemplate as TmplAstTemplate3 } from "@angular/compiler";
2995
3014
  var KNOWN_CONTROL_FLOW_DIRECTIVES = /* @__PURE__ */ new Map([
2996
3015
  ["ngIf", { directive: "NgIf", builtIn: "@if" }],
2997
3016
  ["ngFor", { directive: "NgFor", builtIn: "@for" }],
@@ -3008,7 +3027,7 @@ var MissingControlFlowDirectiveCheck = class extends TemplateCheckWithVisitor {
3008
3027
  return super.run(ctx, component, template);
3009
3028
  }
3010
3029
  visitNode(ctx, component, node) {
3011
- if (!(node instanceof TmplAstTemplate2))
3030
+ if (!(node instanceof TmplAstTemplate3))
3012
3031
  return [];
3013
3032
  const controlFlowAttr = node.templateAttrs.find((attr) => KNOWN_CONTROL_FLOW_DIRECTIVES.has(attr.name));
3014
3033
  if (!controlFlowAttr)
@@ -3033,12 +3052,12 @@ var factory3 = {
3033
3052
  };
3034
3053
 
3035
3054
  // packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_ngforof_let/index.js
3036
- import { TmplAstTemplate as TmplAstTemplate3 } from "@angular/compiler";
3055
+ import { TmplAstTemplate as TmplAstTemplate4 } from "@angular/compiler";
3037
3056
  var MissingNgForOfLetCheck = class extends TemplateCheckWithVisitor {
3038
3057
  code = ErrorCode.MISSING_NGFOROF_LET;
3039
3058
  visitNode(ctx, component, node) {
3040
- const isTemplate = node instanceof TmplAstTemplate3;
3041
- if (!(node instanceof TmplAstTemplate3)) {
3059
+ const isTemplate = node instanceof TmplAstTemplate4;
3060
+ if (!(node instanceof TmplAstTemplate4)) {
3042
3061
  return [];
3043
3062
  }
3044
3063
  if (node.templateAttrs.length === 0) {
@@ -3063,7 +3082,7 @@ var factory4 = {
3063
3082
  };
3064
3083
 
3065
3084
  // packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_structural_directive/index.js
3066
- import { TmplAstTemplate as TmplAstTemplate4 } from "@angular/compiler";
3085
+ import { TmplAstTemplate as TmplAstTemplate5 } from "@angular/compiler";
3067
3086
  var KNOWN_CONTROL_FLOW_DIRECTIVES2 = /* @__PURE__ */ new Set([
3068
3087
  "ngIf",
3069
3088
  "ngFor",
@@ -3082,7 +3101,7 @@ var MissingStructuralDirectiveCheck = class extends TemplateCheckWithVisitor {
3082
3101
  return super.run(ctx, component, template);
3083
3102
  }
3084
3103
  visitNode(ctx, component, node) {
3085
- if (!(node instanceof TmplAstTemplate4))
3104
+ if (!(node instanceof TmplAstTemplate5))
3086
3105
  return [];
3087
3106
  const customStructuralDirective = node.templateAttrs.find((attr) => !KNOWN_CONTROL_FLOW_DIRECTIVES2.has(attr.name));
3088
3107
  if (!customStructuralDirective)
@@ -12,7 +12,7 @@ import {
12
12
  formatDiagnostics,
13
13
  performCompilation,
14
14
  readConfiguration
15
- } from "./chunk-WNPSVVUI.js";
15
+ } from "./chunk-TFJ2HFCB.js";
16
16
 
17
17
  // packages/compiler-cli/src/main.js
18
18
  import ts2 from "typescript";
package/bundles/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  isTsDiagnostic,
29
29
  performCompilation,
30
30
  readConfiguration
31
- } from "./chunk-WNPSVVUI.js";
31
+ } from "./chunk-TFJ2HFCB.js";
32
32
  import {
33
33
  ConsoleLogger,
34
34
  LogLevel
@@ -37,7 +37,7 @@ import {
37
37
  angularJitApplicationTransform,
38
38
  getDownlevelDecoratorsTransform,
39
39
  getInitializerApiJitTransform
40
- } from "./chunk-Y3D2VBHK.js";
40
+ } from "./chunk-2WL2LMYD.js";
41
41
  import {
42
42
  ActivePerfRecorder,
43
43
  ErrorCode,
@@ -46,7 +46,7 @@ import {
46
46
  TsCreateProgramDriver,
47
47
  isLocalCompilationDiagnostics,
48
48
  ngErrorCode
49
- } from "./chunk-SZUJOV4Y.js";
49
+ } from "./chunk-NR7S7ISS.js";
50
50
  import "./chunk-I2BHWRAU.js";
51
51
  import {
52
52
  InvalidFileSystem,
@@ -77,7 +77,7 @@ import "./chunk-G7GFT6BU.js";
77
77
 
78
78
  // packages/compiler-cli/src/version.js
79
79
  import { Version } from "@angular/compiler";
80
- var VERSION = new Version("20.3.4");
80
+ var VERSION = new Version("20.3.5");
81
81
 
82
82
  // packages/compiler-cli/private/tooling.js
83
83
  var GLOBAL_DEFS_FOR_TERSER = {
@@ -13,7 +13,7 @@ import {
13
13
  TypeScriptReflectionHost,
14
14
  createForwardRefResolver,
15
15
  reflectObjectLiteral
16
- } from "../chunk-SZUJOV4Y.js";
16
+ } from "../chunk-NR7S7ISS.js";
17
17
  import "../chunk-I2BHWRAU.js";
18
18
  import "../chunk-GWZQLAGK.js";
19
19
  import "../chunk-XYYEESKY.js";
@@ -4,8 +4,8 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "../chunk-Y3D2VBHK.js";
8
- import "../chunk-SZUJOV4Y.js";
7
+ } from "../chunk-2WL2LMYD.js";
8
+ import "../chunk-NR7S7ISS.js";
9
9
  import "../chunk-I2BHWRAU.js";
10
10
  import "../chunk-GWZQLAGK.js";
11
11
  import "../chunk-XYYEESKY.js";
@@ -6,12 +6,12 @@
6
6
  import {
7
7
  main,
8
8
  readCommandLineAndConfiguration
9
- } from "../../chunk-JKYMLCNY.js";
9
+ } from "../../chunk-ZE3ZGBK3.js";
10
10
  import {
11
11
  EmitFlags
12
- } from "../../chunk-WNPSVVUI.js";
13
- import "../../chunk-Y3D2VBHK.js";
14
- import "../../chunk-SZUJOV4Y.js";
12
+ } from "../../chunk-TFJ2HFCB.js";
13
+ import "../../chunk-2WL2LMYD.js";
14
+ import "../../chunk-NR7S7ISS.js";
15
15
  import "../../chunk-I2BHWRAU.js";
16
16
  import {
17
17
  setFileSystem
@@ -5,10 +5,10 @@
5
5
 
6
6
  import {
7
7
  main
8
- } from "../../chunk-JKYMLCNY.js";
9
- import "../../chunk-WNPSVVUI.js";
10
- import "../../chunk-Y3D2VBHK.js";
11
- import "../../chunk-SZUJOV4Y.js";
8
+ } from "../../chunk-ZE3ZGBK3.js";
9
+ import "../../chunk-TFJ2HFCB.js";
10
+ import "../../chunk-2WL2LMYD.js";
11
+ import "../../chunk-NR7S7ISS.js";
12
12
  import "../../chunk-I2BHWRAU.js";
13
13
  import {
14
14
  setFileSystem
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
9
9
  import { AstObject, AstValue } from '../../ast/ast_value';
10
- export declare const PLACEHOLDER_VERSION = "20.3.4";
10
+ export declare const PLACEHOLDER_VERSION = "20.3.5";
11
11
  export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
12
12
  /**
13
13
  * Parses the value of an enum from the AST value's symbol name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "20.3.4",
3
+ "version": "20.3.5",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -48,7 +48,7 @@
48
48
  "yargs": "^18.0.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@angular/compiler": "20.3.4",
51
+ "@angular/compiler": "20.3.5",
52
52
  "typescript": ">=5.8 <6.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
@@ -5,9 +5,11 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { R3ClassMetadata } from '@angular/compiler';
8
+ import { LiteralArrayExpr, R3ClassMetadata } from '@angular/compiler';
9
9
  import ts from 'typescript';
10
- import { DeclarationNode, Decorator, ReflectionHost } from '../../../reflection';
10
+ import { ClassMember, DeclarationNode, Decorator, ReflectionHost } from '../../../reflection';
11
+ /** Function that extracts metadata from an undercorated class member. */
12
+ export type UndecoratedMetadataExtractor = (member: ClassMember) => LiteralArrayExpr | null;
11
13
  /**
12
14
  * Given a class declaration, generate a call to `setClassMetadata` with the Angular metadata
13
15
  * present on the class or its member fields. An ngDevMode guard is used to allow the call to be
@@ -16,7 +18,7 @@ import { DeclarationNode, Decorator, ReflectionHost } from '../../../reflection'
16
18
  * If no such metadata is present, this function returns `null`. Otherwise, the call is returned
17
19
  * as a `Statement` for inclusion along with the class.
18
20
  */
19
- export declare function extractClassMetadata(clazz: DeclarationNode, reflection: ReflectionHost, isCore: boolean, annotateForClosureCompiler?: boolean, angularDecoratorTransform?: (dec: Decorator) => Decorator): R3ClassMetadata | null;
21
+ export declare function extractClassMetadata(clazz: DeclarationNode, reflection: ReflectionHost, isCore: boolean, annotateForClosureCompiler?: boolean, angularDecoratorTransform?: (dec: Decorator) => Decorator, undecoratedMetadataExtractor?: UndecoratedMetadataExtractor): R3ClassMetadata | null;
20
22
  /**
21
23
  * Recursively recreates all of the `Identifier` descendant nodes with a particular name inside
22
24
  * of an AST node, thus removing any references to them. Useful if a particular node has to be
@@ -79,6 +79,7 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
79
79
  constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, strictCtorDeps: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, compilationMode: CompilationMode, deferredSymbolTracker: DeferredSymbolTracker, forbidOrphanRendering: boolean, enableBlockSyntax: boolean, enableLetSyntax: boolean, externalRuntimeStyles: boolean, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null, jitDeclarationRegistry: JitDeclarationRegistry, i18nPreserveSignificantWhitespace: boolean, strictStandalone: boolean, enableHmr: boolean, implicitStandaloneValue: boolean, typeCheckHostBindings: boolean, enableSelectorless: boolean, emitDeclarationOnly: boolean);
80
80
  private literalCache;
81
81
  private elementSchemaRegistry;
82
+ private readonly undecoratedMetadataExtractor;
82
83
  /**
83
84
  * During the asynchronous preanalyze phase, it's necessary to parse the template to extract
84
85
  * any potential <link> tags which might need to be loaded. This cache ensures that work is not
@@ -65,6 +65,7 @@ export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decor
65
65
  constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, strictCtorDeps: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, typeCheckScopeRegistry: TypeCheckScopeRegistry, compilationMode: CompilationMode, jitDeclarationRegistry: JitDeclarationRegistry, resourceRegistry: ResourceRegistry, strictStandalone: boolean, implicitStandaloneValue: boolean, usePoisonedData: boolean, typeCheckHostBindings: boolean, emitDeclarationOnly: boolean);
66
66
  readonly precedence = HandlerPrecedence.PRIMARY;
67
67
  readonly name = "DirectiveDecoratorHandler";
68
+ private readonly undecoratedMetadataExtractor;
68
69
  detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
69
70
  analyze(node: ClassDeclaration, decorator: Readonly<Decorator | null>): AnalysisOutput<DirectiveHandlerData>;
70
71
  symbol(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>): DirectiveSymbol;
@@ -12,7 +12,7 @@ import { ClassPropertyMapping, DecoratorInputTransform, HostDirectiveMeta, Input
12
12
  import { DynamicValue, PartialEvaluator } from '../../../partial_evaluator';
13
13
  import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
14
14
  import { CompilationMode } from '../../../transform';
15
- import { ReferencesRegistry } from '../../common';
15
+ import { ReferencesRegistry, UndecoratedMetadataExtractor } from '../../common';
16
16
  type QueryDecoratorName = 'ViewChild' | 'ViewChildren' | 'ContentChild' | 'ContentChildren';
17
17
  export declare const queryDecoratorNames: QueryDecoratorName[];
18
18
  export interface HostBindingNodes {
@@ -43,6 +43,11 @@ export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decora
43
43
  export declare function extractDecoratorQueryMetadata(exprNode: ts.Node, name: string, args: ReadonlyArray<ts.Expression>, propertyName: string, reflector: ReflectionHost, evaluator: PartialEvaluator): R3QueryMetadata;
44
44
  export declare function parseDirectiveStyles(directive: Map<string, ts.Expression>, evaluator: PartialEvaluator, compilationMode: CompilationMode): null | string[];
45
45
  export declare function parseFieldStringArrayValue(directive: Map<string, ts.Expression>, field: string, evaluator: PartialEvaluator): null | string[];
46
+ /**
47
+ * Returns a function that can be used to extract data for the `setClassMetadata`
48
+ * calls from undecorated directive class members.
49
+ */
50
+ export declare function getDirectiveUndecoratedMetadataExtractor(reflector: ReflectionHost, importTracker: ImportedSymbolsTracker): UndecoratedMetadataExtractor;
46
51
  /**
47
52
  * Parses the `transform` function and its type for a decorator `@Input`.
48
53
  *
@@ -204,6 +204,10 @@ export interface TemplateTypeChecker {
204
204
  * Retrieve the type checking engine's metadata for the given pipe class, if available.
205
205
  */
206
206
  getPipeMetadata(pipe: ts.ClassDeclaration): PipeMeta | null;
207
+ /**
208
+ * Gets the directives that apply to the given template node in a component's template.
209
+ */
210
+ getDirectivesOfNode(component: ts.ClassDeclaration, node: TmplAstElement | TmplAstTemplate): TypeCheckableDirectiveMeta[] | null;
207
211
  /**
208
212
  * Gets the directives that have been used in a component's template.
209
213
  */
@@ -78,6 +78,7 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
78
78
  constructor(originalProgram: ts.Program, programDriver: ProgramDriver, typeCheckAdapter: ProgramTypeCheckAdapter, config: TypeCheckingConfig, refEmitter: ReferenceEmitter, reflector: ReflectionHost, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, priorBuild: IncrementalBuild<unknown, FileTypeCheckingData>, metaReader: MetadataReader, localMetaReader: MetadataReaderWithIndex, ngModuleIndex: NgModuleIndex, componentScopeReader: ComponentScopeReader, typeCheckScopeRegistry: TypeCheckScopeRegistry, perf: PerfRecorder);
79
79
  getTemplate(component: ts.ClassDeclaration, optimizeFor?: OptimizeFor): TmplAstNode[] | null;
80
80
  getHostElement(directive: ts.ClassDeclaration, optimizeFor?: OptimizeFor): TmplAstHostElement | null;
81
+ getDirectivesOfNode(component: ts.ClassDeclaration, node: TmplAstElement | TmplAstTemplate): TypeCheckableDirectiveMeta[] | null;
81
82
  getUsedDirectives(component: ts.ClassDeclaration): TypeCheckableDirectiveMeta[] | null;
82
83
  getUsedPipes(component: ts.ClassDeclaration): string[] | null;
83
84
  private getLatestComponentState;