@angular/compiler-cli 20.2.0-next.3 → 20.2.0-next.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.
@@ -7557,7 +7557,7 @@ var SemanticDepGraph = class {
7557
7557
  files = /* @__PURE__ */ new Map();
7558
7558
  // Note: the explicit type annotation is used to work around a CI failure on Windows:
7559
7559
  // error TS2742: The inferred type of 'symbolByDecl' cannot be named without a reference to
7560
- // '../../../../../../../external/npm/node_modules/typescript/lib/typescript'. This is likely
7560
+ // '../../../../../../../external/angular/node_modules/typescript/lib/typescript'. This is likely
7561
7561
  // not portable. A type annotation is necessary.
7562
7562
  symbolByDecl = /* @__PURE__ */ new Map();
7563
7563
  /**
@@ -8525,17 +8525,20 @@ var TypeCheckScopeRegistry = class {
8525
8525
  * contains an error, then 'error' is returned. If the component is not declared in any NgModule,
8526
8526
  * an empty type-check scope is returned.
8527
8527
  */
8528
- getTypeCheckScope(node) {
8528
+ getTypeCheckScope(ref) {
8529
8529
  const directives = [];
8530
8530
  const pipes = /* @__PURE__ */ new Map();
8531
- const scope = this.scopeReader.getScopeForComponent(node);
8531
+ const scope = this.scopeReader.getScopeForComponent(ref.node);
8532
+ const hostMeta = this.getTypeCheckDirectiveMetadata(ref);
8533
+ const directivesOnHost = hostMeta === null ? null : this.combineWithHostDirectives(hostMeta);
8532
8534
  if (scope === null) {
8533
8535
  return {
8534
8536
  matcher: null,
8535
8537
  directives,
8536
8538
  pipes,
8537
8539
  schemas: [],
8538
- isPoisoned: false
8540
+ isPoisoned: false,
8541
+ directivesOnHost
8539
8542
  };
8540
8543
  }
8541
8544
  const isNgModuleScope = scope.kind === ComponentScopeKind.NgModule;
@@ -8574,6 +8577,7 @@ var TypeCheckScopeRegistry = class {
8574
8577
  directives,
8575
8578
  pipes,
8576
8579
  schemas: scope.schemas,
8580
+ directivesOnHost,
8577
8581
  isPoisoned: scope.kind === ComponentScopeKind.NgModule ? scope.compilation.isPoisoned || scope.exported.isPoisoned : scope.isPoisoned
8578
8582
  };
8579
8583
  this.scopeCache.set(cacheKey, typeCheckScope);
@@ -8603,10 +8607,7 @@ var TypeCheckScopeRegistry = class {
8603
8607
  continue;
8604
8608
  }
8605
8609
  const directiveMeta = this.applyExplicitlyDeferredFlag(extMeta, meta.isExplicitlyDeferred);
8606
- matcher.addSelectables(CssSelector.parse(meta.selector), [
8607
- ...this.hostDirectivesResolver.resolve(directiveMeta),
8608
- directiveMeta
8609
- ]);
8610
+ matcher.addSelectables(CssSelector.parse(meta.selector), this.combineWithHostDirectives(directiveMeta));
8610
8611
  }
8611
8612
  }
8612
8613
  return matcher;
@@ -8616,11 +8617,14 @@ var TypeCheckScopeRegistry = class {
8616
8617
  for (const [name, dep] of scope.dependencies) {
8617
8618
  const extMeta = dep.kind === MetaKind.Directive ? this.getTypeCheckDirectiveMetadata(dep.ref) : null;
8618
8619
  if (extMeta !== null) {
8619
- registry.set(name, [extMeta, ...this.hostDirectivesResolver.resolve(extMeta)]);
8620
+ registry.set(name, this.combineWithHostDirectives(extMeta));
8620
8621
  }
8621
8622
  }
8622
8623
  return new SelectorlessMatcher(registry);
8623
8624
  }
8625
+ combineWithHostDirectives(meta) {
8626
+ return [...this.hostDirectivesResolver.resolve(meta), meta];
8627
+ }
8624
8628
  };
8625
8629
 
8626
8630
  // packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.js
@@ -13527,7 +13531,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
13527
13531
  statements.push(renderBlockStatements(env, templateScope, ts60.factory.createTrue()));
13528
13532
  }
13529
13533
  if (tcb.boundTarget.target.host !== void 0) {
13530
- const hostScope = Scope.forNodes(tcb, null, tcb.boundTarget.target.host, null, null);
13534
+ const hostScope = Scope.forNodes(tcb, null, tcb.boundTarget.target.host.node, null, null);
13531
13535
  statements.push(renderBlockStatements(env, hostScope, createHostBindingsBlockGuard()));
13532
13536
  }
13533
13537
  const body = ts60.factory.createBlock(statements);
@@ -13786,6 +13790,7 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
13786
13790
  const dirRef = this.dir.ref;
13787
13791
  const rawType = this.tcb.env.referenceType(this.dir.ref);
13788
13792
  let type;
13793
+ let span;
13789
13794
  if (this.dir.isGeneric === false || dirRef.node.typeParameters === void 0) {
13790
13795
  type = rawType;
13791
13796
  } else {
@@ -13795,9 +13800,14 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
13795
13800
  const typeArguments = dirRef.node.typeParameters.map(() => ts60.factory.createKeywordTypeNode(ts60.SyntaxKind.AnyKeyword));
13796
13801
  type = ts60.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
13797
13802
  }
13803
+ if (this.node instanceof TmplAstHostElement2) {
13804
+ span = this.node.sourceSpan;
13805
+ } else {
13806
+ span = this.node.startSourceSpan || this.node.sourceSpan;
13807
+ }
13798
13808
  const id = this.tcb.allocateId();
13799
13809
  addExpressionIdentifier(id, ExpressionIdentifier.DIRECTIVE);
13800
- addParseSpanInfo(id, this.node.startSourceSpan || this.node.sourceSpan);
13810
+ addParseSpanInfo(id, span);
13801
13811
  this.scope.addStatement(tsDeclareVariable(id, type));
13802
13812
  return id;
13803
13813
  }
@@ -14257,12 +14267,16 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
14257
14267
  tcb;
14258
14268
  scope;
14259
14269
  node;
14270
+ inputs;
14271
+ outputs;
14260
14272
  dir;
14261
- constructor(tcb, scope, node, dir) {
14273
+ constructor(tcb, scope, node, inputs, outputs, dir) {
14262
14274
  super();
14263
14275
  this.tcb = tcb;
14264
14276
  this.scope = scope;
14265
14277
  this.node = node;
14278
+ this.inputs = inputs;
14279
+ this.outputs = outputs;
14266
14280
  this.dir = dir;
14267
14281
  }
14268
14282
  get optional() {
@@ -14271,13 +14285,13 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
14271
14285
  execute() {
14272
14286
  let dirId = null;
14273
14287
  const outputs = this.dir.outputs;
14274
- for (const output of this.node.outputs) {
14288
+ for (const output of this.outputs) {
14275
14289
  if (output.type === ParsedEventType2.LegacyAnimation || !outputs.hasBindingPropertyName(output.name)) {
14276
14290
  continue;
14277
14291
  }
14278
- if (this.tcb.env.config.checkTypeOfOutputEvents && output.name.endsWith("Change")) {
14292
+ if (this.tcb.env.config.checkTypeOfOutputEvents && this.inputs !== null && output.name.endsWith("Change")) {
14279
14293
  const inputName = output.name.slice(0, -6);
14280
- checkSplitTwoWayBinding(inputName, output, this.node.inputs, this.tcb);
14294
+ checkSplitTwoWayBinding(inputName, output, this.inputs, this.tcb);
14281
14295
  }
14282
14296
  const field = outputs.getByBindingPropertyName(output.name)[0].classPropertyName;
14283
14297
  if (dirId === null) {
@@ -14881,7 +14895,7 @@ var Scope = class _Scope {
14881
14895
  return typeof opIndexOrNode === "number" ? this.resolveOp(opIndexOrNode) : opIndexOrNode;
14882
14896
  } else if (ref instanceof TmplAstTemplate && directive === void 0 && this.templateCtxOpMap.has(ref)) {
14883
14897
  return this.resolveOp(this.templateCtxOpMap.get(ref));
14884
- } else if ((ref instanceof TmplAstElement2 || ref instanceof TmplAstTemplate || ref instanceof TmplAstComponent2 || ref instanceof TmplAstDirective2) && directive !== void 0 && this.directiveOpMap.has(ref)) {
14898
+ } else if ((ref instanceof TmplAstElement2 || ref instanceof TmplAstTemplate || ref instanceof TmplAstComponent2 || ref instanceof TmplAstDirective2 || ref instanceof TmplAstHostElement2) && directive !== void 0 && this.directiveOpMap.has(ref)) {
14885
14899
  const dirMap = this.directiveOpMap.get(ref);
14886
14900
  return dirMap.has(directive) ? this.resolveOp(dirMap.get(directive)) : null;
14887
14901
  } else if (ref instanceof TmplAstElement2 && this.elementOpMap.has(ref)) {
@@ -14936,13 +14950,13 @@ var Scope = class _Scope {
14936
14950
  this.appendContentProjectionCheckOp(node);
14937
14951
  }
14938
14952
  this.appendDirectivesAndInputsOfElementLikeNode(node);
14939
- this.appendOutputsOfElementLikeNode(node);
14953
+ this.appendOutputsOfElementLikeNode(node, node.inputs, node.outputs);
14940
14954
  this.appendSelectorlessDirectives(node);
14941
14955
  this.appendChildren(node);
14942
14956
  this.checkAndAppendReferencesOfNode(node);
14943
14957
  } else if (node instanceof TmplAstTemplate) {
14944
14958
  this.appendDirectivesAndInputsOfElementLikeNode(node);
14945
- this.appendOutputsOfElementLikeNode(node);
14959
+ this.appendOutputsOfElementLikeNode(node, node.inputs, node.outputs);
14946
14960
  this.appendSelectorlessDirectives(node);
14947
14961
  const ctxIndex = this.opQueue.push(new TcbTemplateContextOp(this.tcb, this)) - 1;
14948
14962
  this.templateCtxOpMap.set(node, ctxIndex);
@@ -14977,9 +14991,7 @@ var Scope = class _Scope {
14977
14991
  this.letDeclOpMap.set(node.name, { opIndex, node });
14978
14992
  }
14979
14993
  } else if (node instanceof TmplAstHostElement2) {
14980
- const opIndex = this.opQueue.push(new TcbHostElementOp(this.tcb, this, node)) - 1;
14981
- this.hostElementOpMap.set(node, opIndex);
14982
- this.opQueue.push(new TcbUnclaimedInputsOp(this.tcb, this, node.bindings, node, null), new TcbUnclaimedOutputsOp(this.tcb, this, node, node.listeners, null, null), new TcbDomSchemaCheckerOp(this.tcb, node, false, null));
14994
+ this.appendHostElement(node);
14983
14995
  }
14984
14996
  }
14985
14997
  appendChildren(node) {
@@ -15039,25 +15051,25 @@ var Scope = class _Scope {
15039
15051
  this.opQueue.push(new TcbDomSchemaCheckerOp(this.tcb, node, checkElement, claimedInputs));
15040
15052
  }
15041
15053
  }
15042
- appendOutputsOfElementLikeNode(node) {
15054
+ appendOutputsOfElementLikeNode(node, bindings, events) {
15043
15055
  const claimedOutputs = /* @__PURE__ */ new Set();
15044
15056
  const directives = this.tcb.boundTarget.getDirectivesOfNode(node);
15045
15057
  if (directives === null || directives.length === 0) {
15046
15058
  if (node instanceof TmplAstElement2) {
15047
- this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, node.outputs, node.inputs, claimedOutputs));
15059
+ this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, events, bindings, claimedOutputs));
15048
15060
  }
15049
15061
  return;
15050
15062
  }
15051
15063
  for (const dir of directives) {
15052
- this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, dir));
15064
+ this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, bindings, events, dir));
15053
15065
  }
15054
- if (node instanceof TmplAstElement2) {
15066
+ if (node instanceof TmplAstElement2 || node instanceof TmplAstHostElement2) {
15055
15067
  for (const dir of directives) {
15056
15068
  for (const outputProperty of dir.outputs.propertyNames) {
15057
15069
  claimedOutputs.add(outputProperty);
15058
15070
  }
15059
15071
  }
15060
- this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, node.outputs, node.inputs, claimedOutputs));
15072
+ this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, events, bindings, claimedOutputs));
15061
15073
  }
15062
15074
  }
15063
15075
  appendInputsOfSelectorlessNode(node) {
@@ -15094,7 +15106,7 @@ var Scope = class _Scope {
15094
15106
  const claimedOutputs = /* @__PURE__ */ new Set();
15095
15107
  if (directives !== null && directives.length > 0) {
15096
15108
  for (const dir of directives) {
15097
- this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, dir));
15109
+ this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, node.inputs, node.outputs, dir));
15098
15110
  for (const outputProperty of dir.outputs.propertyNames) {
15099
15111
  claimedOutputs.add(outputProperty);
15100
15112
  }
@@ -15243,6 +15255,21 @@ var Scope = class _Scope {
15243
15255
  this.validateReferenceBasedDeferredTrigger(block, triggers.viewport);
15244
15256
  }
15245
15257
  }
15258
+ appendHostElement(node) {
15259
+ const opIndex = this.opQueue.push(new TcbHostElementOp(this.tcb, this, node)) - 1;
15260
+ const directives = this.tcb.boundTarget.getDirectivesOfNode(node);
15261
+ if (directives !== null && directives.length > 0) {
15262
+ const directiveOpMap = /* @__PURE__ */ new Map();
15263
+ for (const directive of directives) {
15264
+ const directiveOp = new TcbNonGenericDirectiveTypeOp(this.tcb, this, node, directive);
15265
+ directiveOpMap.set(directive, this.opQueue.push(directiveOp) - 1);
15266
+ }
15267
+ this.directiveOpMap.set(node, directiveOpMap);
15268
+ }
15269
+ this.hostElementOpMap.set(node, opIndex);
15270
+ this.opQueue.push(new TcbUnclaimedInputsOp(this.tcb, this, node.bindings, node, null), new TcbDomSchemaCheckerOp(this.tcb, node, false, null));
15271
+ this.appendOutputsOfElementLikeNode(node, null, node.listeners);
15272
+ }
15246
15273
  validateReferenceBasedDeferredTrigger(block, trigger) {
15247
15274
  if (trigger.reference === null) {
15248
15275
  if (block.placeholder === null) {
@@ -15709,7 +15736,10 @@ var TypeCheckContextImpl = class {
15709
15736
  }
15710
15737
  const boundTarget = binder.bind({
15711
15738
  template: templateContext?.nodes,
15712
- host: hostBindingContext?.node
15739
+ host: hostBindingContext === null ? void 0 : {
15740
+ node: hostBindingContext.node,
15741
+ directives: hostBindingContext.directives
15742
+ }
15713
15743
  });
15714
15744
  if (this.inlining === InliningMode.InlineOps) {
15715
15745
  for (const dir of boundTarget.getUsedDirectives()) {
@@ -17773,11 +17803,11 @@ function getClassDeclFromSymbol(symbol, checker) {
17773
17803
  return null;
17774
17804
  }
17775
17805
  if (ts64.isExportAssignment(decl)) {
17776
- const symbol2 = checker.getTypeAtLocation(decl.expression).symbol;
17806
+ const symbol2 = checker.getTypeAtLocation(decl.expression).getSymbol();
17777
17807
  return getClassDeclFromSymbol(symbol2, checker);
17778
17808
  }
17779
17809
  if (ts64.isExportSpecifier(decl)) {
17780
- const symbol2 = checker.getTypeAtLocation(decl).symbol;
17810
+ const symbol2 = checker.getTypeAtLocation(decl).getSymbol();
17781
17811
  return getClassDeclFromSymbol(symbol2, checker);
17782
17812
  }
17783
17813
  if (isNamedClassDeclaration(decl)) {
@@ -17807,7 +17837,7 @@ function getTheElementTagDeprecatedSuggestionDiagnostics(shimPath, program, file
17807
17837
  for (const tsDiag of diags) {
17808
17838
  const diagNode = getTokenAtPosition(sourceFile, tsDiag.start);
17809
17839
  const nodeType = typeChecker.getTypeAtLocation(diagNode);
17810
- const nodeSymbolDeclarations = nodeType.symbol.declarations;
17840
+ const nodeSymbolDeclarations = nodeType.getSymbol()?.declarations;
17811
17841
  const decl = nodeSymbolDeclarations !== void 0 && nodeSymbolDeclarations.length > 0 ? nodeSymbolDeclarations[0] : void 0;
17812
17842
  if (decl === void 0 || !ts64.isClassDeclaration(decl)) {
17813
17843
  continue;
@@ -17824,7 +17854,7 @@ function getTheElementTagDeprecatedSuggestionDiagnostics(shimPath, program, file
17824
17854
  const templateDiagnostics = [];
17825
17855
  for (const directive of directiveNodesInTcb) {
17826
17856
  const directiveType = typeChecker.getTypeAtLocation(directive);
17827
- const directiveSymbolDeclarations = directiveType.symbol.declarations;
17857
+ const directiveSymbolDeclarations = directiveType.getSymbol()?.declarations;
17828
17858
  const decl = directiveSymbolDeclarations !== void 0 && directiveSymbolDeclarations.length > 0 ? directiveSymbolDeclarations[0] : void 0;
17829
17859
  if (decl === void 0) {
17830
17860
  continue;
@@ -18060,18 +18090,20 @@ var DirectiveDecoratorHandler = class {
18060
18090
  if (!ts65.isClassDeclaration(node) || meta.isPoisoned && !this.usePoisonedData) {
18061
18091
  return;
18062
18092
  }
18063
- const scope = this.typeCheckScopeRegistry.getTypeCheckScope(node);
18093
+ const ref = new Reference(node);
18094
+ const scope = this.typeCheckScopeRegistry.getTypeCheckScope(ref);
18064
18095
  if (scope.isPoisoned && !this.usePoisonedData) {
18065
18096
  return;
18066
18097
  }
18067
18098
  const hostElement = createHostElement("directive", meta.meta.selector, node, meta.hostBindingNodes.literal, meta.hostBindingNodes.bindingDecorators, meta.hostBindingNodes.listenerDecorators);
18068
- if (hostElement !== null) {
18099
+ if (hostElement !== null && scope.directivesOnHost !== null) {
18069
18100
  const binder = new R3TargetBinder(scope.matcher);
18070
18101
  const hostBindingsContext = {
18071
18102
  node: hostElement,
18103
+ directives: scope.directivesOnHost,
18072
18104
  sourceMapping: { type: "direct", node }
18073
18105
  };
18074
- ctx.addDirective(new Reference(node), binder, scope.schemas, null, hostBindingsContext, meta.meta.isStandalone);
18106
+ ctx.addDirective(ref, binder, scope.schemas, null, hostBindingsContext, meta.meta.isStandalone);
18075
18107
  }
18076
18108
  }
18077
18109
  resolve(node, analysis, symbol) {
@@ -20189,7 +20221,7 @@ var ComponentDecoratorHandler = class {
20189
20221
  diagnostics.push(makeResourceNotFoundError(styleUrl.url, styleUrl.expression, resourceType).toDiagnostic());
20190
20222
  }
20191
20223
  }
20192
- if (encapsulation === ViewEncapsulation2.ShadowDom && metadata.selector !== null) {
20224
+ if ((encapsulation === ViewEncapsulation2.ShadowDom || encapsulation === ViewEncapsulation2.IsolatedShadowDom) && metadata.selector !== null) {
20193
20225
  const selectorError = checkCustomElementSelectorForErrors(metadata.selector);
20194
20226
  if (selectorError !== null) {
20195
20227
  if (diagnostics === void 0) {
@@ -20379,7 +20411,8 @@ var ComponentDecoratorHandler = class {
20379
20411
  if (!ts73.isClassDeclaration(node) || meta.isPoisoned && !this.usePoisonedData) {
20380
20412
  return;
20381
20413
  }
20382
- const scope = this.typeCheckScopeRegistry.getTypeCheckScope(node);
20414
+ const ref = new Reference(node);
20415
+ const scope = this.typeCheckScopeRegistry.getTypeCheckScope(ref);
20383
20416
  if (scope.isPoisoned && !this.usePoisonedData) {
20384
20417
  return;
20385
20418
  }
@@ -20393,11 +20426,12 @@ var ComponentDecoratorHandler = class {
20393
20426
  preserveWhitespaces: meta.meta.template.preserveWhitespaces ?? false
20394
20427
  };
20395
20428
  const hostElement = this.typeCheckHostBindings ? createHostElement("component", meta.meta.selector, node, meta.hostBindingNodes.literal, meta.hostBindingNodes.bindingDecorators, meta.hostBindingNodes.listenerDecorators) : null;
20396
- const hostBindingsContext = hostElement === null ? null : {
20429
+ const hostBindingsContext = hostElement === null || scope.directivesOnHost === null ? null : {
20397
20430
  node: hostElement,
20431
+ directives: scope.directivesOnHost,
20398
20432
  sourceMapping: { type: "direct", node }
20399
20433
  };
20400
- ctx.addDirective(new Reference(node), binder, scope.schemas, templateContext, hostBindingsContext, meta.meta.isStandalone);
20434
+ ctx.addDirective(ref, binder, scope.schemas, templateContext, hostBindingsContext, meta.meta.isStandalone);
20401
20435
  }
20402
20436
  extendedTemplateCheck(component, extendedTemplateChecker) {
20403
20437
  return extendedTemplateChecker.getDiagnosticsForComponent(component);
@@ -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.2.0-next.3";
458
+ var PLACEHOLDER_VERSION = "20.2.0-next.5";
459
459
  function wrapReference(wrapped) {
460
460
  return { value: wrapped, type: wrapped };
461
461
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "./chunk-56QTHZ7G.js";
7
+ } from "./chunk-WLT4GJPA.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-5LTXARS2.js";
95
+ } from "./chunk-7DWCEZ6T.js";
96
96
  import {
97
97
  LogicalFileSystem,
98
98
  absoluteFrom,
@@ -12,7 +12,7 @@ import {
12
12
  formatDiagnostics,
13
13
  performCompilation,
14
14
  readConfiguration
15
- } from "./chunk-ILJUWTJN.js";
15
+ } from "./chunk-EVMG2NVT.js";
16
16
 
17
17
  // packages/compiler-cli/src/main.js
18
18
  import ts2 from "typescript";
@@ -16,7 +16,7 @@ import {
16
16
  tryParseSignalInputMapping,
17
17
  tryParseSignalModelMapping,
18
18
  tryParseSignalQueryFromInitializer
19
- } from "./chunk-5LTXARS2.js";
19
+ } from "./chunk-7DWCEZ6T.js";
20
20
 
21
21
  // packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.js
22
22
  import ts from "typescript";
package/bundles/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  isTsDiagnostic,
29
29
  performCompilation,
30
30
  readConfiguration
31
- } from "./chunk-ILJUWTJN.js";
31
+ } from "./chunk-EVMG2NVT.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-56QTHZ7G.js";
40
+ } from "./chunk-WLT4GJPA.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-5LTXARS2.js";
49
+ } from "./chunk-7DWCEZ6T.js";
50
50
  import "./chunk-I2BHWRAU.js";
51
51
  import {
52
52
  InvalidFileSystem,
@@ -77,7 +77,7 @@ import "./chunk-DWRM7PIK.js";
77
77
 
78
78
  // packages/compiler-cli/src/version.js
79
79
  import { Version } from "@angular/compiler";
80
- var VERSION = new Version("20.2.0-next.3");
80
+ var VERSION = new Version("20.2.0-next.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-5LTXARS2.js";
16
+ } from "../chunk-7DWCEZ6T.js";
17
17
  import "../chunk-I2BHWRAU.js";
18
18
  import "../chunk-GWZQLAGK.js";
19
19
  import "../chunk-SZY7NM6F.js";
@@ -4,8 +4,8 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "../chunk-56QTHZ7G.js";
8
- import "../chunk-5LTXARS2.js";
7
+ } from "../chunk-WLT4GJPA.js";
8
+ import "../chunk-7DWCEZ6T.js";
9
9
  import "../chunk-I2BHWRAU.js";
10
10
  import "../chunk-GWZQLAGK.js";
11
11
  import "../chunk-SZY7NM6F.js";
@@ -6,12 +6,12 @@
6
6
  import {
7
7
  main,
8
8
  readCommandLineAndConfiguration
9
- } from "../../chunk-HMCJWY2O.js";
9
+ } from "../../chunk-O4DJC7UC.js";
10
10
  import {
11
11
  EmitFlags
12
- } from "../../chunk-ILJUWTJN.js";
13
- import "../../chunk-56QTHZ7G.js";
14
- import "../../chunk-5LTXARS2.js";
12
+ } from "../../chunk-EVMG2NVT.js";
13
+ import "../../chunk-WLT4GJPA.js";
14
+ import "../../chunk-7DWCEZ6T.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-HMCJWY2O.js";
9
- import "../../chunk-ILJUWTJN.js";
10
- import "../../chunk-56QTHZ7G.js";
11
- import "../../chunk-5LTXARS2.js";
8
+ } from "../../chunk-O4DJC7UC.js";
9
+ import "../../chunk-EVMG2NVT.js";
10
+ import "../../chunk-WLT4GJPA.js";
11
+ import "../../chunk-7DWCEZ6T.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.2.0-next.3";
10
+ export declare const PLACEHOLDER_VERSION = "20.2.0-next.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.2.0-next.3",
3
+ "version": "20.2.0-next.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.2.0-next.3",
51
+ "@angular/compiler": "20.2.0-next.5",
52
52
  "typescript": ">=5.8 <6.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
@@ -36,6 +36,10 @@ export interface TypeCheckScope {
36
36
  * (contained semantic errors during its production).
37
37
  */
38
38
  isPoisoned: boolean;
39
+ /**
40
+ * Directives that have been set on the host of the scope.
41
+ */
42
+ directivesOnHost: DirectiveMeta[] | null;
39
43
  }
40
44
  /**
41
45
  * Computes scope information to be used in template type checking.
@@ -59,9 +63,10 @@ export declare class TypeCheckScopeRegistry {
59
63
  * contains an error, then 'error' is returned. If the component is not declared in any NgModule,
60
64
  * an empty type-check scope is returned.
61
65
  */
62
- getTypeCheckScope(node: ClassDeclaration): TypeCheckScope;
66
+ getTypeCheckScope(ref: Reference<ClassDeclaration>): TypeCheckScope;
63
67
  getTypeCheckDirectiveMetadata(ref: Reference<ClassDeclaration>): DirectiveMeta | null;
64
68
  private applyExplicitlyDeferredFlag;
65
69
  private getSelectorMatcher;
66
70
  private getSelectorlessMatcher;
71
+ private combineWithHostDirectives;
67
72
  }
@@ -8,7 +8,7 @@
8
8
  import { ParseError, ParseSourceFile, R3TargetBinder, SchemaMetadata, TmplAstHostElement, TmplAstNode } from '@angular/compiler';
9
9
  import ts from 'typescript';
10
10
  import { Reference } from '../../imports';
11
- import { PipeMeta } from '../../metadata';
11
+ import { DirectiveMeta, PipeMeta } from '../../metadata';
12
12
  import { ClassDeclaration } from '../../reflection';
13
13
  import { SourceMapping, TypeCheckableDirectiveMeta } from './api';
14
14
  /** Contextuable data for type checking the template of a component. */
@@ -30,6 +30,8 @@ export interface TemplateContext {
30
30
  export interface HostBindingsContext {
31
31
  /** AST node representing the host element of the directive. */
32
32
  node: TmplAstHostElement;
33
+ /** Directives present on the host element. */
34
+ directives: DirectiveMeta[];
33
35
  /** Describes the source of the host bindings. Used for mapping errors back. */
34
36
  sourceMapping: SourceMapping;
35
37
  }
@@ -5,7 +5,7 @@
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 { BoundTarget, SchemaMetadata, TmplAstElement, TmplAstForLoopBlock, TmplAstIfBlockBranch, TmplAstLetDeclaration, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable, TmplAstHostElement, TmplAstComponent, TmplAstDirective } from '@angular/compiler';
8
+ import { BoundTarget, SchemaMetadata, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstForLoopBlock, TmplAstIfBlockBranch, TmplAstLetDeclaration, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable, TmplAstHostElement, TmplAstComponent, TmplAstDirective, DirectiveOwner } from '@angular/compiler';
9
9
  import ts from 'typescript';
10
10
  import { Reference } from '../../imports';
11
11
  import { PipeMeta } from '../../metadata';
@@ -111,8 +111,10 @@ export declare class TcbDirectiveOutputsOp extends TcbOp {
111
111
  private tcb;
112
112
  private scope;
113
113
  private node;
114
+ private inputs;
115
+ private outputs;
114
116
  private dir;
115
- constructor(tcb: Context, scope: Scope, node: TmplAstTemplate | TmplAstElement | TmplAstComponent | TmplAstDirective, dir: TypeCheckableDirectiveMeta);
117
+ constructor(tcb: Context, scope: Scope, node: DirectiveOwner, inputs: TmplAstBoundAttribute[] | null, outputs: TmplAstBoundEvent[], dir: TypeCheckableDirectiveMeta);
116
118
  get optional(): boolean;
117
119
  execute(): null;
118
120
  }
@@ -301,6 +303,7 @@ declare class Scope {
301
303
  private appendComponentNode;
302
304
  private appendDeferredBlock;
303
305
  private appendDeferredTriggers;
306
+ private appendHostElement;
304
307
  private validateReferenceBasedDeferredTrigger;
305
308
  /** Reports a diagnostic if there are any `@let` declarations that conflict with a node. */
306
309
  private static checkConflictingLet;