[transitions] Custom Transition component#48325
Open
mj12albert wants to merge 1 commit intomui:masterfrom
Open
[transitions] Custom Transition component#48325mj12albert wants to merge 1 commit intomui:masterfrom
Transition component#48325mj12albert wants to merge 1 commit intomui:masterfrom
Conversation
364e9f9 to
e83cfb1
Compare
Bundle size
Deploy preview
Check out the code infra dashboard for more information about this PR. |
63e9940 to
228c345
Compare
76ca5f7 to
3fdab8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preview with components that internally use the transition component:
Replace
react-transition-groupwith a modernizedTransitioncomponent 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
findDOMNodefallbacks, 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
TransitionGroupinternally. 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’sinstate.We need to keep RTG as a runtime dependency since we need
TransitionGroupContext, which allows our components to work as RTGTransitionGroupchildren 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:
@mui/material/ButtonBase@mui/material/Fab@mui/material/ListItemButton@mui/material/CardActionArea@mui/material/ToggleButton@mui/material/BottomNavigationAction@mui/material/AccordionSummary@mui/material/Tab@mui/material/MenuItem@mui/material/TabScrollButton