Skip to content
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

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

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

sebmarkbage
Copy link
Collaborator

We're currently visiting the snapshot phase for every Update flag even though we rarely have to do anything in the Snapshot phase.

The only flags that seem to use these wider visits is enableCreateEventHandleAPI and enableUseEffectEventHook but really neither of those should do that neither. They should schedule explicit Snapshot phases if needed.

Copy link

vercel bot commented Dec 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 26, 2024 8:35pm

@react-sizebot
Copy link

Comparing: fc8a898...25cfe7c

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 511.38 kB 511.38 kB = 91.38 kB 91.38 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 516.17 kB 516.17 kB = 92.23 kB 92.23 kB
facebook-www/ReactDOM-prod.classic.js = 593.09 kB 593.09 kB = 104.45 kB 104.45 kB
facebook-www/ReactDOM-prod.modern.js = 583.35 kB 583.35 kB = 102.90 kB 102.90 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against ca95570

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

Defer to @acdlite because I don't know much about the fiber flags.

What is the Update flag intended to represent?

? // 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.

@@ -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.

@sebmarkbage sebmarkbage merged commit 6ca7fbe into facebook:main Jan 2, 2025
187 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 2, 2025
We're currently visiting the snapshot phase for every `Update` flag even
though we rarely have to do anything in the Snapshot phase.

The only flags that seem to use these wider visits is
`enableCreateEventHandleAPI` and `enableUseEffectEventHook` but really
neither of those should do that neither. They should schedule explicit
Snapshot phases if needed.

DiffTrain build for [6ca7fbe](6ca7fbe)
github-actions bot pushed a commit that referenced this pull request Jan 2, 2025
We're currently visiting the snapshot phase for every `Update` flag even
though we rarely have to do anything in the Snapshot phase.

The only flags that seem to use these wider visits is
`enableCreateEventHandleAPI` and `enableUseEffectEventHook` but really
neither of those should do that neither. They should schedule explicit
Snapshot phases if needed.

DiffTrain build for [6ca7fbe](6ca7fbe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants