Skip to content

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

Merged
Robert Penner (robertpenner) merged 25 commits into
microsoft:masterfrom
robertpenner:refactor/messagebar-slide
Dec 20, 2024
Merged

Robert Penner (robertpenner) merged 25 commits into
microsoft:masterfrom
robertpenner:refactor/messagebar-slide

Conversation

@robertpenner

@robertpenner Robert Penner (robertpenner) commented Dec 13, 2024 •

Copy link
Copy Markdown
Contributor

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)

@github-actions

github-actions Bot commented Dec 13, 2024 •

Copy link
Copy Markdown

📊 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

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@robertpenner Robert Penner (robertpenner) changed the title Refactor/messagebar slide refactor(MessageBar): migrate slide & fade to motion components Dec 13, 2024

@ling1726 ling1726 left a comment

Copy link
Copy Markdown
Contributor

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
Robert Penner (robertpenner) merged commit 9c716b2 into microsoft:master Dec 20, 2024
@robertpenner
Robert Penner (robertpenner) deleted the refactor/messagebar-slide branch December 20, 2024 20:23
Robert Penner (robertpenner) added a commit to robertpenner/fluentui that referenced this pull request Mar 19, 2025
Robert Penner (robertpenner) added a commit to robertpenner/fluentui that referenced this pull request Mar 19, 2025
Robert Penner (robertpenner) added a commit to robertpenner/fluentui that referenced this pull request Sep 9, 2025
- Replace react-transition-group with @fluentui/react-motion components
- Use PresenceGroup and custom MessageBarMotion component
- Create custom fadeAtom and slideAtom motion definitions
- Remove MessageBarTransition.tsx and related CSS animations
- Add deprecation markers for unused properties
- Update to latest motion package versions (react-motion ^9.10.4, react-motion-components-preview ^0.10.0)
- Remove react-transition-group dependency

This restores the motion component refactoring from PR microsoft#33465,
which was reverted due to issue microsoft#33914. The underlying motion
framework bug has been fixed in PR microsoft#34164.
Robert Penner (robertpenner) added a commit to robertpenner/fluentui that referenced this pull request Sep 15, 2025
- Replace react-transition-group with @fluentui/react-motion components
- Use PresenceGroup and custom MessageBarMotion component
- Create custom fadeAtom and slideAtom motion definitions
- Remove MessageBarTransition.tsx and related CSS animations
- Add deprecation markers for unused properties
- Update to latest motion package versions (react-motion ^9.10.4, react-motion-components-preview ^0.10.0)
- Remove react-transition-group dependency

This restores the motion component refactoring from PR microsoft#33465,
which was reverted due to issue microsoft#33914. The underlying motion
framework bug has been fixed in PR microsoft#34164.
Robert Penner (robertpenner) added a commit to robertpenner/fluentui that referenced this pull request Sep 23, 2025
- Replace react-transition-group with @fluentui/react-motion components
- Use PresenceGroup and custom MessageBarMotion component
- Create custom fadeAtom and slideAtom motion definitions
- Remove MessageBarTransition.tsx and related CSS animations
- Add deprecation markers for unused properties
- Update to latest motion package versions (react-motion ^9.10.4, react-motion-components-preview ^0.10.0)
- Remove react-transition-group dependency

This restores the motion component refactoring from PR microsoft#33465,
which was reverted due to issue microsoft#33914. The underlying motion
framework bug has been fixed in PR microsoft#34164.
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