mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
[RN] experiment to move Fabric completeWork to the commit phase (#30513)
There is currently a mismatch in how the persistent mode JS API and the Fabric native code interpret `completeRoot`. This is a short-lived experiment to see the effect of moving the Fabric `completeRoot` call from `finalizeContainerChildren` to `replaceContainerChildren` which in some cases does not get called.
This commit is contained in:
@@ -48,7 +48,10 @@ const {
|
||||
unstable_getCurrentEventPriority: fabricGetCurrentEventPriority,
|
||||
} = nativeFabricUIManager;
|
||||
|
||||
import {passChildrenWhenCloningPersistedNodes} from 'shared/ReactFeatureFlags';
|
||||
import {
|
||||
enableFabricCompleteRootInCommitPhase,
|
||||
passChildrenWhenCloningPersistedNodes,
|
||||
} from 'shared/ReactFeatureFlags';
|
||||
|
||||
const {get: getViewConfigForType} = ReactNativeViewConfigRegistry;
|
||||
|
||||
@@ -469,7 +472,9 @@ export function finalizeContainerChildren(
|
||||
container: Container,
|
||||
newChildren: ChildSet,
|
||||
): void {
|
||||
completeRoot(container, newChildren);
|
||||
if (!enableFabricCompleteRootInCommitPhase) {
|
||||
completeRoot(container, newChildren);
|
||||
}
|
||||
}
|
||||
|
||||
export function replaceContainerChildren(
|
||||
@@ -477,6 +482,9 @@ export function replaceContainerChildren(
|
||||
newChildren: ChildSet,
|
||||
): void {
|
||||
// Noop - children will be replaced in finalizeContainerChildren
|
||||
if (enableFabricCompleteRootInCommitPhase) {
|
||||
completeRoot(container, newChildren);
|
||||
}
|
||||
}
|
||||
|
||||
export function getInstanceFromNode(node: any): empty {
|
||||
|
||||
@@ -87,6 +87,11 @@ export const enableTaint = __EXPERIMENTAL__;
|
||||
|
||||
export const enablePostpone = __EXPERIMENTAL__;
|
||||
|
||||
/**
|
||||
* Switches the Fabric API from doing layout in commit work instead of complete work.
|
||||
*/
|
||||
export const enableFabricCompleteRootInCommitPhase = false;
|
||||
|
||||
/**
|
||||
* Switches Fiber creation to a simple object instead of a constructor.
|
||||
*/
|
||||
|
||||
@@ -22,3 +22,4 @@ export const enableAddPropertiesFastPath = __VARIANT__;
|
||||
export const enableObjectFiber = __VARIANT__;
|
||||
export const enableShallowPropDiffing = __VARIANT__;
|
||||
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
|
||||
export const enableFabricCompleteRootInCommitPhase = __VARIANT__;
|
||||
|
||||
@@ -21,6 +21,7 @@ const dynamicFlags: DynamicExportsType = (dynamicFlagsUntyped: any);
|
||||
export const {
|
||||
alwaysThrottleRetries,
|
||||
enableAddPropertiesFastPath,
|
||||
enableFabricCompleteRootInCommitPhase,
|
||||
enableObjectFiber,
|
||||
enableShallowPropDiffing,
|
||||
passChildrenWhenCloningPersistedNodes,
|
||||
|
||||
@@ -44,6 +44,7 @@ export const enableCreateEventHandleAPI = false;
|
||||
export const enableDebugTracing = false;
|
||||
export const enableDeferRootSchedulingToMicrotask = true;
|
||||
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
|
||||
export const enableFabricCompleteRootInCommitPhase = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = true;
|
||||
export const enableFizzExternalRuntime = true;
|
||||
export const enableFlightReadableStream = true;
|
||||
|
||||
@@ -44,6 +44,7 @@ export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = true;
|
||||
export const enableGetInspectorDataForInstanceInProduction = false;
|
||||
export const enableFabricCompleteRootInCommitPhase = false;
|
||||
|
||||
export const enableRetryLaneExpiration = false;
|
||||
export const retryLaneExpirationMs = 5000;
|
||||
|
||||
@@ -78,6 +78,7 @@ export const retryLaneExpirationMs = 5000;
|
||||
export const syncLaneExpirationMs = 250;
|
||||
export const transitionLaneExpirationMs = 5000;
|
||||
export const useModernStrictMode = true;
|
||||
export const enableFabricCompleteRootInCommitPhase = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
|
||||
|
||||
@@ -47,6 +47,7 @@ export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = true;
|
||||
export const enableGetInspectorDataForInstanceInProduction = false;
|
||||
export const enableRenderableContext = false;
|
||||
export const enableFabricCompleteRootInCommitPhase = false;
|
||||
|
||||
export const enableRetryLaneExpiration = false;
|
||||
export const retryLaneExpirationMs = 5000;
|
||||
|
||||
@@ -46,6 +46,7 @@ export const enableProfilerTimer = __PROFILE__;
|
||||
export const enableProfilerCommitHooks = __PROFILE__;
|
||||
export const enableProfilerNestedUpdatePhase = __PROFILE__;
|
||||
export const enableUpdaterTracking = __PROFILE__;
|
||||
export const enableFabricCompleteRootInCommitPhase = false;
|
||||
|
||||
export const enableSuspenseAvoidThisFallback = true;
|
||||
export const enableSuspenseAvoidThisFallbackFizz = false;
|
||||
|
||||
Reference in New Issue
Block a user