@angular/core 17.1.0-next.1 → 17.1.0-next.2

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.
package/fesm2022/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.1.0-next.1
2
+ * @license Angular v17.1.0-next.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2722,20 +2722,19 @@ function walkUpViews(nestingLevel, currentView) {
2722
2722
  }
2723
2723
  return currentView;
2724
2724
  }
2725
+ function requiresRefreshOrTraversal(lView) {
2726
+ return lView[FLAGS] & (1024 /* LViewFlags.RefreshView */ | 8192 /* LViewFlags.HasChildViewsToRefresh */) ||
2727
+ lView[REACTIVE_TEMPLATE_CONSUMER]?.dirty;
2728
+ }
2725
2729
  /**
2726
- * Updates the `DESCENDANT_VIEWS_TO_REFRESH` counter on the parents of the `LView` as well as the
2727
- * parents above that whose
2728
- * 1. counter goes from 0 to 1, indicating that there is a new child that has a view to refresh
2729
- * or
2730
- * 2. counter goes from 1 to 0, indicating there are no more descendant views to refresh
2731
- * When attaching/re-attaching an `LView` to the change detection tree, we need to ensure that the
2732
- * views above it are traversed during change detection if this one is marked for refresh or has
2733
- * some child or descendant that needs to be refreshed.
2730
+ * Updates the `HasChildViewsToRefresh` flag on the parents of the `LView` as well as the
2731
+ * parents above.
2734
2732
  */
2735
2733
  function updateAncestorTraversalFlagsOnAttach(lView) {
2736
- if (lView[FLAGS] & (1024 /* LViewFlags.RefreshView */ | 8192 /* LViewFlags.HasChildViewsToRefresh */)) {
2737
- markAncestorsForTraversal(lView);
2734
+ if (!requiresRefreshOrTraversal(lView)) {
2735
+ return;
2738
2736
  }
2737
+ markAncestorsForTraversal(lView);
2739
2738
  }
2740
2739
  /**
2741
2740
  * Ensures views above the given `lView` are traversed during change detection even when they are
@@ -10428,7 +10427,7 @@ class Version {
10428
10427
  /**
10429
10428
  * @publicApi
10430
10429
  */
10431
- const VERSION = new Version('17.1.0-next.1');
10430
+ const VERSION = new Version('17.1.0-next.2');
10432
10431
 
10433
10432
  // This default value is when checking the hierarchy for a token.
10434
10433
  //
@@ -13335,8 +13334,7 @@ function detectChangesInViewWhileDirty(lView) {
13335
13334
  // descendants views that need to be refreshed due to re-dirtying during the change detection
13336
13335
  // run, detect changes on the view again. We run change detection in `Targeted` mode to only
13337
13336
  // refresh views with the `RefreshView` flag.
13338
- while (lView[FLAGS] & (1024 /* LViewFlags.RefreshView */ | 8192 /* LViewFlags.HasChildViewsToRefresh */) ||
13339
- lView[REACTIVE_TEMPLATE_CONSUMER]?.dirty) {
13337
+ while (requiresRefreshOrTraversal(lView)) {
13340
13338
  if (retries === MAXIMUM_REFRESH_RERUNS) {
13341
13339
  throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode &&
13342
13340
  'Infinite change detection while trying to refresh views. ' +
@@ -15986,19 +15984,26 @@ function ɵɵCopyDefinitionFeature(definition) {
15986
15984
  * @codeGenApi
15987
15985
  */
15988
15986
  function ɵɵHostDirectivesFeature(rawHostDirectives) {
15989
- return (definition) => {
15990
- definition.findHostDirectiveDefs = findHostDirectiveDefs;
15991
- definition.hostDirectives =
15992
- (Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives()).map(dir => {
15993
- return typeof dir === 'function' ?
15994
- { directive: resolveForwardRef(dir), inputs: EMPTY_OBJ, outputs: EMPTY_OBJ } :
15995
- {
15996
- directive: resolveForwardRef(dir.directive),
15997
- inputs: bindingArrayToMap(dir.inputs),
15998
- outputs: bindingArrayToMap(dir.outputs)
15999
- };
16000
- });
15987
+ const feature = (definition) => {
15988
+ const resolved = (Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives()).map(dir => {
15989
+ return typeof dir === 'function' ?
15990
+ { directive: resolveForwardRef(dir), inputs: EMPTY_OBJ, outputs: EMPTY_OBJ } :
15991
+ {
15992
+ directive: resolveForwardRef(dir.directive),
15993
+ inputs: bindingArrayToMap(dir.inputs),
15994
+ outputs: bindingArrayToMap(dir.outputs)
15995
+ };
15996
+ });
15997
+ if (definition.hostDirectives === null) {
15998
+ definition.findHostDirectiveDefs = findHostDirectiveDefs;
15999
+ definition.hostDirectives = resolved;
16000
+ }
16001
+ else {
16002
+ definition.hostDirectives.unshift(...resolved);
16003
+ }
16001
16004
  };
16005
+ feature.ngInherit = true;
16006
+ return feature;
16002
16007
  }
16003
16008
  function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {
16004
16009
  if (currentDef.hostDirectives !== null) {
@@ -30003,7 +30008,7 @@ const ITS_JUST_ANGULAR = true;
30003
30008
  * provideHttpClient(),
30004
30009
  * {
30005
30010
  * provide: APP_INITIALIZER,
30006
- * useFactory: initializeApp,
30011
+ * useFactory: initializeAppFactory,
30007
30012
  * multi: true,
30008
30013
  * deps: [HttpClient],
30009
30014
  * },