Skip to content

[Fiber] Gate Update flag on BeforeMutationMask on flags #31921

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

Merged
merged 1 commit into from
Jan 2, 2025
Merged
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
17 changes: 11 additions & 6 deletions packages/react-reconciler/src/ReactFiberFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
* @flow
*/

import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags';
import {
enableCreateEventHandleAPI,
enableUseEffectEventHook,
} from 'shared/ReactFeatureFlags';

export type Flags = number;

Expand Down Expand Up @@ -77,17 +80,19 @@ export const MountPassiveDev = /* */ 0b1000000000000000000000000000
// don't contain effects, by checking subtreeFlags.

export const BeforeMutationMask: number =
// TODO: Remove Update flag from before mutation phase by re-landing Visibility
// flag logic (see #20043)
Copy link
Member

Choose a reason for hiding this comment

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

Did we actually do this? Comment added in #20622 referring to #20043

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think so because there's nothing that refer to it.

Update |
Snapshot |
(enableCreateEventHandleAPI
? // createEventHandle needs to visit deleted and hidden trees to
// fire beforeblur
// TODO: Only need to visit Deletions during BeforeMutation phase if an
// element is focused.
ChildDeletion | Visibility
: 0);
Update | ChildDeletion | Visibility
: enableUseEffectEventHook
? // TODO: The useEffectEvent hook uses the snapshot phase for clean up but it
// really should use the mutation phase for this or at least schedule an
// explicit Snapshot phase flag for this.
Update
Copy link
Member

Choose a reason for hiding this comment

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

I can update useEffectEvent, what's the reasoning for using the mutation phase for cleanup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not quite sure why this needs an effect in general but ideally this is more like a read only phase and since it's rarely visited (except I will make heavy use of it in my VT PR) we shouldn't unnecessarily traverse for something unrelated like this.

: 0);

export const MutationMask =
Placement |
Expand Down
Loading