-
Notifications
You must be signed in to change notification settings - Fork 48.6k
[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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,10 @@ | |
* @flow | ||
*/ | ||
|
||
import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags'; | ||
import { | ||
enableCreateEventHandleAPI, | ||
enableUseEffectEventHook, | ||
} from 'shared/ReactFeatureFlags'; | ||
|
||
export type Flags = number; | ||
|
||
|
@@ -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) | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.