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

Add size check to react-northstar build #16686

Merged
merged 51 commits into from
Feb 16, 2021

Conversation

petdud
Copy link
Contributor

@petdud petdud commented Jan 28, 2021

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ yarn change

Description of changes

Bundle size auditor for Fabric is broken since the update to Webpack 5 due to the Tree shaking. This PR is fixing this by creating new file with component import and console log + adding N* to the auditor check.

(give an overview)

Focus areas to test

(optional)

@size-auditor
Copy link

size-auditor bot commented Jan 28, 2021

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-Pickers New   266.448 kB ExceedsTolerance     266.448 kB
office-ui-fabric-react fluentui-react-ComboBox New   229.063 kB ExceedsTolerance     229.063 kB
office-ui-fabric-react fluentui-react-FloatingPicker New   223.755 kB ExceedsTolerance     223.755 kB
office-ui-fabric-react fluentui-react-ShimmeredDetailsList New   216.539 kB ExceedsTolerance     216.539 kB
office-ui-fabric-react fluentui-react-Dropdown New   214.879 kB ExceedsTolerance     214.879 kB
office-ui-fabric-react fluentui-react-SelectedItemsList New   213.354 kB ExceedsTolerance     213.354 kB
office-ui-fabric-react fluentui-react-northstar-Dropdown New   211.319 kB ExceedsTolerance     211.319 kB
office-ui-fabric-react fluentui-react-DetailsList New   205.571 kB ExceedsTolerance     205.571 kB
office-ui-fabric-react fluentui-react-northstar-Datepicker New   204.643 kB ExceedsTolerance     204.643 kB
office-ui-fabric-react fluentui-react-DocumentCard New   198.543 kB ExceedsTolerance     198.543 kB
office-ui-fabric-react fluentui-react-Dialog New   193.802 kB ExceedsTolerance     193.802 kB
office-ui-fabric-react fluentui-react-Facepile New   193.127 kB ExceedsTolerance     193.127 kB
office-ui-fabric-react fluentui-react-northstar-SplitButton New   189.625 kB ExceedsTolerance     189.625 kB
office-ui-fabric-react fluentui-react-TeachingBubble New   188.191 kB ExceedsTolerance     188.191 kB
office-ui-fabric-react fluentui-react-northstar-Toolbar New   187.36 kB ExceedsTolerance     187.36 kB
office-ui-fabric-react fluentui-react-CommandBar New   184.483 kB ExceedsTolerance     184.483 kB
office-ui-fabric-react fluentui-react-Panel New   183.694 kB ExceedsTolerance     183.694 kB
office-ui-fabric-react fluentui-react-Breadcrumb New   182.986 kB ExceedsTolerance     182.986 kB
office-ui-fabric-react fluentui-react-Button New   178.313 kB ExceedsTolerance     178.313 kB
office-ui-fabric-react fluentui-react-northstar-MenuButton New   176.876 kB ExceedsTolerance     176.876 kB
office-ui-fabric-react fluentui-react-SpinButton New   175.182 kB ExceedsTolerance     175.182 kB
office-ui-fabric-react fluentui-react-SwatchColorPicker New   173.987 kB ExceedsTolerance     173.987 kB
office-ui-fabric-react fluentui-react-Nav New   172.432 kB ExceedsTolerance     172.432 kB
office-ui-fabric-react fluentui-react-Pivot New   172.359 kB ExceedsTolerance     172.359 kB
office-ui-fabric-react fluentui-react-MessageBar New   172.093 kB ExceedsTolerance     172.093 kB
office-ui-fabric-react fluentui-react-SearchBox New   171.033 kB ExceedsTolerance     171.033 kB
office-ui-fabric-react fluentui-react-DatePicker New   166.533 kB ExceedsTolerance     166.533 kB
office-ui-fabric-react fluentui-react-Grid New   164.487 kB ExceedsTolerance     164.487 kB
office-ui-fabric-react fluentui-react-ButtonGrid New   164.487 kB ExceedsTolerance     164.487 kB
office-ui-fabric-react fluentui-react-northstar-Chat New   157.624 kB ExceedsTolerance     157.624 kB
office-ui-fabric-react fluentui-react-northstar-Popup New   145.892 kB ExceedsTolerance     145.892 kB
office-ui-fabric-react fluentui-react-northstar-Menu New   142.41 kB ExceedsTolerance     142.41 kB
office-ui-fabric-react fluentui-react-ContextualMenu New   140.742 kB ExceedsTolerance     140.742 kB
office-ui-fabric-react fluentui-react-northstar-Dialog New   126.824 kB ExceedsTolerance     126.824 kB
office-ui-fabric-react fluentui-react-northstar-Carousel New   121.469 kB ExceedsTolerance     121.469 kB
office-ui-fabric-react fluentui-react-northstar-Tooltip New   120.731 kB ExceedsTolerance     120.731 kB
office-ui-fabric-react fluentui-react-GroupedList New   115.693 kB ExceedsTolerance     115.693 kB
office-ui-fabric-react fluentui-react-Calendar New   110.704 kB ExceedsTolerance     110.704 kB
office-ui-fabric-react fluentui-react-northstar-Form New   109.134 kB ExceedsTolerance     109.134 kB
office-ui-fabric-react fluentui-react-northstar-Tree New   106.544 kB ExceedsTolerance     106.544 kB
office-ui-fabric-react fluentui-react-northstar-List New   105.81 kB ExceedsTolerance     105.81 kB
office-ui-fabric-react fluentui-react-northstar-Alert New   104.528 kB ExceedsTolerance     104.528 kB
office-ui-fabric-react fluentui-react-northstar-Attachment New   104.071 kB ExceedsTolerance     104.071 kB
office-ui-fabric-react fluentui-react-northstar-Accordion New   102.672 kB ExceedsTolerance     102.672 kB
office-ui-fabric-react fluentui-react-PersonaCoin New   102.158 kB ExceedsTolerance     102.158 kB
office-ui-fabric-react fluentui-react-Persona New   102.158 kB ExceedsTolerance     102.158 kB
office-ui-fabric-react fluentui-react-northstar-Provider New   101.154 kB ExceedsTolerance     101.154 kB
office-ui-fabric-react fluentui-react-northstar-Slider New   101.134 kB ExceedsTolerance     101.134 kB
office-ui-fabric-react fluentui-react-northstar-RadioGroup New   100.442 kB ExceedsTolerance     100.442 kB
office-ui-fabric-react fluentui-react-northstar-Button New   99.866 kB ExceedsTolerance     99.866 kB
office-ui-fabric-react fluentui-react-northstar-Input New   99.8 kB ExceedsTolerance     99.8 kB
office-ui-fabric-react fluentui-react-northstar-Card New   99.436 kB ExceedsTolerance     99.436 kB
office-ui-fabric-react fluentui-react-northstar-Embed New   98.222 kB ExceedsTolerance     98.222 kB
office-ui-fabric-react fluentui-react-northstar-Table New   97.657 kB ExceedsTolerance     97.657 kB
office-ui-fabric-react fluentui-react-northstar-Checkbox New   96.767 kB ExceedsTolerance     96.767 kB
office-ui-fabric-react fluentui-react-northstar-Breadcrumb New   96.74 kB ExceedsTolerance     96.74 kB
office-ui-fabric-react fluentui-react-northstar-Avatar New   95.817 kB ExceedsTolerance     95.817 kB
office-ui-fabric-react fluentui-react-northstar-Loader New   95.012 kB ExceedsTolerance     95.012 kB
office-ui-fabric-react fluentui-react-northstar-ItemLayout New   94.659 kB ExceedsTolerance     94.659 kB
office-ui-fabric-react fluentui-react-northstar-Label New   94.364 kB ExceedsTolerance     94.364 kB
office-ui-fabric-react fluentui-react-northstar-Skeleton New   94.189 kB ExceedsTolerance     94.189 kB
office-ui-fabric-react fluentui-react-northstar-Reaction New   93.792 kB ExceedsTolerance     93.792 kB
office-ui-fabric-react fluentui-react-Keytips New   93.538 kB ExceedsTolerance     93.538 kB
office-ui-fabric-react fluentui-react-northstar-Divider New   93.044 kB ExceedsTolerance     93.044 kB
office-ui-fabric-react fluentui-react-northstar-Status New   92.674 kB ExceedsTolerance     92.674 kB
office-ui-fabric-react fluentui-react-northstar-Segment New   92.551 kB ExceedsTolerance     92.551 kB
office-ui-fabric-react fluentui-react-WeeklyDayPicker New   92.106 kB ExceedsTolerance     92.106 kB
office-ui-fabric-react fluentui-react-northstar-Box New   91.434 kB ExceedsTolerance     91.434 kB
office-ui-fabric-react fluentui-react-northstar-Layout New   91.35 kB ExceedsTolerance     91.35 kB
office-ui-fabric-react fluentui-react-northstar-Video New   91.291 kB ExceedsTolerance     91.291 kB
office-ui-fabric-react fluentui-react-KeytipLayer New   91.112 kB ExceedsTolerance     91.112 kB
office-ui-fabric-react fluentui-react-northstar-Header New   90.682 kB ExceedsTolerance     90.682 kB
office-ui-fabric-react fluentui-react-northstar-TextArea New   90.131 kB ExceedsTolerance     90.131 kB
office-ui-fabric-react fluentui-react-northstar-Text New   89.904 kB ExceedsTolerance     89.904 kB
office-ui-fabric-react fluentui-react-northstar-Image New   89.405 kB ExceedsTolerance     89.405 kB
office-ui-fabric-react fluentui-react-HoverCard New   87.03 kB ExceedsTolerance     87.03 kB
office-ui-fabric-react fluentui-react-ExtendedPicker New   86.987 kB ExceedsTolerance     86.987 kB
office-ui-fabric-react fluentui-react-northstar-Grid New   86.138 kB ExceedsTolerance     86.138 kB
office-ui-fabric-react fluentui-react-Modal New   84.669 kB ExceedsTolerance     84.669 kB
office-ui-fabric-react fluentui-react-ColorPicker New   84.007 kB ExceedsTolerance     84.007 kB
office-ui-fabric-react fluentui-react-Coachmark New   83.188 kB ExceedsTolerance     83.188 kB
office-ui-fabric-react fluentui-react-Tooltip New   75.417 kB ExceedsTolerance     75.417 kB
office-ui-fabric-react fluentui-react-Callout New   74.478 kB ExceedsTolerance     74.478 kB
office-ui-fabric-react fluentui-react-TextField New   72.998 kB ExceedsTolerance     72.998 kB
office-ui-fabric-react fluentui-react-Rating New   70.936 kB ExceedsTolerance     70.936 kB
office-ui-fabric-react fluentui-react-Keytip New   70.592 kB ExceedsTolerance     70.592 kB
office-ui-fabric-react fluentui-react-MarqueeSelection New   65.137 kB ExceedsTolerance     65.137 kB
office-ui-fabric-react fluentui-react-Utilities 247 bytes 65.027 kB ExceedsTolerance     64.78 kB
office-ui-fabric-react fluentui-react-ActivityItem New   64.667 kB ExceedsTolerance     64.667 kB
office-ui-fabric-react fluentui-react-PositioningContainer New   64.391 kB ExceedsTolerance     64.391 kB
office-ui-fabric-react fluentui-react-northstar-Portal New   63.057 kB ExceedsTolerance     63.057 kB
office-ui-fabric-react fluentui-react-Icons New   61.842 kB ExceedsTolerance     61.842 kB
office-ui-fabric-react fluentui-react-northstar-Animation New   59.113 kB ExceedsTolerance     59.113 kB
office-ui-fabric-react fluentui-react-ChoiceGroup New   56.717 kB ExceedsTolerance     56.717 kB
office-ui-fabric-react fluentui-react-northstar-Flex New   54.725 kB ExceedsTolerance     54.725 kB
office-ui-fabric-react fluentui-react-Checkbox New   52.612 kB ExceedsTolerance     52.612 kB
office-ui-fabric-react fluentui-react-ChoiceGroupOption New   52.466 kB ExceedsTolerance     52.466 kB
office-ui-fabric-react fluentui-react-PersonaPresence New   51.873 kB ExceedsTolerance     51.873 kB
office-ui-fabric-react fluentui-react-ScrollablePane New   50.219 kB ExceedsTolerance     50.219 kB
office-ui-fabric-react fluentui-react-FocusZone New   48.938 kB ExceedsTolerance     48.938 kB
office-ui-fabric-react fluentui-react-Slider New   48.613 kB ExceedsTolerance     48.613 kB
office-ui-fabric-react fluentui-react-Check New   46.959 kB ExceedsTolerance     46.959 kB
office-ui-fabric-react fluentui-react-Icon New   45.452 kB ExceedsTolerance     45.452 kB
office-ui-fabric-react fluentui-react-northstar-SvgIcon New   43.906 kB ExceedsTolerance     43.906 kB
office-ui-fabric-react fluentui-react-Shimmer New   43.683 kB ExceedsTolerance     43.683 kB
office-ui-fabric-react fluentui-react-northstar-Design New   43.144 kB ExceedsTolerance     43.144 kB
office-ui-fabric-react fluentui-react-Image New   40.529 kB ExceedsTolerance     40.529 kB
office-ui-fabric-react fluentui-react-Layer 247 bytes 40.774 kB ExceedsTolerance     40.527 kB
office-ui-fabric-react fluentui-react-Toggle New   40.049 kB ExceedsTolerance     40.049 kB
office-ui-fabric-react fluentui-react-Theme New   39.496 kB ExceedsTolerance     39.496 kB
office-ui-fabric-react fluentui-react-Fabric New   37.193 kB ExceedsTolerance     37.193 kB
office-ui-fabric-react fluentui-react-Selection New   37.15 kB ExceedsTolerance     37.15 kB
office-ui-fabric-react fluentui-react-Spinner New   36.629 kB ExceedsTolerance     36.629 kB
office-ui-fabric-react fluentui-react-List New   36.429 kB ExceedsTolerance     36.429 kB
office-ui-fabric-react fluentui-react-Overlay New   35.839 kB ExceedsTolerance     35.839 kB
office-ui-fabric-react fluentui-react-Stack New   35.837 kB ExceedsTolerance     35.837 kB
office-ui-fabric-react fluentui-react-ProgressIndicator New   33.943 kB ExceedsTolerance     33.943 kB
office-ui-fabric-react fluentui-react-Announced New   33.519 kB ExceedsTolerance     33.519 kB
office-ui-fabric-react fluentui-react-Label New   33.411 kB ExceedsTolerance     33.411 kB
office-ui-fabric-react fluentui-react-Link 247 bytes 33.065 kB ExceedsTolerance     32.818 kB
office-ui-fabric-react fluentui-react-Text New   32.169 kB ExceedsTolerance     32.169 kB
office-ui-fabric-react fluentui-react-Separator New   29.781 kB ExceedsTolerance     29.781 kB
office-ui-fabric-react fluentui-react-OverflowSet New   29.066 kB ExceedsTolerance     29.066 kB
office-ui-fabric-react fluentui-react-Sticky New   28.661 kB ExceedsTolerance     28.661 kB
office-ui-fabric-react fluentui-react-Styling 19.95 kB 41.046 kB ExceedsTolerance     21.096 kB
office-ui-fabric-react fluentui-react-Positioning New   18.752 kB ExceedsTolerance     18.752 kB
office-ui-fabric-react fluentui-react-northstar-Debug New   17.093 kB ExceedsTolerance     17.093 kB
office-ui-fabric-react fluentui-react-Divider New   16.321 kB ExceedsTolerance     16.321 kB
office-ui-fabric-react fluentui-react-Autofill New   15.09 kB ExceedsTolerance     15.09 kB
office-ui-fabric-react fluentui-react-FocusTrapZone New   14.905 kB ExceedsTolerance     14.905 kB
office-ui-fabric-react fluentui-react-ResizeGroup New   12.964 kB ExceedsTolerance     12.964 kB
office-ui-fabric-react fluentui-react-KeytipData New   12.27 kB ExceedsTolerance     12.27 kB
office-ui-fabric-react fluentui-react-ThemeGenerator New   11.715 kB ExceedsTolerance     11.715 kB
office-ui-fabric-react fluentui-react-Popup New   11.026 kB ExceedsTolerance     11.026 kB
office-ui-fabric-react fluentui-react-DragDrop New   8.27 kB ExceedsTolerance     8.27 kB
office-ui-fabric-react fluentui-react-Color New   6.786 kB ExceedsTolerance     6.786 kB
office-ui-fabric-react react-compose 255 bytes 5.297 kB ExceedsTolerance     5.042 kB
office-ui-fabric-react fluentui-react-DateTimeUtilities New   4.729 kB ExceedsTolerance     4.729 kB
office-ui-fabric-react keyboard-key 1.978 kB 3.746 kB ExceedsTolerance     1.768 kB
office-ui-fabric-react fluentui-react-WindowProvider 247 bytes 1.016 kB ExceedsBaseline     769 bytes
office-ui-fabric-react fluentui-react-SelectableOption New   631 bytes ExceedsBaseline     631 bytes

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

Baseline commit: 6896697d21ee038e3a4921b033d5f1f68537aed0 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Jan 28, 2021

Perf Analysis

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 814 887 5000
BaseButton mount 911 919 5000
Breadcrumb mount 44089 43820 5000
ButtonNext mount 687 757 5000
Checkbox mount 1546 1579 5000
CheckboxBase mount 1350 1284 5000
ChoiceGroup mount 4792 4791 5000
ComboBox mount 1001 962 1000
CommandBar mount 10276 10472 1000
ContextualMenu mount 6303 6313 1000
DefaultButton mount 1138 1130 5000
DetailsRow mount 3672 3686 5000
DetailsRowFast mount 3782 3766 5000
DetailsRowNoStyles mount 3514 3472 5000
Dialog mount 1502 1745 1000
DocumentCardTitle mount 1886 1905 1000
Dropdown mount 3368 3370 5000
FocusTrapZone mount 1797 1881 5000
FocusZone mount 1848 1871 5000
IconButton mount 1797 1802 5000
Label mount 355 336 5000
Layer mount 1820 1874 5000
Link mount 483 477 5000
MakeStyles mount 2008 2008 50000
MenuButton mount 1602 1426 5000
MessageBar mount 2103 2039 5000
Nav mount 3407 3270 1000
OverflowSet mount 1069 1055 5000
Panel mount 1483 1483 1000
Persona mount 873 819 1000
Pivot mount 1439 1530 1000
PrimaryButton mount 1325 1314 5000
Rating mount 7524 7736 5000
SearchBox mount 1315 1368 5000
Shimmer mount 2621 2515 5000
Slider mount 1984 1933 5000
SpinButton mount 5159 5094 5000
Spinner mount 440 395 5000
SplitButton mount 3267 3201 5000
Stack mount 509 491 5000
StackWithIntrinsicChildren mount 1528 1612 5000
StackWithTextChildren mount 4491 4611 5000
SwatchColorPicker mount 10466 10335 5000
Tabs mount 1438 1443 1000
TagPicker mount 2889 2867 5000
TeachingBubble mount 11984 11804 5000
Text mount 400 418 5000
TextField mount 1420 1418 5000
ThemeProvider mount 1240 1235 5000
ThemeProvider virtual-rerender 623 614 5000
ThemeProviderNext mount 2045 2046 5000
Toggle mount 811 827 5000
buttonNative mount 110 111 5000

Perf Analysis (Fluent)

Perf comparison
Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🦄 Avatar.Fluent 0.19 0.5 0.38:1 2000 388
🦄 Button.Fluent 0.12 0.2 0.6:1 5000 612
🔧 Checkbox.Fluent 0.68 0.37 1.84:1 1000 677
🎯 Dialog.Fluent 0.16 0.22 0.73:1 5000 812
🔧 Dropdown.Fluent 3.33 0.41 8.12:1 1000 3334
🔧 Icon.Fluent 0.15 0.07 2.14:1 5000 758
🦄 Image.Fluent 0.08 0.13 0.62:1 5000 391
🔧 Slider.Fluent 1.62 0.47 3.45:1 1000 1616
🔧 Text.Fluent 0.08 0.03 2.67:1 5000 376
🦄 Tooltip.Fluent 0.12 0.91 0.13:1 5000 595

🔧 Needs work     🎯 On target     🦄 Amazing

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AccordionMinimalPerf.default 193 164 1.18:1
Avatar.Fluent 388 340 1.14:1
TooltipMinimalPerf.default 936 833 1.12:1
CardMinimalPerf.default 606 548 1.11:1
ButtonMinimalPerf.default 217 197 1.1:1
ListNestedPerf.default 673 618 1.09:1
ButtonSlotsPerf.default 614 570 1.08:1
ToolbarMinimalPerf.default 1038 964 1.08:1
TreeWith60ListItems.default 200 186 1.08:1
Checkbox.Fluent 677 629 1.08:1
ChatDuplicateMessagesPerf.default 426 399 1.07:1
ProviderMinimalPerf.default 1063 994 1.07:1
SkeletonMinimalPerf.default 428 400 1.07:1
TreeMinimalPerf.default 873 815 1.07:1
DividerMinimalPerf.default 413 391 1.06:1
PortalMinimalPerf.default 209 198 1.06:1
TableMinimalPerf.default 466 441 1.06:1
Dropdown.Fluent 3334 3138 1.06:1
CustomToolbarPrototype.default 4112 3917 1.05:1
Icon.Fluent 758 722 1.05:1
AnimationMinimalPerf.default 434 417 1.04:1
CarouselMinimalPerf.default 536 513 1.04:1
HeaderSlotsPerf.default 836 807 1.04:1
PopupMinimalPerf.default 776 746 1.04:1
SegmentMinimalPerf.default 399 382 1.04:1
Tooltip.Fluent 595 572 1.04:1
AvatarMinimalPerf.default 214 208 1.03:1
EmbedMinimalPerf.default 4441 4307 1.03:1
FormMinimalPerf.default 452 438 1.03:1
MenuMinimalPerf.default 954 929 1.03:1
FlexMinimalPerf.default 339 333 1.02:1
HeaderMinimalPerf.default 391 385 1.02:1
ListCommonPerf.default 705 690 1.02:1
MenuButtonMinimalPerf.default 1673 1633 1.02:1
StatusMinimalPerf.default 773 761 1.02:1
AttachmentMinimalPerf.default 170 169 1.01:1
ListMinimalPerf.default 545 541 1.01:1
SplitButtonMinimalPerf.default 3961 3930 1.01:1
DropdownMinimalPerf.default 3169 3184 1:1
ItemLayoutMinimalPerf.default 1309 1311 1:1
CheckboxMinimalPerf.default 2937 2969 0.99:1
DialogMinimalPerf.default 806 815 0.99:1
RadioGroupMinimalPerf.default 470 475 0.99:1
IconMinimalPerf.default 750 759 0.99:1
AttachmentSlotsPerf.default 1256 1279 0.98:1
ButtonUseCssPerf.default 844 865 0.98:1
ChatWithPopoverPerf.default 512 520 0.98:1
DropdownManyItemsPerf.default 739 752 0.98:1
ListWith60ListItems.default 661 672 0.98:1
ReactionMinimalPerf.default 419 428 0.98:1
SliderMinimalPerf.default 1601 1638 0.98:1
TextMinimalPerf.default 394 402 0.98:1
Image.Fluent 391 399 0.98:1
ButtonOverridesMissPerf.default 1714 1765 0.97:1
ButtonUseCssNestingPerf.default 1127 1159 0.97:1
DatepickerMinimalPerf.default 49436 50722 0.97:1
InputMinimalPerf.default 1324 1365 0.97:1
LabelMinimalPerf.default 455 470 0.97:1
LoaderMinimalPerf.default 754 777 0.97:1
ProviderMergeThemesPerf.default 1633 1689 0.97:1
TableManyItemsPerf.default 2094 2167 0.97:1
VideoMinimalPerf.default 662 685 0.97:1
RefMinimalPerf.default 244 254 0.96:1
Slider.Fluent 1616 1690 0.96:1
ChatMinimalPerf.default 692 728 0.95:1
TextAreaMinimalPerf.default 545 578 0.94:1
Button.Fluent 612 650 0.94:1
Dialog.Fluent 812 865 0.94:1
Text.Fluent 376 402 0.94:1
AlertMinimalPerf.default 295 318 0.93:1
ImageMinimalPerf.default 399 430 0.93:1
LayoutMinimalPerf.default 437 469 0.93:1
RosterPerf.default 1158 1259 0.92:1
BoxMinimalPerf.default 386 425 0.91:1
GridMinimalPerf.default 378 430 0.88:1

petdud and others added 2 commits January 28, 2021 15:20
Co-authored-by: Oleksandr Fediashov <alexander.mcgarret@gmail.com>
Co-authored-by: Oleksandr Fediashov <alexander.mcgarret@gmail.com>
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 28, 2021

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 e056ee6:

Sandbox Source
Fluent UI Button Configuration
codesandbox-react-template Configuration
codesandbox-react-northstar-template Configuration

Copy link
Member

@ecraig12345 ecraig12345 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this but since size auditor is already our longest build, we'll need to split the v0 and v8 parts into separate parallel jobs for this to be feasible. Will comment back with specific instructions later.

ecraig12345
ecraig12345 previously approved these changes Jan 29, 2021
Copy link
Member

@ecraig12345 ecraig12345 left a comment

Choose a reason for hiding this comment

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

Huh...just took a look at the build times, and it appears that switching to webpack 5 somehow reduced the bundling step from 22 minutes to 1 minute?? So I guess this is fine as-is now.
image

@petdud
Copy link
Contributor Author

petdud commented Feb 3, 2021

Huh...just took a look at the build times, and it appears that switching to webpack 5 somehow reduced the bundling step from 22 minutes to 1 minute?? So I guess this is fine as-is now.

Hi @ecraig12345 the webpack upgrade actually breaks the size-auditor. I pushed new changes that should fix it for fabric + added N* components in it. Splitting it into separate jobs would be welcome for reducing the time

@ecraig12345
Copy link
Member

Hi @ecraig12345 Elizabeth Craig FTE the webpack upgrade actually breaks the size-auditor. I pushed new changes that should fix it for fabric + added N* components in it. Splitting it into separate jobs would be welcome for reducing the time

Ah okay... 😬 @dzearing should take a look at your changes since he did the webpack upgrade.

@ecraig12345
Copy link
Member

ecraig12345 commented Feb 3, 2021

Here's what needs to happen to split the jobs.

A couple easy parts first:

  • In apps/test-bundles/webpack.config.js, add a command line arg --package (or whatever you want to call it) for determining the package to test.
  • Remove test-bundles dependencies on all component packages. Otherwise I'm not sure how to make each parallel job build only the packages that are needed.

(As an alternative to both of these, I guess you could add a separate package test-bundles-northstar if that seems better?)

Next split up the build job in azure-pipelines.bundlesize.yml into two new jobs, build-react and build-northstar (or other names if you prefer):

jobs:
  - job: build-react
    timeoutInMinutes: 75
    pool:
      vmImage: 'windows-2019'
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: '12.x'
        displayName: 'Install Node.js'

      - script: npx midgard-yarn install
        displayName: yarn

      - script: yarn build --to @fluentui/react @fluentui/react-button @fluentui/react-compose --no-cache
        displayName: yarn build to @fluentui/react

      - script: yarn workspace test-bundles bundle:size --package @fluentui/react
        displayName: yarn bundle test-bundles

      - script: yarn bundlesizecollect
        displayName: 'Collate Bundle Size Information'

      - task: PublishBuildArtifacts@1
        displayName: 'Publish Bundle Size information to Azure Dev Ops Artifacts'
        inputs:
          PathtoPublish: 'apps/test-bundles/dist/bundlesizes.json'
          ArtifactName: bundlesizes-react

      - task: PublishBuildArtifacts@1
        displayName: 'Publish Artifact dist folder upon build for debug'
        inputs:
          PathtoPublish: 'apps/test-bundles/dist'
          ArtifactName: distdrop-react

  - job: build-northstar
    timeoutInMinutes: 75
    pool:
      vmImage: 'windows-2019'
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: '12.x'
        displayName: 'Install Node.js'

      - script: npx midgard-yarn install
        displayName: yarn

      - script: yarn build --to @fluentui/react-northstar --no-cache
        displayName: yarn build to @fluentui/react-northstar

      - script: yarn workspace test-bundles bundle:size --package @fluentui/react-northstar
        displayName: yarn bundle test-bundles

      - script: yarn bundlesizecollect
        displayName: 'Collate Bundle Size Information'

      - task: PublishBuildArtifacts@1
        displayName: 'Publish Bundle Size information to Azure Dev Ops Artifacts'
        inputs:
          PathtoPublish: 'apps/test-bundles/dist/bundlesizes.json'
          ArtifactName: bundlesizes-northstar

      - task: PublishBuildArtifacts@1
        displayName: 'Publish Artifact dist folder upon build for debug'
        inputs:
          PathtoPublish: 'apps/test-bundles/dist'
          ArtifactName: distdrop-northstar

The next part is the tough one. Currently the actual size auditor back end (what the lightrail job calls) only accepts one JSON file as input. We have a few options here.

Option 1: add a merging task to the lightrail job

Before calling the actual size auditor task, add two new tasks:

  • Merge the JSON into a file bundlesize.json
  • Publish the merged bundlesize.json as an artifact (size auditor seems to rely on artifacts)

You'd need to do some research about how to write the merging task/if it's possible. I'm also not familiar with what types of tasks are able to be run in the server pool (especially since it doesn't appear to check out the repo's code). But if you can get it to work, this is probably the cleanest/simplest option.

Option 2: add another job that merges the JSON files

You could potentially add a whole separate job that just merges the files and publishes the merged JSON artifact. This would require the least research to implement (you'd basically do what's outlined in the code below), but it's definitely a messier solution.

  - job: merge
    pool:
      vmImage: 'windows-2019'
    dependsOn:
      - build-react
      - build-northstar
    # ADD OPTION to download the `bundlesizes-react` and `bundlesizes-northstar` artifacts
    # (would have to look up how to do this)
    steps:
      - task: 
      # Add a script to merge the files (could use powershell, JS, or maybe bash)

      - task: PublishBuildArtifacts@1
        displayName: 'Publish Bundle Size information to Azure Dev Ops Artifacts'
        inputs:
          PathtoPublish: 'bundlesizes.json' # actual path to merged file

Option 3: modify size auditor to accept multiple inputs

In some ways this would be the ideal option, but it would require modifying the size auditor back-end code in an internal repo (hopefully a small change). Let me know if you're interested in this option and I can get more information.

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 16686 in repo microsoft/fluentui

Petr Duda added 2 commits February 11, 2021 09:29
…-react-n-build

# Conflicts:
#	apps/test-bundles/package.json
@petdud
Copy link
Contributor Author

petdud commented Feb 11, 2021

@ecraig12345 It seems that the lightrail job is taking the bundlesizes.json from the build_react job and not the bundlesizes.json from the merge job that contains React + React N* sizes. Do you know how does the lightrail work or how is it configured? I was looking at the lightrail pipeline and found only this:

devopsDropFolderName : drop
devopsAssemblyArtifactName :
devopsWebpackStatsArtifactName : bundlesizes.json
devopsOrganizationName : uifabric

This should be the last thing to solve hopefully. Thanks again for all your help

Petr Duda added 2 commits February 16, 2021 09:56
Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

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

I don't have any comments, great job 👍

@ecraig12345 ecraig12345 merged commit 6fac663 into microsoft:master Feb 16, 2021
joshualamusga1 pushed a commit to joshualamusga1/fluentui that referenced this pull request Feb 25, 2021
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.

None yet

5 participants