@angular/core 22.0.0-next.4 → 22.0.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.
Files changed (62) hide show
  1. package/fesm2022/_attribute-chunk.mjs +1 -1
  2. package/fesm2022/_debug_node-chunk.mjs +96 -11
  3. package/fesm2022/_debug_node-chunk.mjs.map +1 -1
  4. package/fesm2022/_effect-chunk.mjs +1 -1
  5. package/fesm2022/_not_found-chunk.mjs +1 -1
  6. package/fesm2022/_pending_tasks-chunk.mjs +2 -2
  7. package/fesm2022/_pending_tasks-chunk.mjs.map +1 -1
  8. package/fesm2022/_resource-chunk.mjs +1 -1
  9. package/fesm2022/_resource-chunk.mjs.map +1 -1
  10. package/fesm2022/_untracked-chunk.mjs +1 -1
  11. package/fesm2022/_weak_ref-chunk.mjs +1 -1
  12. package/fesm2022/core.mjs +40 -17
  13. package/fesm2022/core.mjs.map +1 -1
  14. package/fesm2022/primitives-di.mjs +1 -1
  15. package/fesm2022/primitives-event-dispatch.mjs +1 -1
  16. package/fesm2022/primitives-signals.mjs +1 -1
  17. package/fesm2022/rxjs-interop.mjs +1 -1
  18. package/fesm2022/testing.mjs +1 -1
  19. package/fesm2022/testing.mjs.map +1 -1
  20. package/package.json +2 -2
  21. package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
  22. package/schematics/bundles/change-detection-eager.cjs +1 -1
  23. package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
  24. package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
  25. package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
  26. package/schematics/bundles/control-flow-migration.cjs +1 -1
  27. package/schematics/bundles/http-xhr-backend.cjs +1 -1
  28. package/schematics/bundles/imports-CKV-ITqD.cjs +1 -1
  29. package/schematics/bundles/index-BtLcQH8g.cjs +1 -1
  30. package/schematics/bundles/inject-migration.cjs +26 -18
  31. package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
  32. package/schematics/bundles/migrate_ts_type_references-Dp33iyGx.cjs +1 -1
  33. package/schematics/bundles/ng_component_template-DPAF1aEA.cjs +1 -1
  34. package/schematics/bundles/ng_decorators-IVztR9rk.cjs +1 -1
  35. package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
  36. package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
  37. package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
  38. package/schematics/bundles/output-migration.cjs +1 -1
  39. package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
  40. package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
  41. package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
  42. package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
  43. package/schematics/bundles/route-lazy-loading.cjs +1 -1
  44. package/schematics/bundles/router-testing-module-migration.cjs +1 -1
  45. package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
  46. package/schematics/bundles/signal-input-migration.cjs +1 -1
  47. package/schematics/bundles/signal-queries-migration.cjs +1 -1
  48. package/schematics/bundles/signals.cjs +1 -1
  49. package/schematics/bundles/standalone-migration.cjs +1 -1
  50. package/types/_api-chunk.d.ts +7 -2
  51. package/types/_chrome_dev_tools_performance-chunk.d.ts +1 -1
  52. package/types/_debug_node-chunk.d.ts +13 -12
  53. package/types/_effect-chunk.d.ts +1 -1
  54. package/types/_event_dispatcher-chunk.d.ts +1 -1
  55. package/types/_formatter-chunk.d.ts +1 -1
  56. package/types/_weak_ref-chunk.d.ts +1 -1
  57. package/types/core.d.ts +13 -21
  58. package/types/primitives-di.d.ts +1 -1
  59. package/types/primitives-event-dispatch.d.ts +1 -1
  60. package/types/primitives-signals.d.ts +1 -1
  61. package/types/rxjs-interop.d.ts +1 -1
  62. package/types/testing.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v22.0.0-next.4
2
+ * @license Angular v22.0.0-next.5
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v22.0.0-next.4
2
+ * @license Angular v22.0.0-next.5
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -4716,6 +4716,7 @@ function applyToElementOrContainer(action, renderer, injector, parent, lNodeToHa
4716
4716
  if (parentLView?.[ANIMATIONS]?.leave?.has(tNode.index)) {
4717
4717
  trackLeavingNodes(tNode, rNode);
4718
4718
  }
4719
+ reusedNodes.delete(rNode);
4719
4720
  runLeaveAnimationsWithCallback(parentLView, tNode, injector, nodeHasLeaveAnimations => {
4720
4721
  if (reusedNodes.has(rNode)) {
4721
4722
  reusedNodes.delete(rNode);
@@ -4724,6 +4725,7 @@ function applyToElementOrContainer(action, renderer, injector, parent, lNodeToHa
4724
4725
  nativeRemoveNode(renderer, rNode, isComponent, nodeHasLeaveAnimations);
4725
4726
  });
4726
4727
  } else if (action === 3) {
4728
+ reusedNodes.delete(rNode);
4727
4729
  runLeaveAnimationsWithCallback(parentLView, tNode, injector, () => {
4728
4730
  renderer.destroyNode(rNode);
4729
4731
  });
@@ -8429,14 +8431,13 @@ class ControlDirectiveHostImpl {
8429
8431
  return `<${this.tNode.value}>`;
8430
8432
  }
8431
8433
  listenToCustomControlOutput(outputName, callback) {
8432
- if (!hasOutput(this.tView.data[this.tNode.customControlIndex], outputName)) {
8433
- return;
8434
- }
8435
- listenToOutput(this.tNode, this.lView, this.tNode.customControlIndex, outputName, outputName, wrapListener(this.tNode, this.lView, callback));
8434
+ const directiveDef = this.tView.data[this.tNode.customControlIndex];
8435
+ listenToDirectiveOutput(this.tNode, this.lView, directiveDef, outputName, wrapListener(this.tNode, this.lView, callback));
8436
8436
  }
8437
8437
  listenToCustomControlModel(listener) {
8438
8438
  const modelName = this.tNode.flags & 1024 ? 'valueChange' : 'checkedChange';
8439
- listenToOutput(this.tNode, this.lView, this.tNode.customControlIndex, modelName, modelName, wrapListener(this.tNode, this.lView, listener));
8439
+ const directiveDef = this.tView.data[this.tNode.customControlIndex];
8440
+ listenToDirectiveOutput(this.tNode, this.lView, directiveDef, modelName, wrapListener(this.tNode, this.lView, listener));
8440
8441
  }
8441
8442
  listenToDom(eventName, listener) {
8442
8443
  listenToDomEvent(this.tNode, this.tView, this.lView, undefined, this.lView[RENDERER], eventName, listener, wrapListener(this.tNode, this.lView, listener));
@@ -8475,18 +8476,62 @@ class ControlDirectiveHostImpl {
8475
8476
  return wasSet;
8476
8477
  }
8477
8478
  setCustomControlModelInput(value) {
8478
- const directive = this.lView[this.tNode.customControlIndex];
8479
8479
  const directiveDef = this.tView.data[this.tNode.customControlIndex];
8480
8480
  const modelName = this.tNode.flags & 1024 ? 'value' : 'checked';
8481
- writeToDirectiveInput(directiveDef, directive, modelName, value);
8481
+ setDirectiveInput(this.tNode, this.tView, this.lView, directiveDef, modelName, value);
8482
8482
  }
8483
8483
  customControlHasInput(inputName) {
8484
8484
  if (this.tNode.customControlIndex === -1) {
8485
8485
  return false;
8486
8486
  }
8487
8487
  const directiveDef = this.tView.data[this.tNode.customControlIndex];
8488
- return directiveDef.inputs[inputName] != undefined;
8488
+ const presence = directiveDef.signalFormsInputPresence ??= this._buildCustomControlInputCache(directiveDef);
8489
+ return presence[inputName] === true;
8490
+ }
8491
+ _buildCustomControlInputCache(directiveDef) {
8492
+ const cache = {};
8493
+ for (const key in directiveDef.inputs) {
8494
+ cache[key] = true;
8495
+ }
8496
+ if (directiveDef.hostDirectives !== null) {
8497
+ const queue = [...directiveDef.hostDirectives];
8498
+ while (queue.length > 0) {
8499
+ const hostDir = queue.shift();
8500
+ if (typeof hostDir !== 'function') {
8501
+ for (const key in hostDir.inputs) {
8502
+ cache[hostDir.inputs[key]] = true;
8503
+ }
8504
+ const hostDirectives = getHostDirectives(hostDir.directive);
8505
+ if (hostDirectives !== null) {
8506
+ queue.push(...hostDirectives);
8507
+ }
8508
+ continue;
8509
+ }
8510
+ for (const config of hostDir()) {
8511
+ if (typeof config === 'function') {
8512
+ continue;
8513
+ }
8514
+ if (config.inputs) {
8515
+ for (let i = 0; i < config.inputs.length; i += 2) {
8516
+ const exposedName = config.inputs[i + 1] || config.inputs[i];
8517
+ cache[exposedName] = true;
8518
+ }
8519
+ }
8520
+ const hostDirectives = getHostDirectives(config.directive);
8521
+ if (hostDirectives !== null) {
8522
+ queue.push(...hostDirectives);
8523
+ }
8524
+ }
8525
+ }
8526
+ }
8527
+ return cache;
8528
+ }
8529
+ }
8530
+ function getHostDirectives(directiveType) {
8531
+ if (typeof directiveType === 'function' && 'ɵdir' in directiveType) {
8532
+ return directiveType.ɵdir.hostDirectives ?? null;
8489
8533
  }
8534
+ return null;
8490
8535
  }
8491
8536
  function initializeControlFirstCreatePass(tView, tNode, lView) {
8492
8537
  ngDevMode && assertFirstCreatePass(tView);
@@ -8512,6 +8557,9 @@ function initializeControlFirstCreatePass(tView, tNode, lView) {
8512
8557
  function initializeCustomControlStatus(tView, tNode) {
8513
8558
  for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
8514
8559
  const directiveDef = tView.data[i];
8560
+ if (tNode.directiveToIndex && !tNode.directiveToIndex.has(directiveDef.type)) {
8561
+ continue;
8562
+ }
8515
8563
  if (hasModelInput(directiveDef, 'value')) {
8516
8564
  tNode.flags |= 1024;
8517
8565
  tNode.customControlIndex = i;
@@ -8523,6 +8571,42 @@ function initializeCustomControlStatus(tView, tNode) {
8523
8571
  return;
8524
8572
  }
8525
8573
  }
8574
+ if (tNode.hostDirectiveInputs !== null && tNode.hostDirectiveOutputs !== null && tNode.directiveToIndex !== null) {
8575
+ const checkModel = (modelName, flag) => {
8576
+ const inputs = tNode.hostDirectiveInputs[modelName];
8577
+ const outputs = tNode.hostDirectiveOutputs[modelName + 'Change'];
8578
+ if (!inputs || !outputs) {
8579
+ return false;
8580
+ }
8581
+ for (let i = 0; i < inputs.length; i += 2) {
8582
+ const inputIndex = inputs[i];
8583
+ for (let j = 0; j < outputs.length; j += 2) {
8584
+ const outputIndex = outputs[j];
8585
+ if (inputIndex !== outputIndex) {
8586
+ continue;
8587
+ }
8588
+ for (const data of tNode.directiveToIndex.values()) {
8589
+ if (!Array.isArray(data)) {
8590
+ continue;
8591
+ }
8592
+ const [hostIndex, start, end] = data;
8593
+ if (inputIndex >= start && inputIndex <= end) {
8594
+ tNode.flags |= flag;
8595
+ tNode.customControlIndex = hostIndex;
8596
+ return true;
8597
+ }
8598
+ }
8599
+ }
8600
+ }
8601
+ return false;
8602
+ };
8603
+ if (checkModel('value', 1024)) {
8604
+ return;
8605
+ }
8606
+ if (checkModel('checked', 2048)) {
8607
+ return;
8608
+ }
8609
+ }
8526
8610
  }
8527
8611
  function hasModelInput(directiveDef, name) {
8528
8612
  return hasInput(directiveDef, name) && hasOutput(directiveDef, name + 'Change');
@@ -8806,7 +8890,7 @@ class ComponentFactory extends ComponentFactory$1 {
8806
8890
  }
8807
8891
  }
8808
8892
  function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
8809
- const tAttributes = rootSelectorOrNode ? ['ng-version', '22.0.0-next.4'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
8893
+ const tAttributes = rootSelectorOrNode ? ['ng-version', '22.0.0-next.5'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
8810
8894
  let creationBindings = null;
8811
8895
  let updateBindings = null;
8812
8896
  let varsToAllocate = 0;
@@ -9730,7 +9814,7 @@ function ɵɵdefineComponent(componentDefinition) {
9730
9814
  template: componentDefinition.template,
9731
9815
  consts: componentDefinition.consts || null,
9732
9816
  ngContentSelectors: componentDefinition.ngContentSelectors,
9733
- onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,
9817
+ onPush: componentDefinition.changeDetection !== ChangeDetectionStrategy.Eager,
9734
9818
  directiveDefs: null,
9735
9819
  pipeDefs: null,
9736
9820
  dependencies: baseDef.standalone && componentDefinition.dependencies || null,
@@ -9853,6 +9937,7 @@ function getNgDirectiveDef(directiveDefinition) {
9853
9937
  resolveHostDirectives: null,
9854
9938
  hostDirectives: null,
9855
9939
  controlDef: null,
9940
+ signalFormsInputPresence: null,
9856
9941
  inputs: parseAndConvertInputsForDefinition(directiveDefinition.inputs, declaredInputs),
9857
9942
  outputs: parseAndConvertOutputsForDefinition(directiveDefinition.outputs),
9858
9943
  debugInfo: null