Skip to content

Commit

Permalink
Codeship nested preallocation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Fabio Carballo authored and facebook-github-bot committed Jan 18, 2024
1 parent b3c386f commit 11c82b3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
/**
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -282,7 +278,6 @@ internal constructor(
return baseConfig.copy(
specsApiStateUpdateDuplicateDetectionEnabled =
specsApiStateUpdateDuplicateDetectionEnabled,
nestedPreallocationEnabled = nestedPreallocationEnabled,
shouldCacheLayouts = shouldCacheLayouts,
shouldAddHostViewForRootComponent = shouldAddHostViewForRootComponent,
isReconciliationEnabled = isReconciliationEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class NestedPreallocationTest {
ComponentTree.create(context, EmptyComponent())
.componentsConfiguration(
ComponentsConfiguration.defaultInstance.copy(
nestedPreallocationEnabled = true,
mountContentPreallocationEnabled = preallocationEnabled))
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 11c82b3

Please sign in to comment.