Skip to content

[transitions] Custom Transition component#48325

Open
mj12albert wants to merge 1 commit intomui:masterfrom
mj12albert:custom-transition-component
Open

[transitions] Custom Transition component#48325
mj12albert wants to merge 1 commit intomui:masterfrom
mj12albert:custom-transition-component

Conversation

@mj12albert
Copy link
Copy Markdown
Member

@mj12albert mj12albert commented Apr 18, 2026

Preview with components that internally use the transition component:

Replace react-transition-group with a modernized Transition component based on it. RTG hasn't received a meaningful update since 2022. This will facilitate #16367.

We keep the core enter/exit lifecycle from RTG, remove unnecessary/legacy things like findDOMNode fallbacks, child cloning etc, generally update it a bit for modern React.

According to Codex, button ripples get a good performance boost on a hot path (the ripple is in a lot of components) since it no longer uses TransitionGroup internally. Instead of the RTG method of diffing children JSX, cloning transition props, and coordinating enter/exit state, we can now directly track ripple state and toggle each ripple’s in state.

We need to keep RTG as a runtime dependency since we need TransitionGroupContext, which allows our components to work as RTG TransitionGroup children like this docs example. The majority of RTG is completely tree-shaken away though, and there is a nice bundle size gain that comes with this, 49 components have a gzip reduction: avg -1.83%, median -2.44%.

Top 10:

Entrypoint Raw delta Gzip delta Gzip change
@mui/material/ButtonBase -2,354 B -853 B -3.19%
@mui/material/Fab -2,353 B -844 B -3.03%
@mui/material/ListItemButton -2,353 B -834 B -3.01%
@mui/material/CardActionArea -2,353 B -836 B -3.00%
@mui/material/ToggleButton -2,353 B -835 B -3.00%
@mui/material/BottomNavigationAction -2,353 B -823 B -2.92%
@mui/material/AccordionSummary -2,353 B -823 B -2.92%
@mui/material/Tab -2,353 B -821 B -2.90%
@mui/material/MenuItem -2,353 B -816 B -2.86%
@mui/material/TabScrollButton -2,353 B -826 B -2.84%

@mj12albert mj12albert added the scope: transitions Changes related to the transitions. label Apr 18, 2026
@mj12albert mj12albert force-pushed the custom-transition-component branch 3 times, most recently from 364e9f9 to e83cfb1 Compare April 18, 2026 17:22
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard bot commented Apr 18, 2026

Bundle size

Bundle Parsed size Gzip size
@mui/material ▼-3.38KB(-0.67%) ▼-1.04KB(-0.71%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 🔺+181B(+1.21%) 🔺+55B(+0.95%)

Details of bundle changes

Deploy preview


Check out the code infra dashboard for more information about this PR.

@mj12albert mj12albert force-pushed the custom-transition-component branch 9 times, most recently from 63e9940 to 228c345 Compare April 19, 2026 16:26
@mj12albert mj12albert force-pushed the custom-transition-component branch from 76ca5f7 to 3fdab8d Compare April 19, 2026 17:54
@mj12albert mj12albert marked this pull request as ready for review April 19, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance scope: transitions Changes related to the transitions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant