@angular/core 20.0.0-next.7 → 20.0.0-next.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/{api.d-KjtSQajV.d.ts → api.d-B58KU5QT.d.ts} +25 -40
  2. package/chrome_dev_tools_performance.d-qv7drdAl.d.ts +1 -1
  3. package/{discovery.d-D6xf1HH-.d.ts → discovery.d-BCmtv8-u.d.ts} +21 -7
  4. package/event_dispatcher.d-DlbccpYq.d.ts +1 -1
  5. package/fesm2022/attribute-BWp59EjE.mjs +1 -1
  6. package/fesm2022/core.mjs +60 -159
  7. package/fesm2022/core.mjs.map +1 -1
  8. package/fesm2022/{debug_node-B3CixwNH.mjs → debug_node-sP8Ihhla.mjs} +191 -56
  9. package/fesm2022/debug_node-sP8Ihhla.mjs.map +1 -0
  10. package/fesm2022/primitives/di.mjs +1 -1
  11. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  12. package/fesm2022/primitives/signals.mjs +4 -4
  13. package/fesm2022/{resource-DtpS_sTw.mjs → resource-aJC_NNLX.mjs} +29 -76
  14. package/fesm2022/resource-aJC_NNLX.mjs.map +1 -0
  15. package/fesm2022/{root_effect_scheduler-BK3l7wIO.mjs → root_effect_scheduler-C95A9imp.mjs} +25 -10
  16. package/fesm2022/root_effect_scheduler-C95A9imp.mjs.map +1 -0
  17. package/fesm2022/rxjs-interop.mjs +12 -7
  18. package/fesm2022/rxjs-interop.mjs.map +1 -1
  19. package/fesm2022/{signal-B6pMq7KS.mjs → signal-CVVPheSN.mjs} +13 -3
  20. package/fesm2022/{signal-B6pMq7KS.mjs.map → signal-CVVPheSN.mjs.map} +1 -1
  21. package/fesm2022/testing.mjs +40 -21
  22. package/fesm2022/testing.mjs.map +1 -1
  23. package/fesm2022/{untracked-Bz5WMeU1.mjs → untracked-BLZYODu2.mjs} +3 -3
  24. package/fesm2022/{untracked-Bz5WMeU1.mjs.map → untracked-BLZYODu2.mjs.map} +1 -1
  25. package/fesm2022/weak_ref-BaIq-pgY.mjs +1 -1
  26. package/graph.d-BcIOep_B.d.ts +1 -1
  27. package/index.d.ts +190 -127
  28. package/package.json +2 -2
  29. package/primitives/di/index.d.ts +1 -1
  30. package/primitives/event-dispatch/index.d.ts +1 -1
  31. package/primitives/signals/index.d.ts +3 -3
  32. package/rxjs-interop/index.d.ts +4 -4
  33. package/schematics/bundles/{apply_import_manager-DczRKpTm.js → apply_import_manager-CxaTw_Wy.js} +3 -3
  34. package/schematics/bundles/{change_tracker-CWLh-wes.js → change_tracker-CkPYZ_km.js} +3 -3
  35. package/schematics/bundles/{checker-_f5wM7PH.js → checker-Crz1jSZM.js} +389 -122
  36. package/schematics/bundles/cleanup-unused-imports.js +6 -6
  37. package/schematics/bundles/{compiler-BaCbbux6.js → compiler-B4MK7BP9.js} +193 -88
  38. package/schematics/bundles/compiler_host-CAfDJO3W.js +1 -1
  39. package/schematics/bundles/control-flow-migration.js +2 -2
  40. package/schematics/bundles/document-core.js +6 -6
  41. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  42. package/schematics/bundles/{index--W6S49uu.js → index-BbZ6cSR1.js} +6 -5
  43. package/schematics/bundles/{index-rsJ8I_hu.js → index-Bk_3geTg.js} +463 -327
  44. package/schematics/bundles/inject-flags.js +6 -6
  45. package/schematics/bundles/inject-migration.js +14 -11
  46. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  47. package/schematics/bundles/{migrate_ts_type_references-C4D_SzJk.js → migrate_ts_type_references-D6T3FlkH.js} +7 -6
  48. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  49. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  50. package/schematics/bundles/output-migration.js +7 -7
  51. package/schematics/bundles/{project_paths-Ce0O2u-M.js → project_paths-CQ4-VKlW.js} +4 -4
  52. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  53. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  54. package/schematics/bundles/route-lazy-loading.js +4 -4
  55. package/schematics/bundles/self-closing-tags-migration.js +5 -5
  56. package/schematics/bundles/signal-input-migration.js +8 -8
  57. package/schematics/bundles/signal-queries-migration.js +8 -8
  58. package/schematics/bundles/signals.js +8 -8
  59. package/schematics/bundles/standalone-migration.js +5 -5
  60. package/schematics/bundles/symbol-VPWguRxr.js +1 -1
  61. package/schematics/bundles/test-bed-get.js +5 -5
  62. package/{signal.d-E0e5nW1p.d.ts → signal.d-D6VJ67xi.d.ts} +8 -2
  63. package/testing/index.d.ts +12 -9
  64. package/weak_ref.d-eGOEP9S1.d.ts +1 -1
  65. package/fesm2022/debug_node-B3CixwNH.mjs.map +0 -1
  66. package/fesm2022/resource-DtpS_sTw.mjs.map +0 -1
  67. package/fesm2022/root_effect_scheduler-BK3l7wIO.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.7
3
+ * @license Angular v20.0.0-next.9
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,14 +8,14 @@
8
8
 
9
9
  require('@angular-devkit/core');
10
10
  require('node:path/posix');
11
- var project_paths = require('./project_paths-Ce0O2u-M.js');
11
+ var project_paths = require('./project_paths-CQ4-VKlW.js');
12
12
  var ts = require('typescript');
13
13
  require('os');
14
- var checker = require('./checker-_f5wM7PH.js');
15
- require('./compiler-BaCbbux6.js');
16
- var index = require('./index-rsJ8I_hu.js');
14
+ var checker = require('./checker-Crz1jSZM.js');
15
+ require('./compiler-B4MK7BP9.js');
16
+ var index = require('./index-Bk_3geTg.js');
17
17
  require('path');
18
- var apply_import_manager = require('./apply_import_manager-DczRKpTm.js');
18
+ var apply_import_manager = require('./apply_import_manager-CxaTw_Wy.js');
19
19
  require('@angular-devkit/schematics');
20
20
  require('./project_tsconfig_paths-CDVxT6Ov.js');
21
21
  require('fs');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.7
3
+ * @license Angular v20.0.0-next.9
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -399,6 +399,15 @@ class SelectorContext {
399
399
  return result;
400
400
  }
401
401
  }
402
+ class SelectorlessMatcher {
403
+ registry;
404
+ constructor(registry) {
405
+ this.registry = registry;
406
+ }
407
+ match(name) {
408
+ return this.registry.has(name) ? this.registry.get(name) : [];
409
+ }
410
+ }
402
411
 
403
412
  // Attention:
404
413
  // This file duplicates types and values from @angular/core
@@ -895,6 +904,7 @@ exports.BinaryOperator = void 0;
895
904
  BinaryOperator[BinaryOperator["BiggerEquals"] = 16] = "BiggerEquals";
896
905
  BinaryOperator[BinaryOperator["NullishCoalesce"] = 17] = "NullishCoalesce";
897
906
  BinaryOperator[BinaryOperator["Exponentiation"] = 18] = "Exponentiation";
907
+ BinaryOperator[BinaryOperator["In"] = 19] = "In";
898
908
  })(exports.BinaryOperator || (exports.BinaryOperator = {}));
899
909
  function nullSafeIsEquivalent(base, other) {
900
910
  if (base == null || other == null) {
@@ -3682,6 +3692,9 @@ class AbstractEmitterVisitor {
3682
3692
  case exports.BinaryOperator.NullishCoalesce:
3683
3693
  opStr = '??';
3684
3694
  break;
3695
+ case exports.BinaryOperator.In:
3696
+ opStr = 'in';
3697
+ break;
3685
3698
  default:
3686
3699
  throw new Error(`Unknown operator ${ast.operator}`);
3687
3700
  }
@@ -12038,6 +12051,7 @@ const BINARY_OPERATORS = new Map([
12038
12051
  ['??', exports.BinaryOperator.NullishCoalesce],
12039
12052
  ['||', exports.BinaryOperator.Or],
12040
12053
  ['+', exports.BinaryOperator.Plus],
12054
+ ['in', exports.BinaryOperator.In],
12041
12055
  ]);
12042
12056
  function namespaceForKey(namespacePrefixKey) {
12043
12057
  const NAMESPACES = new Map([
@@ -18102,6 +18116,7 @@ const KEYWORDS = [
18102
18116
  'this',
18103
18117
  'typeof',
18104
18118
  'void',
18119
+ 'in',
18105
18120
  ];
18106
18121
  class Lexer {
18107
18122
  tokenize(text) {
@@ -18169,6 +18184,9 @@ class Token {
18169
18184
  isKeywordVoid() {
18170
18185
  return this.type === TokenType.Keyword && this.strValue === 'void';
18171
18186
  }
18187
+ isKeywordIn() {
18188
+ return this.type === TokenType.Keyword && this.strValue === 'in';
18189
+ }
18172
18190
  isError() {
18173
18191
  return this.type === TokenType.Error;
18174
18192
  }
@@ -19212,16 +19230,17 @@ class _ParseAST {
19212
19230
  return result;
19213
19231
  }
19214
19232
  parseRelational() {
19215
- // '<', '>', '<=', '>='
19233
+ // '<', '>', '<=', '>=', 'in'
19216
19234
  const start = this.inputIndex;
19217
19235
  let result = this.parseAdditive();
19218
- while (this.next.type == TokenType.Operator) {
19236
+ while (this.next.type == TokenType.Operator || this.next.isKeywordIn) {
19219
19237
  const operator = this.next.strValue;
19220
19238
  switch (operator) {
19221
19239
  case '<':
19222
19240
  case '>':
19223
19241
  case '<=':
19224
19242
  case '>=':
19243
+ case 'in':
19225
19244
  this.advance();
19226
19245
  const right = this.parseAdditive();
19227
19246
  result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
@@ -19384,6 +19403,10 @@ class _ParseAST {
19384
19403
  this.advance();
19385
19404
  return new LiteralPrimitive(this.span(start), this.sourceSpan(start), false);
19386
19405
  }
19406
+ else if (this.next.isKeywordIn()) {
19407
+ this.advance();
19408
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), 'in');
19409
+ }
19387
19410
  else if (this.next.isKeywordThis()) {
19388
19411
  this.advance();
19389
19412
  return new ThisReceiver(this.span(start), this.sourceSpan(start));
@@ -26281,6 +26304,7 @@ function ingestNodes(unit, template) {
26281
26304
  else if (node instanceof LetDeclaration$1) {
26282
26305
  ingestLetDeclaration(unit, node);
26283
26306
  }
26307
+ else if (node instanceof Component$1) ;
26284
26308
  else {
26285
26309
  throw new Error(`Unsupported template node: ${node.constructor.name}`);
26286
26310
  }
@@ -29126,6 +29150,7 @@ class HtmlAstToIvyAst {
29126
29150
  return null;
29127
29151
  }
29128
29152
  const { attributes, boundEvents, references, templateVariables, elementHasInlineTemplate, parsedProperties, templateParsedProperties, i18nAttrsMeta, } = this.prepareAttributes(component.attrs, false);
29153
+ this.validateSelectorlessReferences(references);
29129
29154
  const directives = this.extractDirectives(component);
29130
29155
  let children;
29131
29156
  if (component.attrs.find((attr) => attr.name === 'ngNonBindable')) {
@@ -29428,6 +29453,7 @@ class HtmlAstToIvyAst {
29428
29453
  continue;
29429
29454
  }
29430
29455
  const { attributes, parsedProperties, boundEvents, references, i18nAttrsMeta } = this.prepareAttributes(directive.attrs, false);
29456
+ this.validateSelectorlessReferences(references);
29431
29457
  const { bound: inputs } = this.categorizePropertyAttributes(elementName, parsedProperties, i18nAttrsMeta);
29432
29458
  for (const input of inputs) {
29433
29459
  if (input.type !== exports.BindingType.Property && input.type !== exports.BindingType.TwoWay) {
@@ -29511,6 +29537,23 @@ class HtmlAstToIvyAst {
29511
29537
  /* isAssignmentEvent */ true, sourceSpan, valueSpan || sourceSpan, targetMatchableAttrs, events, keySpan);
29512
29538
  addEvents(events, boundEvents);
29513
29539
  }
29540
+ validateSelectorlessReferences(references) {
29541
+ if (references.length === 0) {
29542
+ return;
29543
+ }
29544
+ const seenNames = new Set();
29545
+ for (const ref of references) {
29546
+ if (ref.value.length > 0) {
29547
+ this.reportError('Cannot specify a value for a local reference in this context', ref.valueSpan || ref.sourceSpan);
29548
+ }
29549
+ else if (seenNames.has(ref.name)) {
29550
+ this.reportError('Duplicate reference names are not allowed', ref.sourceSpan);
29551
+ }
29552
+ else {
29553
+ seenNames.add(ref.name);
29554
+ }
29555
+ }
29556
+ }
29514
29557
  reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {
29515
29558
  this.errors.push(new ParseError(sourceSpan, message, level));
29516
29559
  }
@@ -29612,6 +29655,7 @@ function parseTemplate(template, templateUrl, options = {}) {
29612
29655
  tokenizeExpansionForms: true,
29613
29656
  tokenizeBlocks: options.enableBlockSyntax ?? true,
29614
29657
  tokenizeLet: options.enableLetSyntax ?? true,
29658
+ selectorlessEnabled: options.enableSelectorless ?? false,
29615
29659
  });
29616
29660
  if (!options.alwaysAttemptHtmlToR3AstConversion &&
29617
29661
  parseResult.errors &&
@@ -30241,6 +30285,7 @@ class R3TargetBinder {
30241
30285
  }
30242
30286
  const directives = new Map();
30243
30287
  const eagerDirectives = [];
30288
+ const missingDirectives = new Set();
30244
30289
  const bindings = new Map();
30245
30290
  const references = new Map();
30246
30291
  const scopedNodeEntities = new Map();
@@ -30261,7 +30306,9 @@ class R3TargetBinder {
30261
30306
  // - bindings: Map of inputs, outputs, and attributes to the directive/element that claims
30262
30307
  // them. TODO(alxhub): handle multiple directives claiming an input/output/etc.
30263
30308
  // - references: Map of #references to their targets.
30264
- DirectiveBinder.apply(target.template, this.directiveMatcher, directives, eagerDirectives, bindings, references);
30309
+ if (this.directiveMatcher !== null) {
30310
+ DirectiveBinder.apply(target.template, this.directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references);
30311
+ }
30265
30312
  // Finally, run the TemplateBinder to bind references, variables, and other entities within the
30266
30313
  // template. This extracts all the metadata that doesn't depend on directive matching.
30267
30314
  TemplateBinder.applyWithScope(target.template, scope, expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
@@ -30271,7 +30318,7 @@ class R3TargetBinder {
30271
30318
  if (target.host) {
30272
30319
  TemplateBinder.applyWithScope(target.host, Scope.apply(target.host), expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
30273
30320
  }
30274
- return new R3BoundTarget(target, directives, eagerDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
30321
+ return new R3BoundTarget(target, directives, eagerDirectives, missingDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
30275
30322
  }
30276
30323
  }
30277
30324
  /**
@@ -30289,9 +30336,9 @@ class Scope {
30289
30336
  */
30290
30337
  namedEntities = new Map();
30291
30338
  /**
30292
- * Set of elements that belong to this scope.
30339
+ * Set of element-like nodes that belong to this scope.
30293
30340
  */
30294
- elementsInScope = new Set();
30341
+ elementLikeInScope = new Set();
30295
30342
  /**
30296
30343
  * Child `Scope`s for immediately nested `ScopedNode`s.
30297
30344
  */
@@ -30352,12 +30399,7 @@ class Scope {
30352
30399
  }
30353
30400
  }
30354
30401
  visitElement(element) {
30355
- element.directives.forEach((node) => node.visit(this));
30356
- // `Element`s in the template may have `Reference`s which are captured in the scope.
30357
- element.references.forEach((node) => this.visitReference(node));
30358
- // Recurse into the `Element`'s children.
30359
- element.children.forEach((node) => node.visit(this));
30360
- this.elementsInScope.add(element);
30402
+ this.visitElementLike(element);
30361
30403
  }
30362
30404
  visitTemplate(template) {
30363
30405
  template.directives.forEach((node) => node.visit(this));
@@ -30416,10 +30458,10 @@ class Scope {
30416
30458
  this.maybeDeclare(decl);
30417
30459
  }
30418
30460
  visitComponent(component) {
30419
- throw new Error('TODO');
30461
+ this.visitElementLike(component);
30420
30462
  }
30421
30463
  visitDirective(directive) {
30422
- throw new Error('TODO');
30464
+ directive.references.forEach((current) => this.visitReference(current));
30423
30465
  }
30424
30466
  // Unused visitors.
30425
30467
  visitBoundAttribute(attr) { }
@@ -30430,6 +30472,12 @@ class Scope {
30430
30472
  visitIcu(icu) { }
30431
30473
  visitDeferredTrigger(trigger) { }
30432
30474
  visitUnknownBlock(block) { }
30475
+ visitElementLike(node) {
30476
+ node.directives.forEach((current) => current.visit(this));
30477
+ node.references.forEach((current) => this.visitReference(current));
30478
+ node.children.forEach((current) => current.visit(this));
30479
+ this.elementLikeInScope.add(node);
30480
+ }
30433
30481
  maybeDeclare(thing) {
30434
30482
  // Declare something with a name, as long as that name isn't taken.
30435
30483
  if (!this.namedEntities.has(thing.name)) {
@@ -30479,17 +30527,19 @@ class Scope {
30479
30527
  * Usually used via the static `apply()` method.
30480
30528
  */
30481
30529
  class DirectiveBinder {
30482
- matcher;
30530
+ directiveMatcher;
30483
30531
  directives;
30484
30532
  eagerDirectives;
30533
+ missingDirectives;
30485
30534
  bindings;
30486
30535
  references;
30487
30536
  // Indicates whether we are visiting elements within a `defer` block
30488
30537
  isInDeferBlock = false;
30489
- constructor(matcher, directives, eagerDirectives, bindings, references) {
30490
- this.matcher = matcher;
30538
+ constructor(directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references) {
30539
+ this.directiveMatcher = directiveMatcher;
30491
30540
  this.directives = directives;
30492
30541
  this.eagerDirectives = eagerDirectives;
30542
+ this.missingDirectives = missingDirectives;
30493
30543
  this.bindings = bindings;
30494
30544
  this.references = references;
30495
30545
  }
@@ -30505,8 +30555,8 @@ class DirectiveBinder {
30505
30555
  * map which resolves #references (`Reference`s) within the template to the named directive or
30506
30556
  * template node.
30507
30557
  */
30508
- static apply(template, selectorMatcher, directives, eagerDirectives, bindings, references) {
30509
- const matcher = new DirectiveBinder(selectorMatcher, directives, eagerDirectives, bindings, references);
30558
+ static apply(template, directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references) {
30559
+ const matcher = new DirectiveBinder(directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references);
30510
30560
  matcher.ingest(template);
30511
30561
  }
30512
30562
  ingest(template) {
@@ -30518,23 +30568,113 @@ class DirectiveBinder {
30518
30568
  visitTemplate(template) {
30519
30569
  this.visitElementOrTemplate(template);
30520
30570
  }
30571
+ visitDeferredBlock(deferred) {
30572
+ const wasInDeferBlock = this.isInDeferBlock;
30573
+ this.isInDeferBlock = true;
30574
+ deferred.children.forEach((child) => child.visit(this));
30575
+ this.isInDeferBlock = wasInDeferBlock;
30576
+ deferred.placeholder?.visit(this);
30577
+ deferred.loading?.visit(this);
30578
+ deferred.error?.visit(this);
30579
+ }
30580
+ visitDeferredBlockPlaceholder(block) {
30581
+ block.children.forEach((child) => child.visit(this));
30582
+ }
30583
+ visitDeferredBlockError(block) {
30584
+ block.children.forEach((child) => child.visit(this));
30585
+ }
30586
+ visitDeferredBlockLoading(block) {
30587
+ block.children.forEach((child) => child.visit(this));
30588
+ }
30589
+ visitSwitchBlock(block) {
30590
+ block.cases.forEach((node) => node.visit(this));
30591
+ }
30592
+ visitSwitchBlockCase(block) {
30593
+ block.children.forEach((node) => node.visit(this));
30594
+ }
30595
+ visitForLoopBlock(block) {
30596
+ block.item.visit(this);
30597
+ block.contextVariables.forEach((v) => v.visit(this));
30598
+ block.children.forEach((node) => node.visit(this));
30599
+ block.empty?.visit(this);
30600
+ }
30601
+ visitForLoopBlockEmpty(block) {
30602
+ block.children.forEach((node) => node.visit(this));
30603
+ }
30604
+ visitIfBlock(block) {
30605
+ block.branches.forEach((node) => node.visit(this));
30606
+ }
30607
+ visitIfBlockBranch(block) {
30608
+ block.expressionAlias?.visit(this);
30609
+ block.children.forEach((node) => node.visit(this));
30610
+ }
30611
+ visitContent(content) {
30612
+ content.children.forEach((child) => child.visit(this));
30613
+ }
30614
+ visitComponent(node) {
30615
+ if (this.directiveMatcher instanceof SelectorlessMatcher) {
30616
+ const componentMatches = this.directiveMatcher.match(node.componentName);
30617
+ if (componentMatches.length > 0) {
30618
+ this.trackSelectorlessMatchesAndDirectives(node, componentMatches);
30619
+ }
30620
+ else {
30621
+ this.missingDirectives.add(node.componentName);
30622
+ }
30623
+ }
30624
+ node.directives.forEach((directive) => directive.visit(this));
30625
+ node.children.forEach((child) => child.visit(this));
30626
+ }
30627
+ visitDirective(node) {
30628
+ if (this.directiveMatcher instanceof SelectorlessMatcher) {
30629
+ const directives = this.directiveMatcher.match(node.name);
30630
+ if (directives.length > 0) {
30631
+ this.trackSelectorlessMatchesAndDirectives(node, directives);
30632
+ }
30633
+ else {
30634
+ this.missingDirectives.add(node.name);
30635
+ }
30636
+ }
30637
+ }
30521
30638
  visitElementOrTemplate(node) {
30522
- // First, determine the HTML shape of the node for the purpose of directive matching.
30523
- // Do this by building up a `CssSelector` for the node.
30524
- const cssSelector = createCssSelectorFromNode(node);
30525
- // TODO(crisbeto): account for selectorless directives here.
30526
- if (node.directives.length > 0) {
30527
- throw new Error('TODO');
30528
- }
30529
- // Next, use the `SelectorMatcher` to get the list of directives on the node.
30530
- const directives = [];
30531
- this.matcher.match(cssSelector, (_selector, results) => directives.push(...results));
30639
+ if (this.directiveMatcher instanceof SelectorMatcher) {
30640
+ const directives = [];
30641
+ const cssSelector = createCssSelectorFromNode(node);
30642
+ this.directiveMatcher.match(cssSelector, (_, results) => directives.push(...results));
30643
+ this.trackSelectorBasedBindingsAndDirectives(node, directives);
30644
+ }
30645
+ node.directives.forEach((directive) => directive.visit(this));
30646
+ node.children.forEach((child) => child.visit(this));
30647
+ }
30648
+ trackMatchedDirectives(node, directives) {
30532
30649
  if (directives.length > 0) {
30533
30650
  this.directives.set(node, directives);
30534
30651
  if (!this.isInDeferBlock) {
30535
30652
  this.eagerDirectives.push(...directives);
30536
30653
  }
30537
30654
  }
30655
+ }
30656
+ trackSelectorlessMatchesAndDirectives(node, directives) {
30657
+ if (directives.length === 0) {
30658
+ return;
30659
+ }
30660
+ this.trackMatchedDirectives(node, directives);
30661
+ const setBinding = (meta, attribute, ioType) => {
30662
+ if (meta[ioType].hasBindingPropertyName(attribute.name)) {
30663
+ this.bindings.set(attribute, meta);
30664
+ }
30665
+ };
30666
+ for (const directive of directives) {
30667
+ node.inputs.forEach((input) => setBinding(directive, input, 'inputs'));
30668
+ node.attributes.forEach((attr) => setBinding(directive, attr, 'inputs'));
30669
+ node.outputs.forEach((output) => setBinding(directive, output, 'outputs'));
30670
+ }
30671
+ // TODO(crisbeto): currently it's unclear how references should behave under selectorless,
30672
+ // given that there's one named class which can bring in multiple host directives.
30673
+ // For the time being only register the first directive as the reference target.
30674
+ node.references.forEach((ref) => this.references.set(ref, { directive: directives[0], node: node }));
30675
+ }
30676
+ trackSelectorBasedBindingsAndDirectives(node, directives) {
30677
+ this.trackMatchedDirectives(node, directives);
30538
30678
  // Resolve any references that are created on this node.
30539
30679
  node.references.forEach((ref) => {
30540
30680
  let dirTarget = null;
@@ -30565,6 +30705,7 @@ class DirectiveBinder {
30565
30705
  this.references.set(ref, node);
30566
30706
  }
30567
30707
  });
30708
+ // Associate attributes/bindings on the node with directives or with the node itself.
30568
30709
  const setAttributeBinding = (attribute, ioType) => {
30569
30710
  const dir = directives.find((dir) => dir[ioType].hasBindingPropertyName(attribute.name));
30570
30711
  const binding = dir !== undefined ? dir : node;
@@ -30579,57 +30720,6 @@ class DirectiveBinder {
30579
30720
  }
30580
30721
  // Node outputs (bound events) can be bound to an output on a directive.
30581
30722
  node.outputs.forEach((output) => setAttributeBinding(output, 'outputs'));
30582
- // Recurse into the node's children.
30583
- node.children.forEach((child) => child.visit(this));
30584
- }
30585
- visitDeferredBlock(deferred) {
30586
- const wasInDeferBlock = this.isInDeferBlock;
30587
- this.isInDeferBlock = true;
30588
- deferred.children.forEach((child) => child.visit(this));
30589
- this.isInDeferBlock = wasInDeferBlock;
30590
- deferred.placeholder?.visit(this);
30591
- deferred.loading?.visit(this);
30592
- deferred.error?.visit(this);
30593
- }
30594
- visitDeferredBlockPlaceholder(block) {
30595
- block.children.forEach((child) => child.visit(this));
30596
- }
30597
- visitDeferredBlockError(block) {
30598
- block.children.forEach((child) => child.visit(this));
30599
- }
30600
- visitDeferredBlockLoading(block) {
30601
- block.children.forEach((child) => child.visit(this));
30602
- }
30603
- visitSwitchBlock(block) {
30604
- block.cases.forEach((node) => node.visit(this));
30605
- }
30606
- visitSwitchBlockCase(block) {
30607
- block.children.forEach((node) => node.visit(this));
30608
- }
30609
- visitForLoopBlock(block) {
30610
- block.item.visit(this);
30611
- block.contextVariables.forEach((v) => v.visit(this));
30612
- block.children.forEach((node) => node.visit(this));
30613
- block.empty?.visit(this);
30614
- }
30615
- visitForLoopBlockEmpty(block) {
30616
- block.children.forEach((node) => node.visit(this));
30617
- }
30618
- visitIfBlock(block) {
30619
- block.branches.forEach((node) => node.visit(this));
30620
- }
30621
- visitIfBlockBranch(block) {
30622
- block.expressionAlias?.visit(this);
30623
- block.children.forEach((node) => node.visit(this));
30624
- }
30625
- visitContent(content) {
30626
- content.children.forEach((child) => child.visit(this));
30627
- }
30628
- visitComponent(component) {
30629
- throw new Error('TODO');
30630
- }
30631
- visitDirective(directive) {
30632
- throw new Error('TODO');
30633
30723
  }
30634
30724
  // Unused visitors.
30635
30725
  visitVariable(variable) { }
@@ -30788,10 +30878,16 @@ class TemplateBinder extends RecursiveAstVisitor {
30788
30878
  }
30789
30879
  }
30790
30880
  visitComponent(component) {
30791
- throw new Error('TODO');
30881
+ component.inputs.forEach(this.visitNode);
30882
+ component.outputs.forEach(this.visitNode);
30883
+ component.directives.forEach(this.visitNode);
30884
+ component.children.forEach(this.visitNode);
30885
+ component.references.forEach(this.visitNode);
30792
30886
  }
30793
30887
  visitDirective(directive) {
30794
- throw new Error('TODO');
30888
+ directive.inputs.forEach(this.visitNode);
30889
+ directive.outputs.forEach(this.visitNode);
30890
+ directive.references.forEach(this.visitNode);
30795
30891
  }
30796
30892
  // Unused template visitors
30797
30893
  visitText(text) { }
@@ -30912,6 +31008,7 @@ class R3BoundTarget {
30912
31008
  target;
30913
31009
  directives;
30914
31010
  eagerDirectives;
31011
+ missingDirectives;
30915
31012
  bindings;
30916
31013
  references;
30917
31014
  exprTargets;
@@ -30924,10 +31021,11 @@ class R3BoundTarget {
30924
31021
  deferredBlocks;
30925
31022
  /** Map of deferred blocks to their scope. */
30926
31023
  deferredScopes;
30927
- constructor(target, directives, eagerDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, rawDeferred) {
31024
+ constructor(target, directives, eagerDirectives, missingDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, rawDeferred) {
30928
31025
  this.target = target;
30929
31026
  this.directives = directives;
30930
31027
  this.eagerDirectives = eagerDirectives;
31028
+ this.missingDirectives = missingDirectives;
30931
31029
  this.bindings = bindings;
30932
31030
  this.references = references;
30933
31031
  this.exprTargets = exprTargets;
@@ -31035,7 +31133,7 @@ class R3BoundTarget {
31035
31133
  const stack = [this.deferredScopes.get(block)];
31036
31134
  while (stack.length > 0) {
31037
31135
  const current = stack.pop();
31038
- if (current.elementsInScope.has(element)) {
31136
+ if (current.elementLikeInScope.has(element)) {
31039
31137
  return true;
31040
31138
  }
31041
31139
  stack.push(...current.childScopes.values());
@@ -31043,6 +31141,9 @@ class R3BoundTarget {
31043
31141
  }
31044
31142
  return false;
31045
31143
  }
31144
+ referencedDirectiveExists(name) {
31145
+ return !this.missingDirectives.has(name);
31146
+ }
31046
31147
  /**
31047
31148
  * Finds an entity with a specific name in a scope.
31048
31149
  * @param rootNode Root node of the scope.
@@ -31062,7 +31163,9 @@ class R3BoundTarget {
31062
31163
  if (target instanceof Element$1) {
31063
31164
  return target;
31064
31165
  }
31065
- if (target instanceof Template) {
31166
+ if (target instanceof Template ||
31167
+ target.node instanceof Component$1 ||
31168
+ target.node instanceof Directive$1) {
31066
31169
  return null;
31067
31170
  }
31068
31171
  return this.referenceTargetToElement(target.node);
@@ -31545,7 +31648,7 @@ function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces,
31545
31648
  const errors = parsed.errors.map((err) => err.toString()).join(', ');
31546
31649
  throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`);
31547
31650
  }
31548
- const binder = new R3TargetBinder(new SelectorMatcher());
31651
+ const binder = new R3TargetBinder(null);
31549
31652
  const boundTarget = binder.bind({ template: parsed.nodes });
31550
31653
  return {
31551
31654
  template: parsed,
@@ -32263,7 +32366,7 @@ var FactoryTarget;
32263
32366
  * @description
32264
32367
  * Entry point for all public APIs of the compiler package.
32265
32368
  */
32266
- new Version('20.0.0-next.7');
32369
+ new Version('20.0.0-next.9');
32267
32370
 
32268
32371
  //////////////////////////////////////
32269
32372
  // THIS FILE HAS GLOBAL SIDE EFFECT //
@@ -32306,6 +32409,7 @@ exports.CUSTOM_ELEMENTS_SCHEMA = CUSTOM_ELEMENTS_SCHEMA;
32306
32409
  exports.Call = Call;
32307
32410
  exports.Chain = Chain;
32308
32411
  exports.CloneVisitor = CloneVisitor;
32412
+ exports.Component = Component$1;
32309
32413
  exports.Conditional = Conditional;
32310
32414
  exports.ConstantPool = ConstantPool;
32311
32415
  exports.Container = Container;
@@ -32318,6 +32422,7 @@ exports.DeclareFunctionStmt = DeclareFunctionStmt;
32318
32422
  exports.DeclareVarStmt = DeclareVarStmt;
32319
32423
  exports.DeferredBlock = DeferredBlock;
32320
32424
  exports.DefinitionMap = DefinitionMap;
32425
+ exports.Directive = Directive$1;
32321
32426
  exports.DomElementSchemaRegistry = DomElementSchemaRegistry;
32322
32427
  exports.DynamicImportExpr = DynamicImportExpr;
32323
32428
  exports.Element = Element$1;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.7
3
+ * @license Angular v20.0.0-next.9
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.7
3
+ * @license Angular v20.0.0-next.9
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -9,7 +9,7 @@
9
9
  var schematics = require('@angular-devkit/schematics');
10
10
  var p = require('path');
11
11
  var compiler_host = require('./compiler_host-CAfDJO3W.js');
12
- var compiler = require('./compiler-BaCbbux6.js');
12
+ var compiler = require('./compiler-B4MK7BP9.js');
13
13
  var ts = require('typescript');
14
14
  var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
15
15
  require('@angular-devkit/core');
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.7
3
+ * @license Angular v20.0.0-next.9
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- require('./compiler-BaCbbux6.js');
9
+ require('./compiler-B4MK7BP9.js');
10
10
  require('typescript');
11
- var checker = require('./checker-_f5wM7PH.js');
11
+ var checker = require('./checker-Crz1jSZM.js');
12
12
  require('os');
13
- var apply_import_manager = require('./apply_import_manager-DczRKpTm.js');
14
- require('./index-rsJ8I_hu.js');
13
+ var apply_import_manager = require('./apply_import_manager-CxaTw_Wy.js');
14
+ require('./index-Bk_3geTg.js');
15
15
  require('path');
16
- var project_paths = require('./project_paths-Ce0O2u-M.js');
16
+ var project_paths = require('./project_paths-CQ4-VKlW.js');
17
17
  var imports = require('./imports-CIX-JgAN.js');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.7
3
+ * @license Angular v20.0.0-next.9
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.7
3
+ * @license Angular v20.0.0-next.9
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,11 +8,11 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var checker = require('./checker-_f5wM7PH.js');
12
- var compiler = require('./compiler-BaCbbux6.js');
13
- var index = require('./index-rsJ8I_hu.js');
11
+ var checker = require('./checker-Crz1jSZM.js');
12
+ var compiler = require('./compiler-B4MK7BP9.js');
13
+ var index = require('./index-Bk_3geTg.js');
14
14
  require('path');
15
- var project_paths = require('./project_paths-Ce0O2u-M.js');
15
+ var project_paths = require('./project_paths-CQ4-VKlW.js');
16
16
 
17
17
  function getMemberName(member) {
18
18
  if (member.name === undefined) {
@@ -745,6 +745,7 @@ function extractTemplateWithoutCompilerAnalysis(node, checker$1, reflector, reso
745
745
  usePoisonedData: true,
746
746
  enableI18nLegacyMessageIdFormat: options.enableI18nLegacyMessageIdFormat !== false,
747
747
  i18nNormalizeLineEndingsInICUs: options.i18nNormalizeLineEndingsInICUs === true,
748
+ enableSelectorless: false,
748
749
  }, checker.CompilationMode.FULL).nodes;
749
750
  }
750
751