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] clarify entry condition for suspensey commit recursion #29222

Merged
merged 1 commit into from
May 23, 2024

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented May 22, 2024

Previously Suspensey recursion would only trigger if the ShouldSuspendCommit flag was true. However there is a dependence on the Visibility flag embedded in this logic because these flags share a bit. To make it clear that the semantics of Suspensey resources require considering both flags I've added it to the condition even though this extra or-ing is a noop when the bit is shared

Copy link

vercel bot commented May 22, 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 May 23, 2024 8:52pm

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels May 22, 2024
@gnoff gnoff force-pushed the clarify-suspensey-recursion-trigger branch 2 times, most recently from a409ff2 to 30d249b Compare May 22, 2024 19:39
@gnoff gnoff requested a review from acdlite May 22, 2024 19:39
@react-sizebot
Copy link

react-sizebot commented May 22, 2024

Comparing: 3ac551e...09f87eb

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.66 kB 6.66 kB +0.05% 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.02% 495.89 kB 496.01 kB +0.04% 88.82 kB 88.86 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.02% 500.69 kB 500.81 kB +0.04% 89.51 kB 89.54 kB
facebook-www/ReactDOM-prod.classic.js +0.02% 593.05 kB 593.16 kB +0.03% 104.32 kB 104.35 kB
facebook-www/ReactDOM-prod.modern.js +0.02% 569.27 kB 569.38 kB +0.04% 100.72 kB 100.76 kB
test_utils/ReactAllWarnings.js Deleted 64.35 kB 0.00 kB Deleted 16.05 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 64.35 kB 0.00 kB Deleted 16.05 kB 0.00 kB

Generated by 🚫 dangerJS against 09f87eb

@@ -1185,7 +1185,7 @@ function commitRootWhenReady(
) {
// TODO: Combine retry throttling with Suspensey commits. Right now they run
// one after the other.
if (finishedWork.subtreeFlags & ShouldSuspendCommit) {
if (finishedWork.subtreeFlags & (ShouldSuspendCommit | Visibility)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

To make this even more specific, if ShouldSuspendCommit is not present, it should check if both Visibility and MaySuspendCommit are set. If there's no MaySuspendCommit flag it can bail out.

So something like:

const BothShouldSuspendCommitAndVisibility = ShouldSuspendCommit | Visibility;
if (
  subtreeFlags & SoundSuspendCommit ||
  ((subtreeFlags & BothShouldSuspendCommitAndVisibility) === BothShouldSuspendCommitAndVisibility)

Previously Suspensey recursion would only trigger if the ShouldSuspendCommit flag was true. However there is a dependence on the Visibility flag embedded in this logic because these flags share a bit. To make it clear that the semantics of Suspensey resources require considering both flags I've added it to the condition even though this extra or-ing is a noop when the bit is shared
@gnoff gnoff force-pushed the clarify-suspensey-recursion-trigger branch from 30d249b to 09f87eb Compare May 23, 2024 20:45
@gnoff gnoff merged commit f55d172 into facebook:main May 23, 2024
40 checks passed
@gnoff gnoff deleted the clarify-suspensey-recursion-trigger branch May 23, 2024 20:54
github-actions bot pushed a commit that referenced this pull request May 23, 2024
Previously Suspensey recursion would only trigger if the
ShouldSuspendCommit flag was true. However there is a dependence on the
Visibility flag embedded in this logic because these flags share a bit.
To make it clear that the semantics of Suspensey resources require
considering both flags I've added it to the condition even though this
extra or-ing is a noop when the bit is shared

DiffTrain build for commit f55d172.
github-actions bot pushed a commit that referenced this pull request May 23, 2024
Previously Suspensey recursion would only trigger if the
ShouldSuspendCommit flag was true. However there is a dependence on the
Visibility flag embedded in this logic because these flags share a bit.
To make it clear that the semantics of Suspensey resources require
considering both flags I've added it to the condition even though this
extra or-ing is a noop when the bit is shared

DiffTrain build for [f55d172](f55d172)
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.

None yet

4 participants