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

Updated ChoiceGroup to allow callbacks to define one prop type #25475

Merged

Conversation

GeoffCoxMSFT
Copy link
Member

Issue

Previous PR #24242 used a union of the IChoiceGroupOption and IChoiceGroupOptionProps types for the parameter in callbacks. This was to try and avoid a breaking change between v7 and v8. However, it forced callback definers to have to support both types.

Changes

  • changed from union of params to intersection to allow callbacks to accepted either type or both
  • updated ChoiceGroup to callback with the intersected object type.

@GeoffCoxMSFT GeoffCoxMSFT self-assigned this Nov 1, 2022
@GeoffCoxMSFT GeoffCoxMSFT requested review from a team as code owners November 1, 2022 20:53
@GeoffCoxMSFT GeoffCoxMSFT changed the title Updated to ease defining callbacks of one prop type Updated ChoiceGroup to allow callbacks to define one prop type Nov 1, 2022
@github-actions github-actions bot added this to the October Project Cycle Q4 2022 milestone Nov 1, 2022
@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 1, 2022

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.

Latest deployment of this branch, based on commit cb1fea9:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Nov 1, 2022

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-ChoiceGroupOption 55.516 kB 55.616 kB ExceedsBaseline     100 bytes
office-ui-fabric-react fluentui-react-ChoiceGroup 61.726 kB 61.826 kB ExceedsBaseline     100 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: c619ba066f11a8654e95375314824ba6b81b003e (build)

@fabricteam
Copy link
Collaborator

📊 Bundle size report

🤖 This report was generated against c619ba066f11a8654e95375314824ba6b81b003e

@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react)

Scenario Render type Master Ticks PR Ticks Iterations Status
GroupedList mount 2414 2694 2 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 1473 1504 5000
Breadcrumb mount 3669 3625 1000
Checkbox mount 3314 3379 5000
CheckboxBase mount 2957 2958 5000
ChoiceGroup mount 5572 5631 5000
ComboBox mount 1518 1552 1000
CommandBar mount 11971 11772 1000
ContextualMenu mount 13827 13610 1000
DefaultButton mount 1730 1705 5000
DetailsRow mount 4581 4551 5000
DetailsRowFast mount 4470 4557 5000
DetailsRowNoStyles mount 4256 4361 5000
Dialog mount 3842 3843 1000
DocumentCardTitle mount 743 733 1000
Dropdown mount 4106 4043 5000
FocusTrapZone mount 2467 2567 5000
FocusZone mount 2437 2451 5000
GroupedList mount 2414 2694 2 Possible regression
GroupedList virtual-rerender 1417 1405 2
GroupedList virtual-rerender-with-unmount 2150 2083 2
GroupedListV2 mount 726 708 2
GroupedListV2 virtual-rerender 709 685 2
GroupedListV2 virtual-rerender-with-unmount 745 731 2
IconButton mount 2470 2434 5000
Label mount 926 932 5000
Layer mount 5293 5395 5000
Link mount 1062 1029 5000
MenuButton mount 2114 2122 5000
MessageBar mount 2922 2951 5000
Nav mount 4174 4119 1000
OverflowSet mount 1736 1710 5000
Panel mount 3137 3180 1000
Persona mount 1595 1608 1000
Pivot mount 2032 2071 1000
PrimaryButton mount 1896 1867 5000
Rating mount 8773 8832 5000
SearchBox mount 1880 1885 5000
Shimmer mount 3554 3571 5000
Slider mount 2579 2688 5000
SpinButton mount 5735 5858 5000
Spinner mount 1007 971 5000
SplitButton mount 3961 3970 5000
Stack mount 1027 1068 5000
StackWithIntrinsicChildren mount 2923 3066 5000
StackWithTextChildren mount 6159 6060 5000
SwatchColorPicker mount 13130 13050 5000
TagPicker mount 3402 3352 5000
TeachingBubble mount 105899 105597 5000
Text mount 1006 1005 5000
TextField mount 1989 2036 5000
ThemeProvider mount 1933 1913 5000
ThemeProvider virtual-rerender 1364 1328 5000
ThemeProvider virtual-rerender-with-unmount 2712 2691 5000
Toggle mount 1395 1339 5000
buttonNative mount 674 674 5000

@GeoffCoxMSFT GeoffCoxMSFT merged commit f5a12b3 into microsoft:master Nov 3, 2022
NotWoods pushed a commit to NotWoods/fluentui that referenced this pull request Nov 18, 2022
…soft#25475)

* Updated to ease defining callbacks of one prop type

* yarn change
Hotell pushed a commit to Hotell/fluentui that referenced this pull request Feb 9, 2023
…soft#25475)

* Updated to ease defining callbacks of one prop type

* yarn change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants