Skip to content

Add component names to ViewTransition autoName in DEV #33092

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jackpope
Copy link
Member

@jackpope jackpope commented May 1, 2025

When debugging ViewTransition, it can be difficult to use the Animations dev tools if you have multiple active ViewTransitions without specific names. We can make this a bit easier by adding the name of the owner component to the generated name in DEV. At least then you can have a high level idea of where the active animations are coming from and if they're relevant to the one you're debugging.

This implementation shortens the name, replaced invalid characters, and surrounds it in underscores as part of the existing generated name. I'm not tied to the specific replacement symbol or wrapper characters. Also if we can't get an owner component name, we could just leave it out instead of supplying the "unknown" string.

Screenshot 2025-05-01 at 4 55 12 PM

@react-sizebot
Copy link

react-sizebot commented May 1, 2025

Comparing: e5a8de8...09459d3

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 +0.05% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 528.26 kB 528.26 kB = 93.16 kB 93.16 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.11% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 645.02 kB 644.89 kB +0.01% 113.47 kB 113.48 kB
facebook-www/ReactDOM-prod.classic.js = 673.72 kB 673.65 kB = 118.32 kB 118.30 kB
facebook-www/ReactDOM-prod.modern.js = 664.00 kB 663.93 kB = 116.73 kB 116.71 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 09459d3

Copy link
Member

@kassens kassens left a comment

Choose a reason for hiding this comment

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

I wonder if there are issues in generating different ids in DEV. I think in the past I've seen some issues filed where DEV and prod where mixed between server and client.

@jackpope
Copy link
Member Author

jackpope commented May 7, 2025

The difference between hydrating/client animation names was removed in #33094 so I don't think we need to be concerned about a mismatch in the current implementation.

Copy link

@Hardanish-Singh Hardanish-Singh left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants