From 8931fca34ca6d913f2be2a23338a588bbf0b075d Mon Sep 17 00:00:00 2001 From: arturovt Date: Fri, 28 Mar 2025 13:46:10 +0200 Subject: [PATCH] refactor(core): calculate `hasHttpTransferCacheOptions` later (#60605) Prior to this commit, `hasHttpTransferCacheOptions` was calculated immediately after the `featuresKind` set was declared, which was always defaulted to `false`. PR Close #60605 --- packages/platform-browser/src/hydration.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/platform-browser/src/hydration.ts b/packages/platform-browser/src/hydration.ts index d612e5e9266..7d49737ab3d 100644 --- a/packages/platform-browser/src/hydration.ts +++ b/packages/platform-browser/src/hydration.ts @@ -225,9 +225,6 @@ export function provideClientHydration( ): EnvironmentProviders { const providers: Provider[] = []; const featuresKind = new Set(); - const hasHttpTransferCacheOptions = featuresKind.has( - HydrationFeatureKind.HttpTransferCacheOptions, - ); for (const {ɵproviders, ɵkind} of features) { featuresKind.add(ɵkind); @@ -237,6 +234,10 @@ export function provideClientHydration( } } + const hasHttpTransferCacheOptions = featuresKind.has( + HydrationFeatureKind.HttpTransferCacheOptions, + ); + if ( typeof ngDevMode !== 'undefined' && ngDevMode &&