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

Using Rewire to unit test private functions #29758

Closed

Conversation

srmukher
Copy link
Contributor

@srmukher srmukher commented Nov 6, 2023

Previous Behavior

New Behavior

Related Issue(s)

  • Fixes #

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 6, 2023

Perf Analysis (@fluentui/react-components)

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

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 635 646 5000
Button mount 320 318 5000
Field mount 1130 1125 5000
FluentProvider mount 717 707 5000
FluentProviderWithTheme mount 77 81 10
FluentProviderWithTheme virtual-rerender 59 66 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 81 74 10
MakeStyles mount 870 862 50000
Persona mount 1744 1752 5000
SpinButton mount 1388 1345 5000

Copy link

codesandbox-ci bot commented Nov 6, 2023

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 57e90ab:

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

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 6, 2023

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
510 B
330 B
global-context
createContextSelector
537 B
342 B
priority-overflow
createOverflowManager
4.341 kB
1.81 kB
react-accordion
Accordion (including children components)
92.983 kB
28.418 kB
react-alert
Alert
84.293 kB
23.456 kB
react-avatar
Avatar
50.534 kB
15.923 kB
react-avatar
AvatarGroup
20.064 kB
7.894 kB
react-avatar
AvatarGroupItem
65.19 kB
20.259 kB
react-badge
Badge
27.264 kB
8.808 kB
react-badge
CounterBadge
28.165 kB
9.101 kB
react-badge
PresenceBadge
25.67 kB
9.313 kB
react-button
Button
40.074 kB
11.292 kB
react-button
CompoundButton
47.43 kB
12.787 kB
react-button
MenuButton
44.848 kB
12.668 kB
react-button
SplitButton
52.862 kB
14.254 kB
react-button
ToggleButton
57.122 kB
13.194 kB
react-calendar-compat
Calendar Compat
141.364 kB
36.841 kB
react-card
Card - All
92.955 kB
26.977 kB
react-card
Card
87.781 kB
25.462 kB
react-card
CardFooter
13.423 kB
5.481 kB
react-card
CardHeader
15.666 kB
6.235 kB
react-card
CardPreview
14.374 kB
5.854 kB
react-checkbox
Checkbox
37.505 kB
12.327 kB
react-combobox
Combobox (including child components)
92.195 kB
30.069 kB
react-combobox
Dropdown (including child components)
90.605 kB
29.726 kB
react-components
react-components: Button, FluentProvider & webLightTheme
70.013 kB
20.17 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
207.755 kB
59.417 kB
react-components
react-components: FluentProvider & webLightTheme
42.297 kB
14.008 kB
react-datepicker-compat
DatePicker Compat
212.982 kB
59.467 kB
react-dialog
Dialog (including children components)
94.473 kB
28.28 kB
react-divider
Divider
21.179 kB
7.839 kB
react-field
Field
22.788 kB
8.639 kB
react-image
Image
16.096 kB
6.317 kB
react-infobutton
InfoButton
131.061 kB
41.305 kB
react-infobutton
InfoLabel
134.745 kB
42.459 kB
react-input
Input
27.247 kB
9.194 kB
react-jsx-runtime
Classic Pragma
1.049 kB
531 B
react-jsx-runtime
JSX Dev Runtime
4.14 kB
1.741 kB
react-jsx-runtime
JSX Runtime
4.734 kB
1.983 kB
react-label
Label
14.508 kB
5.857 kB
react-link
Link
17.4 kB
6.977 kB
react-menu
Menu (including children components)
140.508 kB
43.108 kB
react-menu
Menu (including selectable components)
143.194 kB
43.615 kB
react-message-bar
MessageBar (all components)
25.54 kB
9.102 kB
react-overflow
hooks only
12.598 kB
4.754 kB
react-persona
Persona
57.425 kB
17.798 kB
react-popover
Popover
119.792 kB
37.816 kB
react-portal
Portal
12.4 kB
4.541 kB
react-portal-compat
PortalCompatProvider
6.651 kB
2.252 kB
react-positioning
usePositioning
25.637 kB
9.263 kB
react-progress
ProgressBar
17.788 kB
6.986 kB
react-provider
FluentProvider
22.837 kB
8.434 kB
react-radio
Radio
31.266 kB
10.267 kB
react-radio
RadioGroup
15.704 kB
6.35 kB
react-select
Select
28.968 kB
10.269 kB
react-slider
Slider
38.349 kB
12.595 kB
react-spinbutton
SpinButton
37.133 kB
11.856 kB
react-spinner
Spinner
23.762 kB
8.556 kB
react-switch
Switch
33.731 kB
10.899 kB
react-table
DataGrid
157.084 kB
43.906 kB
react-table
Table (Primitives only)
43.941 kB
13.76 kB
react-table
Table as DataGrid
130.165 kB
35.174 kB
react-table
Table (Selection only)
75.777 kB
20.477 kB
react-table
Table (Sort only)
74.384 kB
20.075 kB
react-tags
InteractionTag
15.618 kB
6.152 kB
react-tags
Tag
30.341 kB
9.505 kB
react-tags
TagGroup
73.816 kB
22.097 kB
react-text
Text - Default
17.065 kB
6.645 kB
react-text
Text - Wrappers
20.237 kB
6.965 kB
react-textarea
Textarea
31.306 kB
10.549 kB
react-theme
Single theme token import
69 B
89 B
react-theme
Teams: all themes
34.616 kB
7.299 kB
react-theme
Teams: Light theme
19.287 kB
5.49 kB
react-timepicker-compat-preview
TimePicker
93.596 kB
31.349 kB
react-toast
Toast (including Toaster)
92.725 kB
27.876 kB
react-tooltip
Tooltip
52.798 kB
18.569 kB
react-utilities
SSRProvider
180 B
159 B
🤖 This report was generated against c139fc66cca05255b5c96f6c92d9230b37975276

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 6, 2023

Perf Analysis (@fluentui/react-northstar)

⚠️ 1 potential perf regressions detected

Potential regressions comparing to master

Scenario Current PR Ticks Baseline Ticks Ratio Regression Analysis
ButtonMinimalPerf.default 87 88 0.99:1 analysis
Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AccordionMinimalPerf.default 82 72 1.14:1
AttachmentMinimalPerf.default 93 83 1.12:1
LayoutMinimalPerf.default 213 198 1.08:1
ListNestedPerf.default 342 317 1.08:1
SegmentMinimalPerf.default 205 189 1.08:1
SkeletonMinimalPerf.default 203 190 1.07:1
FlexMinimalPerf.default 164 154 1.06:1
RosterPerf.default 1624 1538 1.06:1
AvatarMinimalPerf.default 110 105 1.05:1
ListMinimalPerf.default 330 314 1.05:1
PortalMinimalPerf.default 86 82 1.05:1
ReactionMinimalPerf.default 213 203 1.05:1
ChatDuplicateMessagesPerf.default 157 151 1.04:1
ChatWithPopoverPerf.default 198 190 1.04:1
CheckboxMinimalPerf.default 1180 1140 1.04:1
HeaderSlotsPerf.default 472 453 1.04:1
ListCommonPerf.default 384 370 1.04:1
RefMinimalPerf.default 110 106 1.04:1
TableMinimalPerf.default 247 237 1.04:1
CustomToolbarPrototype.default 1497 1436 1.04:1
DatepickerMinimalPerf.default 4158 4027 1.03:1
HeaderMinimalPerf.default 213 206 1.03:1
ListWith60ListItems.default 365 353 1.03:1
ProviderMinimalPerf.default 206 200 1.03:1
StatusMinimalPerf.default 406 394 1.03:1
TableManyItemsPerf.default 1126 1093 1.03:1
BoxMinimalPerf.default 196 193 1.02:1
ButtonSlotsPerf.default 308 303 1.02:1
DialogMinimalPerf.default 452 442 1.02:1
GridMinimalPerf.default 193 189 1.02:1
InputMinimalPerf.default 545 533 1.02:1
ItemLayoutMinimalPerf.default 708 692 1.02:1
LabelMinimalPerf.default 222 217 1.02:1
RadioGroupMinimalPerf.default 262 257 1.02:1
IconMinimalPerf.default 393 385 1.02:1
TextAreaMinimalPerf.default 285 279 1.02:1
ChatMinimalPerf.default 453 447 1.01:1
DropdownMinimalPerf.default 1433 1414 1.01:1
EmbedMinimalPerf.default 1905 1889 1.01:1
ImageMinimalPerf.default 233 230 1.01:1
ToolbarMinimalPerf.default 531 527 1.01:1
FormMinimalPerf.default 227 227 1:1
ProviderMergeThemesPerf.default 656 656 1:1
VideoMinimalPerf.default 443 441 1:1
AttachmentSlotsPerf.default 632 641 0.99:1
SplitButtonMinimalPerf.default 2230 2256 0.99:1
TextMinimalPerf.default 193 195 0.99:1
TreeMinimalPerf.default 463 470 0.99:1
AnimationMinimalPerf.default 300 307 0.98:1
CardMinimalPerf.default 297 302 0.98:1
CarouselMinimalPerf.default 262 266 0.98:1
LoaderMinimalPerf.default 196 199 0.98:1
MenuMinimalPerf.default 495 506 0.98:1
MenuButtonMinimalPerf.default 949 965 0.98:1
TooltipMinimalPerf.default 1281 1302 0.98:1
ButtonOverridesMissPerf.default 662 681 0.97:1
DividerMinimalPerf.default 206 212 0.97:1
DropdownManyItemsPerf.default 390 401 0.97:1
PopupMinimalPerf.default 338 352 0.96:1
SliderMinimalPerf.default 733 762 0.96:1
AlertMinimalPerf.default 162 170 0.95:1
TreeWith60ListItems.default 86 91 0.95:1

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 6, 2023

🕵 FluentUIV0 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 6, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 6, 2023

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 629 627 5000
Breadcrumb mount 1679 1663 1000
Checkbox mount 1706 1684 5000
CheckboxBase mount 1451 1488 5000
ChoiceGroup mount 2931 2968 5000
ComboBox mount 671 649 1000
CommandBar mount 6151 6222 1000
ContextualMenu mount 11962 11832 1000
DefaultButton mount 765 748 5000
DetailsRow mount 2197 2201 5000
DetailsRowFast mount 2154 2171 5000
DetailsRowNoStyles mount 1997 1983 5000
Dialog mount 2640 2822 1000
DocumentCardTitle mount 222 220 1000
Dropdown mount 1964 1962 5000
FocusTrapZone mount 1120 1151 5000
FocusZone mount 1058 1066 5000
GroupedList mount 41281 41154 2
GroupedList virtual-rerender 20139 19828 2
GroupedList virtual-rerender-with-unmount 50339 50858 2
GroupedListV2 mount 222 222 2
GroupedListV2 virtual-rerender 199 216 2
GroupedListV2 virtual-rerender-with-unmount 235 239 2
IconButton mount 1110 1102 5000
Label mount 357 345 5000
Layer mount 2725 2779 5000
Link mount 395 389 5000
MenuButton mount 928 919 5000
MessageBar mount 21291 21315 5000
Nav mount 1943 1935 1000
OverflowSet mount 758 732 5000
Panel mount 2079 1758 1000
Persona mount 732 729 1000
Pivot mount 854 876 1000
PrimaryButton mount 842 840 5000
Rating mount 4593 4585 5000
SearchBox mount 936 919 5000
Shimmer mount 1846 1899 5000
Slider mount 1346 1312 5000
SpinButton mount 2830 2848 5000
Spinner mount 396 383 5000
SplitButton mount 1845 1803 5000
Stack mount 410 416 5000
StackWithIntrinsicChildren mount 852 846 5000
StackWithTextChildren mount 2598 2653 5000
SwatchColorPicker mount 6186 6120 5000
TagPicker mount 1467 1468 5000
Text mount 367 363 5000
TextField mount 940 924 5000
ThemeProvider mount 835 828 5000
ThemeProvider virtual-rerender 579 598 5000
ThemeProvider virtual-rerender-with-unmount 1288 1259 5000
Toggle mount 612 604 5000
buttonNative mount 189 183 5000

Copy link

size-auditor bot commented Nov 7, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: c139fc66cca05255b5c96f6c92d9230b37975276 (build)

@srmukher srmukher force-pushed the users/srmukher/RewireTestInfra branch from 6130fac to 580a64b Compare November 8, 2023 07:47
@fabricteam
Copy link
Collaborator

fabricteam commented Nov 8, 2023

🕵 fluentuiv8 No visual regressions between this PR and main

@srmukher srmukher closed this Jan 3, 2024
@srmukher
Copy link
Contributor Author

srmukher commented Jan 3, 2024

Not needed as we have moved to the new approach of changing the visibility of functions on the fly.

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.

2 participants