Skip to content

Cleanup enableObjectFiber experiment #32676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
74 changes: 1 addition & 73 deletions packages/react-reconciler/src/ReactFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
enableDO_NOT_USE_disableStrictPassiveEffect,
enableRenderableContext,
disableLegacyMode,
enableObjectFiber,
enableViewTransition,
} from 'shared/ReactFeatureFlags';
import {NoFlags, Placement, StaticMask} from './ReactFiberFlags';
Expand Down Expand Up @@ -225,7 +224,7 @@ function FiberNode(
// is faster.
// 5) It should be easy to port this to a C struct and keep a C implementation
// compatible.
function createFiberImplClass(
function createFiber(
tag: WorkTag,
pendingProps: mixed,
key: null | string,
Expand All @@ -235,77 +234,6 @@ function createFiberImplClass(
return new FiberNode(tag, pendingProps, key, mode);
}

function createFiberImplObject(
tag: WorkTag,
pendingProps: mixed,
key: null | string,
mode: TypeOfMode,
): Fiber {
const fiber: Fiber = {
// Instance
// tag, key - defined at the bottom as dynamic properties
elementType: null,
type: null,
stateNode: null,

// Fiber
return: null,
child: null,
sibling: null,
index: 0,

ref: null,
refCleanup: null,

// pendingProps - defined at the bottom as dynamic properties
memoizedProps: null,
updateQueue: null,
memoizedState: null,
dependencies: null,

// Effects
flags: NoFlags,
subtreeFlags: NoFlags,
deletions: null,

lanes: NoLanes,
childLanes: NoLanes,

alternate: null,

// dynamic properties at the end for more efficient hermes bytecode
tag,
key,
pendingProps,
mode,
};

if (enableProfilerTimer) {
fiber.actualDuration = -0;
fiber.actualStartTime = -1.1;
fiber.selfBaseDuration = -0;
fiber.treeBaseDuration = -0;
}

if (__DEV__) {
// This isn't directly used but is handy for debugging internals:
fiber._debugInfo = null;
fiber._debugOwner = null;
fiber._debugStack = null;
fiber._debugTask = null;
fiber._debugNeedsRemount = false;
fiber._debugHookTypes = null;
if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
Object.preventExtensions(fiber);
}
}
return fiber;
}

const createFiber = enableObjectFiber
? createFiberImplObject
: createFiberImplClass;

function shouldConstruct(Component: Function) {
const prototype = Component.prototype;
return !!(prototype && prototype.isReactComponent);
Expand Down
5 changes: 0 additions & 5 deletions packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ export const enableScrollEndPolyfill = __EXPERIMENTAL__;
*/
export const enableFabricCompleteRootInCommitPhase = false;

/**
* Switches Fiber creation to a simple object instead of a constructor.
*/
export const enableObjectFiber = false;

export const enableTransitionTracing = false;

// FB-only usage. The new API has different semantics.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// add a test configuration for React Native.

export const alwaysThrottleRetries = __VARIANT__;
export const enableObjectFiber = __VARIANT__;
export const enableHiddenSubtreeInsertionEffectCleanup = __VARIANT__;
export const enablePersistedModeClonedFlag = __VARIANT__;
export const enableShallowPropDiffing = __VARIANT__;
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const {
alwaysThrottleRetries,
enableFabricCompleteRootInCommitPhase,
enableHiddenSubtreeInsertionEffectCleanup,
enableObjectFiber,
enablePersistedModeClonedFlag,
enableShallowPropDiffing,
enableUseEffectCRUDOverload,
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const enableLegacyCache = false;
export const enableLegacyFBSupport = false;
export const enableLegacyHidden = false;
export const enableNoCloningMemoCache = false;
export const enableObjectFiber = false;
export const enablePersistedModeClonedFlag = false;
export const enablePostpone = false;
export const enableReactTestRendererWarning = false;
Expand Down
2 changes: 0 additions & 2 deletions packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,5 @@ export const enableRenderableContext = true;
export const enableReactTestRendererWarning = true;
export const disableDefaultPropsExceptForClasses = true;

export const enableObjectFiber = 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 @@ -34,7 +34,6 @@ export const enableLegacyCache = false;
export const enableLegacyFBSupport = false;
export const enableLegacyHidden = false;
export const enableNoCloningMemoCache = false;
export const enableObjectFiber = false;
export const enablePersistedModeClonedFlag = false;
export const enablePostpone = false;
export const enableProfilerCommitHooks = __PROFILE__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export const disableDefaultPropsExceptForClasses = true;

export const renameElementSymbol = false;

export const enableObjectFiber = false;
export const enableShallowPropDiffing = false;
export const enableSiblingPrerendering = true;

Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
export const enableDO_NOT_USE_disableStrictPassiveEffect = __VARIANT__;
export const enableHiddenSubtreeInsertionEffectCleanup = __VARIANT__;
export const enableNoCloningMemoCache = __VARIANT__;
export const enableObjectFiber = __VARIANT__;
export const enableRenderableContext = __VARIANT__;
export const enableRetryLaneExpiration = __VARIANT__;
export const enableTransitionTracing = __VARIANT__;
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const {
enableHiddenSubtreeInsertionEffectCleanup,
enableInfiniteRenderLoopDetection,
enableNoCloningMemoCache,
enableObjectFiber,
enableRenderableContext,
enableRetryLaneExpiration,
enableSiblingPrerendering,
Expand Down
Loading