@angular/core 17.3.5 → 17.3.6

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.3.5
2
+ * @license Angular v17.3.6
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -16022,7 +16022,7 @@ function createRootComponent(componentView, rootComponentDef, rootDirectives, ho
16022
16022
  function setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {
16023
16023
  if (rootSelectorOrNode) {
16024
16024
  // The placeholder will be replaced with the actual version at build time.
16025
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', '17.3.5']);
16025
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', '17.3.6']);
16026
16026
  }
16027
16027
  else {
16028
16028
  // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
@@ -19667,8 +19667,10 @@ function renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling
19667
19667
  const currentState = lDetails[DEFER_BLOCK_STATE];
19668
19668
  if (isValidStateChange(currentState, newState) &&
19669
19669
  isValidStateChange(lDetails[NEXT_DEFER_BLOCK_STATE] ?? -1, newState)) {
19670
+ const injector = hostLView[INJECTOR];
19670
19671
  const tDetails = getTDeferBlockDetails(hostTView, tNode);
19671
- const needsScheduling = !skipTimerScheduling &&
19672
+ // Skips scheduling on the server since it can delay the server response.
19673
+ const needsScheduling = !skipTimerScheduling && isPlatformBrowser(injector) &&
19672
19674
  (getLoadingBlockAfter(tDetails) !== null ||
19673
19675
  getMinimumDurationForState(tDetails, DeferBlockState.Loading) !== null ||
19674
19676
  getMinimumDurationForState(tDetails, DeferBlockState.Placeholder));
@@ -19690,7 +19692,20 @@ function renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling
19690
19692
  */
19691
19693
  function isRouterOutletInjector(currentInjector) {
19692
19694
  return (currentInjector instanceof ChainedInjector) &&
19693
- (currentInjector.injector.__ngOutletInjector);
19695
+ (typeof currentInjector.injector.__ngOutletInjector === 'function');
19696
+ }
19697
+ /**
19698
+ * Creates an instance of the `OutletInjector` using a private factory
19699
+ * function available on the `OutletInjector` class.
19700
+ *
19701
+ * @param parentOutletInjector Parent OutletInjector, which should be used
19702
+ * to produce a new instance.
19703
+ * @param parentInjector An Injector, which should be used as a parent one
19704
+ * for a newly created `OutletInjector` instance.
19705
+ */
19706
+ function createRouterOutletInjector(parentOutletInjector, parentInjector) {
19707
+ const outletInjector = parentOutletInjector.injector;
19708
+ return outletInjector.__ngOutletInjector(parentInjector);
19694
19709
  }
19695
19710
  /**
19696
19711
  * Applies changes to the DOM to reflect a given state.
@@ -19723,11 +19738,18 @@ function applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView)
19723
19738
  // we can't inject it. Once the `OutletInjector` is replaced
19724
19739
  // with the `EnvironmentInjector` in Router's code, this special
19725
19740
  // handling can be removed.
19726
- const parentEnvInjector = isRouterOutletInjector(parentInjector) ?
19727
- parentInjector :
19728
- parentInjector.get(EnvironmentInjector);
19741
+ const isParentOutletInjector = isRouterOutletInjector(parentInjector);
19742
+ const parentEnvInjector = isParentOutletInjector ? parentInjector : parentInjector.get(EnvironmentInjector);
19729
19743
  injector = parentEnvInjector.get(CachedInjectorService)
19730
19744
  .getOrCreateInjector(tDetails, parentEnvInjector, providers, ngDevMode ? 'DeferBlock Injector' : '');
19745
+ // Note: this is a continuation of the special case for Router's `OutletInjector`.
19746
+ // Since the `OutletInjector` handles `ActivatedRoute` and `ChildrenOutletContexts`
19747
+ // dynamically (i.e. their values are not really stored statically in an injector),
19748
+ // we need to "wrap" a defer injector into another `OutletInjector`, so we retain
19749
+ // the dynamic resolution of the mentioned tokens.
19750
+ if (isParentOutletInjector) {
19751
+ injector = createRouterOutletInjector(parentInjector, injector);
19752
+ }
19731
19753
  }
19732
19754
  }
19733
19755
  const dehydratedView = findMatchingDehydratedView(lContainer, activeBlockTNode.tView.ssrId);
@@ -19831,7 +19853,7 @@ function triggerResourceLoading(tDetails, lView, tNode) {
19831
19853
  // If the loading status is different from initial one, it means that
19832
19854
  // the loading of dependencies is in progress and there is nothing to do
19833
19855
  // in this function. All details can be obtained from the `tDetails` object.
19834
- return;
19856
+ return tDetails.loadingPromise ?? Promise.resolve();
19835
19857
  }
19836
19858
  const lDetails = getLDeferBlockDetails(lView, tNode);
19837
19859
  const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails);
@@ -19859,7 +19881,7 @@ function triggerResourceLoading(tDetails, lView, tNode) {
19859
19881
  tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;
19860
19882
  pendingTasks.remove(taskId);
19861
19883
  });
19862
- return;
19884
+ return tDetails.loadingPromise;
19863
19885
  }
19864
19886
  // Start downloading of defer block dependencies.
19865
19887
  tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then(results => {
@@ -19919,6 +19941,7 @@ function triggerResourceLoading(tDetails, lView, tNode) {
19919
19941
  }
19920
19942
  }
19921
19943
  });
19944
+ return tDetails.loadingPromise;
19922
19945
  }
19923
19946
  /** Utility function to render placeholder content (if present) */
19924
19947
  function renderPlaceholder(lView, tNode) {
@@ -29830,7 +29853,7 @@ class Version {
29830
29853
  /**
29831
29854
  * @publicApi
29832
29855
  */
29833
- const VERSION = new Version('17.3.5');
29856
+ const VERSION = new Version('17.3.6');
29834
29857
 
29835
29858
  class Console {
29836
29859
  log(message) {