Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Sep 30, 2025

Otherwise, when a context is propagated into an Activity (or Suspense) this will leave work behind on the Offscreen component itself. Which will cause an extra unnecessary render and commit pass just to figure out that we're still defering it to idle.

This is because lazy context propagation, when calling to schedule some work walks back up the tree all the way to the root. This is usually fine for other nodes since they'll recompute their remaining child lanes on the way up. However, for the Offscreen component we'll have already computed it. We need to set it after propagation to ensure it gets reset.

@meta-cla meta-cla bot added the CLA Signed label Sep 30, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Sep 30, 2025
@react-sizebot
Copy link

Comparing: ef88944...ebd222e

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.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.01% 536.10 kB 536.16 kB +0.02% 94.79 kB 94.80 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 663.69 kB 663.75 kB +0.02% 117.00 kB 117.02 kB
facebook-www/ReactDOM-prod.classic.js +0.01% 687.59 kB 687.70 kB +0.02% 121.04 kB 121.07 kB
facebook-www/ReactDOM-prod.modern.js +0.02% 678.02 kB 678.12 kB +0.03% 119.40 kB 119.43 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against ebd222e

@sebmarkbage
Copy link
Collaborator Author

Actually it doesn't walk all the way to the root but for whatever reason scheduleContextWorkOnParentPath does update the child lanes of the "propagationRoot" which is the offscreen component in this case which leads to the same effect.

@sebmarkbage sebmarkbage merged commit d8a15c4 into facebook:main Sep 30, 2025
247 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 30, 2025
…Offscreen (#34658)

Otherwise, when a context is propagated into an Activity (or Suspense)
this will leave work behind on the Offscreen component itself. Which
will cause an extra unnecessary render and commit pass just to figure
out that we're still defering it to idle.

This is because lazy context propagation, when calling to schedule some
work walks back up the tree all the way to the root. This is usually
fine for other nodes since they'll recompute their remaining child lanes
on the way up. However, for the Offscreen component we'll have already
computed it. We need to set it after propagation to ensure it gets
reset.

DiffTrain build for [d8a15c4](d8a15c4)
github-actions bot pushed a commit that referenced this pull request Sep 30, 2025
…Offscreen (#34658)

Otherwise, when a context is propagated into an Activity (or Suspense)
this will leave work behind on the Offscreen component itself. Which
will cause an extra unnecessary render and commit pass just to figure
out that we're still defering it to idle.

This is because lazy context propagation, when calling to schedule some
work walks back up the tree all the way to the root. This is usually
fine for other nodes since they'll recompute their remaining child lanes
on the way up. However, for the Offscreen component we'll have already
computed it. We need to set it after propagation to ensure it gets
reset.

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

3 participants