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

breaking(react-motions): AtomMotionFn & PresenceMotionFn have an object as param #31508

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented May 29, 2024

BREAKING CHANGES

This PR changes AtomMotionFn & PresenceMotionFn:

-type AtomMotionFn = (element: HTMLElement) => AtomMotion;
-type PresenceMotionFn = (element: HTMLElement) => PresenceMotion;
+type AtomMotionFn = (params: { element: HTMLElement }) => AtomMotion;
+type PresenceMotionFn = (params: { element: HTMLElement }) => PresenceMotion;

The motivation is to have an opportunity to extend it with additional params while element may not be used i.e.:

const Motion = createMotionComponent(({ someNonImplementedParam }) => {
  /* --- */
});

Previous Behavior

const Motion = createMotionComponent(element => {
  /* --- */
});
const PresenceMotion = createPresenceComponent(element => {
  /* --- */
});

New Behavior

const Motion = createMotionComponent(({ element }) => {
  /* --- */
});
const PresenceMotion = createPresenceComponent(({ element }) => {
  /* --- */
});

@github-actions github-actions bot added this to the April Project Cycle Q1 2024 milestone May 29, 2024
Copy link

codesandbox-ci bot commented May 29, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@fabricteam
Copy link
Collaborator

fabricteam commented May 29, 2024

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender 40 31 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 622 661 5000
Button mount 316 302 5000
Field mount 1139 1177 5000
FluentProvider mount 708 719 5000
FluentProviderWithTheme mount 87 94 10
FluentProviderWithTheme virtual-rerender 40 31 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 75 76 10
MakeStyles mount 878 854 50000
Persona mount 1804 1698 5000
SpinButton mount 1395 1380 5000
SwatchPicker mount 1556 1547 5000

@fabricteam
Copy link
Collaborator

fabricteam commented May 29, 2024

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.092 MB
269.561 kB
1.092 MB
269.57 kB
22 B
9 B
react-dialog
Dialog (including children components)
99.303 kB
29.994 kB
99.313 kB
29.997 kB
10 B
3 B
react-toast
Toast (including Toaster)
97.846 kB
29.51 kB
97.868 kB
29.513 kB
22 B
3 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.141 kB
20.157 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
212.631 kB
61.228 kB
react-components
react-components: FluentProvider & webLightTheme
44.442 kB
14.607 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
🤖 This report was generated against 4bfb1ed821f4adfd09d9264d8ced262d6e040175

@layershifter layershifter marked this pull request as ready for review May 29, 2024 14:30
@layershifter layershifter requested a review from a team as a code owner May 29, 2024 14:30
@layershifter layershifter merged commit bfcc1ca into microsoft:master Jun 4, 2024
20 checks passed
@layershifter layershifter deleted the chore/motion-element branch June 4, 2024 16:03
miroslavstastny pushed a commit to miroslavstastny/fluentui that referenced this pull request Jun 14, 2024
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