From 11c82b37e2cce1aaa1401e0598394ae95ed7a6cf Mon Sep 17 00:00:00 2001 From: Fabio Carballo Date: Thu, 18 Jan 2024 02:22:46 -0800 Subject: [PATCH] Codeship nested preallocation Summary: This configuration is already hardcoded to be enable on IG4a, and I have recently did a sanity check QE on FB4A/M4A to spot for any possible issues. Since nothing was detected, I'm making it final. Reviewed By: adityasharat Differential Revision: D52786688 fbshipit-source-id: 41e60318b8efb29b08ed61b3df2c82613233e152 --- .../com/facebook/litho/config/ComponentsConfiguration.kt | 5 ----- .../java/com/facebook/litho/NestedPreallocationTest.kt | 1 - .../java/com/facebook/litho/widget/RecyclerBinder.java | 8 +------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/litho-core/src/main/java/com/facebook/litho/config/ComponentsConfiguration.kt b/litho-core/src/main/java/com/facebook/litho/config/ComponentsConfiguration.kt index 11ef591c430..89612e94937 100644 --- a/litho-core/src/main/java/com/facebook/litho/config/ComponentsConfiguration.kt +++ b/litho-core/src/main/java/com/facebook/litho/config/ComponentsConfiguration.kt @@ -48,7 +48,6 @@ internal constructor( val shouldAddHostViewForRootComponent: Boolean = false, @JvmField val useIncrementalMountGapWorker: Boolean = IncrementalMountExtensionConfigs.useGapWorker, - @JvmField val nestedPreallocationEnabled: Boolean = false, val useNonRebindingEventHandlers: Boolean = false, internal val shouldDisableBgFgOutputs: Boolean = false, /** @@ -228,7 +227,6 @@ internal constructor( class Builder internal constructor(private var baseConfig: ComponentsConfiguration) { private var shouldAddHostViewForRootComponent = baseConfig.shouldAddHostViewForRootComponent - private var nestedPreallocationEnabled = baseConfig.nestedPreallocationEnabled private var specsApiStateUpdateDuplicateDetectionEnabled = baseConfig.specsApiStateUpdateDuplicateDetectionEnabled private var shouldCacheLayouts = baseConfig.shouldCacheLayouts @@ -244,8 +242,6 @@ internal constructor( shouldAddHostViewForRootComponent = enabled } - fun nestedPreallocationEnabled(enabled: Boolean) = also { nestedPreallocationEnabled = enabled } - fun shouldCacheLayouts(enabled: Boolean) = also { shouldCacheLayouts = enabled } fun specsApiStateUpdateDetectionEnabled(enabled: Boolean) = also { @@ -282,7 +278,6 @@ internal constructor( return baseConfig.copy( specsApiStateUpdateDuplicateDetectionEnabled = specsApiStateUpdateDuplicateDetectionEnabled, - nestedPreallocationEnabled = nestedPreallocationEnabled, shouldCacheLayouts = shouldCacheLayouts, shouldAddHostViewForRootComponent = shouldAddHostViewForRootComponent, isReconciliationEnabled = isReconciliationEnabled, diff --git a/litho-it/src/test/java/com/facebook/litho/NestedPreallocationTest.kt b/litho-it/src/test/java/com/facebook/litho/NestedPreallocationTest.kt index 7e4627cf303..5bff59c4dab 100644 --- a/litho-it/src/test/java/com/facebook/litho/NestedPreallocationTest.kt +++ b/litho-it/src/test/java/com/facebook/litho/NestedPreallocationTest.kt @@ -77,7 +77,6 @@ class NestedPreallocationTest { ComponentTree.create(context, EmptyComponent()) .componentsConfiguration( ComponentsConfiguration.defaultInstance.copy( - nestedPreallocationEnabled = true, mountContentPreallocationEnabled = preallocationEnabled)) .build() diff --git a/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java b/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java index 04641b53216..0ea0d7b334d 100644 --- a/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java +++ b/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java @@ -751,18 +751,12 @@ private RecyclerBinder(Builder builder) { tempConfiguration = ComponentsConfiguration.create(tempConfiguration) /* - Incremental mount will not work if this ComponentTree is nested in a parent with it turned off, + Incremental mount will not work if this ComponentTree is nested in a parent with it turned off, so always disable it in that case */ .incrementalMountEnabled( ComponentContext.isIncrementalMountEnabled(mComponentContext) && tempConfiguration.incrementalMountEnabled) - /* - If nested preallocation is disabled, we forcefully disable mount content preallocation. - */ - .mountContentPreallocationEnabled( - tempConfiguration.nestedPreallocationEnabled - && tempConfiguration.mountContentPreallocationEnabled) .build(); mComponentsConfiguration = tempConfiguration;