Skip to content

Conversation

@sebmarkbage
Copy link
Collaborator

Stacked on #35486.

When a Gesture commits, it leaves behind work on a Transition lane (revertLane). This entangles that lane with whatever lane we're using in the event that cancels the Gesture. This ensures that the revert and the result of any resulting Action commits as one batch. Typically the Action would apply a new state that is similar or the same as the revert of the Gesture.

This makes it resilient to unbatching in #35392.

Instead of keeping track of which gestures to stop during the next commit,
we instead track on the pending gesture whether that gesture should commit
that lane next time we get there in the React commit sequence.
When completing a root we can apply the gesture which starts the animation
but it's not committed. We mark the lane as suspended at that point.
This will rerender the gesture lane and then commit it which stops the
gesture. After that any Transitions can be applied on top.
…commits

This part doesn't animate until we release.
@meta-cla meta-cla bot added the CLA Signed label Jan 12, 2026
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jan 12, 2026
// so that we commit them all together.
if (gesture.revertLane !== NoLane) {
const entangledLanes = gesture.revertLane | requestTransitionLane(null);
markRootEntangled(root, entangledLanes);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One thing that's a bit strange with this one is that the revert lane isn't actually scheduled at this point yet because it's not pending until we actually commit the gesture lane which is the one that leaves the work behind. Ideally this should probably be done somewhere in the commit phase instead.

@react-sizebot
Copy link

Comparing: 5aec1b2...db5f538

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.84 kB 6.84 kB +0.16% 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.05% 607.60 kB 607.88 kB +0.05% 107.53 kB 107.59 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB +0.16% 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.39% 666.83 kB 669.42 kB +0.42% 117.42 kB 117.91 kB
facebook-www/ReactDOM-prod.classic.js +0.04% 692.91 kB 693.21 kB +0.05% 121.92 kB 121.97 kB
facebook-www/ReactDOM-prod.modern.js +0.04% 683.34 kB 683.63 kB +0.04% 120.31 kB 120.36 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-reconciler/cjs/react-reconciler.production.js +0.43% 488.22 kB 490.33 kB +0.47% 77.61 kB 77.98 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.39% 666.83 kB 669.42 kB +0.42% 117.42 kB 117.91 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.production.js +0.38% 681.24 kB 683.83 kB +0.39% 120.97 kB 121.45 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js +0.37% 563.67 kB 565.76 kB +0.52% 87.62 kB 88.08 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js +0.35% 745.45 kB 748.08 kB +0.42% 128.73 kB 129.28 kB
oss-experimental/react-art/cjs/react-art.development.js +0.32% 729.62 kB 731.96 kB +0.49% 114.59 kB 115.16 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +0.31% 857.38 kB 859.99 kB +0.39% 133.40 kB 133.92 kB
oss-experimental/react-dom/cjs/react-dom-client.development.js +0.26% 1,240.60 kB 1,243.78 kB +0.33% 205.92 kB 206.60 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js +0.25% 1,257.14 kB 1,260.33 kB +0.31% 209.62 kB 210.27 kB
oss-experimental/react-dom/cjs/react-dom-profiling.development.js +0.25% 1,257.14 kB 1,260.33 kB +0.33% 208.79 kB 209.47 kB

Generated by 🚫 dangerJS against db5f538

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.

2 participants