Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

Typically we mark the name of things that might animate in the snapshot phase. At the same time we track that should call startViewTransition too. However, we don't do this for "enter" since they're only marked later. Leading to having just an "enter" not to animate unless there's at least another update too.

This tracks if there's a ViewTransitionComponent in the tree that enters. Luckily we know that from the static flag so we don't have to traverse it.

@react-sizebot
Copy link

Comparing: f134b39...8f5af58

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 = 515.00 kB 515.00 kB = 91.74 kB 91.74 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 +0.05% 614.89 kB 615.17 kB +0.05% 108.78 kB 108.83 kB
facebook-www/ReactDOM-prod.classic.js +0.04% 646.61 kB 646.89 kB +0.02% 114.30 kB 114.32 kB
facebook-www/ReactDOM-prod.modern.js +0.04% 636.89 kB 637.17 kB +0.02% 112.71 kB 112.74 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 8f5af58

@sebmarkbage sebmarkbage merged commit 4280563 into facebook:main Mar 26, 2025
243 checks passed
@sebmarkbage
Copy link
Collaborator Author

I think it's possible for this to start a view transition even if the entering component has default="none" but then it would end up getting all animations canceled at the end anyway. So it'd probably create an unnecessary snapshot first.

github-actions bot pushed a commit that referenced this pull request Mar 26, 2025
#32764)

Typically we mark the name of things that might animate in the snapshot
phase. At the same time we track that should call startViewTransition
too. However, we don't do this for "enter" since they're only marked
later. Leading to having just an "enter" not to animate unless there's
at least another update too.

This tracks if there's a ViewTransitionComponent in the tree that
enters. Luckily we know that from the static flag so we don't have to
traverse it.

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