Skip to content

[flags] Clean up enableHiddenSubtreeInsertionEffectCleanup#627

Closed
everettbu wants to merge 1 commit into
mainfrom
remove-enableHiddenSubtreeInsertionEffectCleanup
Closed

[flags] Clean up enableHiddenSubtreeInsertionEffectCleanup#627
everettbu wants to merge 1 commit into
mainfrom
remove-enableHiddenSubtreeInsertionEffectCleanup

Conversation

@everettbu

Copy link
Copy Markdown

Mirror of facebook/react#35918
Original author: hoxyq


Been enabled in stable for quite a while, also rolled out at Meta.

Remove the flag entirely and hardcode the enabled behavior.
@greptile-apps

greptile-apps Bot commented Feb 26, 2026

Copy link
Copy Markdown

Greptile Summary

Cleans up the enableHiddenSubtreeInsertionEffectCleanup feature flag, which has been enabled in stable and rolled out at Meta. The flag guarded a fix ensuring insertion effect cleanup runs on hidden subtrees during deletion. The PR removes the flag declaration from all 9 feature flag files (main + forks), inlines the enabled code path in ReactFiberCommitWork.js, and simplifies test assertions by removing conditional gate() checks — always expecting the enabled behavior. No references to the flag remain in the codebase.

  • Removed enableHiddenSubtreeInsertionEffectCleanup from ReactFeatureFlags.js and all fork variants
  • Inlined the enabled path in commitDeletionEffectsOnFiber so commitHookEffectListUnmount(HookInsertion, ...) always runs unconditionally during deletion
  • Simplified test assertions across 3 test files to always expect insertion effect cleanup behavior

Confidence Score: 5/5

  • This PR is a straightforward feature flag cleanup with no behavioral changes — safe to merge.
  • The flag was already true in the main feature flags file and had been rolled out in stable and at Meta. The PR is a mechanical removal: delete the flag, inline the enabled code path, and simplify tests. No logic changes, no new code, and grep confirms zero remaining references.
  • No files require special attention.

Important Files Changed

Filename Overview
packages/react-reconciler/src/ReactFiberCommitWork.js Removes enableHiddenSubtreeInsertionEffectCleanup import and flag guard, inlining the enabled code path so commitHookEffectListUnmount(HookInsertion, ...) always runs on deletion regardless of offscreenSubtreeWasHidden.
packages/shared/ReactFeatureFlags.js Removes the enableHiddenSubtreeInsertionEffectCleanup flag declaration (was set to true).
packages/react-reconciler/src/tests/ReactHooksWithNoopRenderer-test.js Removes gate('enableHiddenSubtreeInsertionEffectCleanup') conditional, always expecting the useInsertionEffect warning.
packages/react-reconciler/src/tests/ReactSuspenseEffectsSemantics-test.js Removes 4 conditional gate(flags => flags.enableHiddenSubtreeInsertionEffectCleanup) checks, always including the insertion destroy logs in assertions.
packages/react-reconciler/src/tests/useEffectEvent-test.js Removes outer gate('enableHiddenSubtreeInsertionEffectCleanup') conditional wrapping, keeping the inner enableViewTransition/enableEffectEventMutationPhase gate logic.

Last reviewed commit: d17bcda

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

13 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Feb 27, 2026
@everettbu
everettbu deleted the remove-enableHiddenSubtreeInsertionEffectCleanup branch February 27, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants