Skip to content
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

refactor(MessageBar): migrate slide & fade to motion components #33465

Merged
merged 25 commits into from
Dec 20, 2024

Conversation

robertpenner
Copy link
Collaborator

@robertpenner robertpenner commented Dec 13, 2024

MessageBarGroup

image

Previous Behavior

  • MessageBarGroup animations were implemented using react-transition-group and CSS.
  • The animations did not respond to the OS animations toggle.

New Behavior

  • MessageBarGroup animations use motion components in a PresenceGroup.
    • The motion should look the same.
    • The motions now obey the OS animations setting. (This comes for free with the motion framework.)
  • Unused code is deleted or deprecated.
    • react-transition-group dependency is removed... from all of v9! react-components is 7 kB smaller.
    • MessageBarTransition.tsx is deleted.
    • Unused styles are deleted. Unused properties and types for those styles are marked deprecated.

Testing Notes

  • Test the animations in the MessageBar Animation example. (PR build)

image

  • Click Add message to see messages enter; click the close button on a message to see it exit.
  • When the radio button is both, the new message should enter with a fading slide, and exit with a fade.
  • When the radio button is exit-only, the new message should enter without motion, and exit with a fade.
  • When you disable animations in your OS setting, there should be no motions.

Related Issue(s)

@robertpenner robertpenner self-assigned this Dec 13, 2024
Copy link

github-actions bot commented Dec 13, 2024

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.165 MB
291.952 kB
1.158 MB
289.328 kB
-7.599 kB
-2.624 kB
react-message-bar
MessageBar (all components)
24.847 kB
9.272 kB
24.825 kB
9.267 kB
-22 B
-5 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.21 kB
20.174 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
221.695 kB
64.135 kB
react-components
react-components: FluentProvider & webLightTheme
44.447 kB
14.59 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
react-timepicker-compat
TimePicker
107.513 kB
35.791 kB
🤖 This report was generated against dc7bb663e3d93a19b611cf1892556d69c57b1269

Copy link

Pull request demo site: URL

@robertpenner robertpenner force-pushed the refactor/messagebar-slide branch from be4e312 to 8e80f7a Compare December 13, 2024 15:57
@robertpenner robertpenner changed the title Refactor/messagebar slide refactor(MessageBar): migrate slide & fade to motion components Dec 13, 2024
@robertpenner robertpenner force-pushed the refactor/messagebar-slide branch from 8e80f7a to 3b9ff97 Compare December 13, 2024 16:06
@robertpenner robertpenner force-pushed the refactor/messagebar-slide branch from 55fabac to d4bfcac Compare December 13, 2024 16:16
Copy link
Member

@ling1726 ling1726 left a comment

Choose a reason for hiding this comment

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

Blocking for a breaking change, to make sure it does not accidentally get merged

@robertpenner robertpenner force-pushed the refactor/messagebar-slide branch from 19bcb85 to 551a4a4 Compare December 13, 2024 18:22
@robertpenner robertpenner force-pushed the refactor/messagebar-slide branch from 35cbf40 to 426e458 Compare December 13, 2024 23:41
@ling1726 ling1726 dismissed their stale review December 17, 2024 16:21

blocking issue resolved

@robertpenner robertpenner marked this pull request as ready for review December 18, 2024 04:21
@robertpenner robertpenner requested a review from a team as a code owner December 18, 2024 04:21
@robertpenner robertpenner force-pushed the refactor/messagebar-slide branch from e1b26d4 to 0dc7242 Compare December 18, 2024 17:56
@robertpenner robertpenner force-pushed the refactor/messagebar-slide branch from 0dc7242 to e55b7bb Compare December 18, 2024 17:58
…arMotion component

- Otherwise, when state.animate changes, an elementType will change and React will remount a part of a tree, and children will loose their state
…component

- This helps the React tree reconciliation, by keeping the React element type from changing.
@robertpenner robertpenner enabled auto-merge (squash) December 20, 2024 19:25
@robertpenner robertpenner merged commit 9c716b2 into microsoft:master Dec 20, 2024
16 checks passed
@robertpenner robertpenner deleted the refactor/messagebar-slide branch December 20, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants