Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import {
} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
import isArray from 'shared/isArray';

import {enableShallowPropDiffing} from 'shared/ReactFeatureFlags';
import {
enableShallowPropDiffing,
enableFastAddPropertiesInDiffing,
} from 'shared/ReactFeatureFlags';

import type {AttributeConfiguration} from './ReactNativeTypes';

Expand Down Expand Up @@ -218,7 +221,11 @@ function addNestedProperty(

if (!isArray(nextProp)) {
// Add each property of the leaf.
return addProperties(updatePayload, nextProp, validAttributes);
if (enableFastAddPropertiesInDiffing) {
return fastAddProperties(updatePayload, nextProp, validAttributes);
} else {
return addProperties(updatePayload, nextProp, validAttributes);
}
}

for (let i = 0; i < nextProp.length; i++) {
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export const enableInfiniteRenderLoopDetection = false;
*/
export const enableUseResourceEffectHook = false;

export const enableFastAddPropertiesInDiffing = true;

// -----------------------------------------------------------------------------
// Ready for next major.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ export const enableSiblingPrerendering = __VARIANT__;
export const enableUseResourceEffectHook = __VARIANT__;
export const enableOwnerStacks = __VARIANT__;
export const enableRemoveConsolePatches = __VARIANT__;
export const enableFastAddPropertiesInDiffing = __VARIANT__;
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const {
enableSiblingPrerendering,
enableOwnerStacks,
enableRemoveConsolePatches,
enableFastAddPropertiesInDiffing,
} = dynamicFlags;

// The rest of the flags are static for better dead code elimination.
Expand Down
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const enableYieldingBeforePassive = false;

export const enableThrottledScheduling = false;
export const enableViewTransition = false;
export const enableFastAddPropertiesInDiffing = false;

// Profiling Only
export const enableProfilerTimer = __PROFILE__;
Expand Down
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const enableYieldingBeforePassive = true;

export const enableThrottledScheduling = false;
export const enableViewTransition = false;
export const enableFastAddPropertiesInDiffing = true;

// TODO: This must be in sync with the main ReactFeatureFlags file because
// the Test Renderer's value must be the same as the one used by the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const enableYieldingBeforePassive = false;
export const enableThrottledScheduling = false;
export const enableViewTransition = false;
export const enableRemoveConsolePatches = false;
export const enableFastAddPropertiesInDiffing = false;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const enableYieldingBeforePassive = false;
export const enableThrottledScheduling = false;
export const enableViewTransition = false;
export const enableRemoveConsolePatches = false;
export const enableFastAddPropertiesInDiffing = false;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.www-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const enableSiblingPrerendering = __VARIANT__;

export const enableUseResourceEffectHook = __VARIANT__;
export const enableRemoveConsolePatches = __VARIANT__;
export const enableFastAddPropertiesInDiffing = __VARIANT__;

// TODO: These flags are hard-coded to the default values used in open source.
// Update the tests so that they pass in either mode, then set these
Expand Down
1 change: 1 addition & 0 deletions packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const {
transitionLaneExpirationMs,
enableOwnerStacks,
enableRemoveConsolePatches,
enableFastAddPropertiesInDiffing,
} = dynamicFeatureFlags;

// On WWW, __EXPERIMENTAL__ is used for a new modern build.
Expand Down
Loading