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

Stress Test: add build commands #24575

Merged
merged 9 commits into from
Sep 8, 2022

Conversation

spmonahan
Copy link
Contributor

Current Behavior

Stress Test cannot be built via the CLI app (it can only be built via npm scripts).

New Behavior

NB: This PR depends on #24551

Stress Test can be built via the CLI app. This allows:

  • The app to be built for production or development
  • The app to be run via Webpack dev server
  • Setting different Griffel modes (runtime, buildtime, extraction)
  • Building any dependencies required for Stress Test (e.g., @fluentui/react).

Related Issue(s)

Fixes #24310

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 30, 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 8600445:

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

@size-auditor
Copy link

size-auditor bot commented Aug 30, 2022

Asset size changes

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

Baseline commit: dd504116164f53a88c14ba932dc8d8e3f561e2b3 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 30, 2022

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender-with-unmount 1911 740 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1351 1293 5000
Button mount 951 959 5000
FluentProvider mount 1840 2119 5000
FluentProviderWithTheme mount 1842 627 10
FluentProviderWithTheme virtual-rerender 603 592 10
FluentProviderWithTheme virtual-rerender-with-unmount 1911 740 10 Possible regression
MakeStyles mount 5812 1892 50000
SpinButton mount 6793 2449 5000

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 30, 2022

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
533 B
341 B
global-context
createContextSelector
554 B
348 B
priority-overflow
createOverflowManager
2.936 kB
1.212 kB
react-accordion
Accordion (including children components)
78.914 kB
24.06 kB
react-alert
Alert
83.228 kB
20.889 kB
react-avatar
Avatar
48.381 kB
13.696 kB
react-avatar
AvatarGroup
14.95 kB
5.989 kB
react-avatar
AvatarGroupItem
68.349 kB
19.039 kB
react-badge
Badge
22.6 kB
7.205 kB
react-badge
CounterBadge
23.503 kB
7.497 kB
react-badge
PresenceBadge
24.05 kB
7.067 kB
react-button
Button
35.836 kB
9.59 kB
react-button
CompoundButton
42.862 kB
10.808 kB
react-button
MenuButton
38.454 kB
10.461 kB
react-button
SplitButton
45.87 kB
11.811 kB
react-button
ToggleButton
51.017 kB
11.007 kB
react-card
Card - All
67.002 kB
19.261 kB
react-card
Card
62.684 kB
18.177 kB
react-card
CardFooter
8.561 kB
3.601 kB
react-card
CardHeader
9.604 kB
3.94 kB
react-card
CardPreview
8.662 kB
3.656 kB
react-combobox
Combobox (including child components)
73.863 kB
24.018 kB
react-combobox
Dropdown (including child components)
73.45 kB
23.927 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
187.656 kB
51.96 kB
react-components
react-components: FluentProvider & webLightTheme
33.359 kB
11.004 kB
react-dialog
Dialog (including children components)
80.983 kB
24.187 kB
react-divider
Divider
16.459 kB
5.902 kB
react-image
Image
10.78 kB
4.264 kB
react-input
Input
23.598 kB
7.661 kB
react-label
Label
9.338 kB
3.86 kB
react-link
Link
12.254 kB
4.956 kB
react-menu
Menu (including children components)
115.735 kB
35.419 kB
react-menu
Menu (including selectable components)
118.934 kB
35.916 kB
react-overflow
hooks only
10.685 kB
4.104 kB
react-popover
Popover
102.938 kB
31.542 kB
react-portal
Portal
10.576 kB
3.875 kB
react-portal-compat
PortalCompatProvider
5.851 kB
1.964 kB
react-positioning
usePositioning
19.7 kB
7.404 kB
react-provider
FluentProvider
15.755 kB
5.883 kB
react-radio
Radio
35.56 kB
11.929 kB
react-radio
RadioGroup
14.248 kB
5.7 kB
react-select
Select
20.846 kB
7.346 kB
react-slider
Slider
31.526 kB
10.046 kB
react-spinbutton
SpinButton
43.943 kB
12.382 kB
react-spinner
Spinner
19.977 kB
6.438 kB
react-switch
Switch
32.097 kB
10.27 kB
react-text
Text - Default
11.782 kB
4.605 kB
react-text
Text - Wrappers
15.092 kB
5.044 kB
react-textarea
Textarea
23.774 kB
7.881 kB
react-theme
Single theme token import
69 B
89 B
react-theme
Teams: all themes
29.548 kB
6.434 kB
react-theme
Teams: Light theme
17.452 kB
5.054 kB
react-tooltip
Tooltip
41.502 kB
14.623 kB
react-utilities
SSRProvider
180 B
159 B
🤖 This report was generated against dd504116164f53a88c14ba932dc8d8e3f561e2b3

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 30, 2022

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AlertMinimalPerf.default 238 210 1.13:1
RefMinimalPerf.default 201 184 1.09:1
TextMinimalPerf.default 284 262 1.08:1
AttachmentMinimalPerf.default 122 114 1.07:1
AvatarMinimalPerf.default 164 154 1.06:1
VideoMinimalPerf.default 628 592 1.06:1
AccordionMinimalPerf.default 136 130 1.05:1
ListCommonPerf.default 523 499 1.05:1
ListWith60ListItems.default 524 499 1.05:1
TextAreaMinimalPerf.default 399 379 1.05:1
ButtonSlotsPerf.default 467 449 1.04:1
ChatDuplicateMessagesPerf.default 238 229 1.04:1
TreeWith60ListItems.default 140 134 1.04:1
BoxMinimalPerf.default 278 271 1.03:1
LoaderMinimalPerf.default 565 549 1.03:1
MenuMinimalPerf.default 705 686 1.03:1
TableManyItemsPerf.default 1601 1553 1.03:1
ToolbarMinimalPerf.default 766 742 1.03:1
ChatMinimalPerf.default 595 583 1.02:1
DatepickerMinimalPerf.default 4826 4742 1.02:1
DialogMinimalPerf.default 655 644 1.02:1
FormMinimalPerf.default 308 301 1.02:1
ImageMinimalPerf.default 316 310 1.02:1
ItemLayoutMinimalPerf.default 976 955 1.02:1
RadioGroupMinimalPerf.default 366 360 1.02:1
SegmentMinimalPerf.default 313 308 1.02:1
DropdownMinimalPerf.default 2281 2254 1.01:1
HeaderSlotsPerf.default 630 625 1.01:1
MenuButtonMinimalPerf.default 1439 1419 1.01:1
PopupMinimalPerf.default 524 520 1.01:1
PortalMinimalPerf.default 138 136 1.01:1
ProviderMergeThemesPerf.default 1063 1049 1.01:1
ReactionMinimalPerf.default 306 302 1.01:1
CustomToolbarPrototype.default 2292 2263 1.01:1
AnimationMinimalPerf.default 432 434 1:1
ButtonOverridesMissPerf.default 1091 1090 1:1
InputMinimalPerf.default 954 950 1:1
SplitButtonMinimalPerf.default 3648 3661 1:1
StatusMinimalPerf.default 553 552 1:1
TableMinimalPerf.default 334 333 1:1
TreeMinimalPerf.default 668 670 1:1
CheckboxMinimalPerf.default 1723 1749 0.99:1
DropdownManyItemsPerf.default 541 546 0.99:1
EmbedMinimalPerf.default 3062 3090 0.99:1
HeaderMinimalPerf.default 293 297 0.99:1
LayoutMinimalPerf.default 291 294 0.99:1
ListMinimalPerf.default 413 418 0.99:1
RosterPerf.default 1775 1797 0.99:1
ProviderMinimalPerf.default 330 335 0.99:1
SliderMinimalPerf.default 1332 1343 0.99:1
IconMinimalPerf.default 522 526 0.99:1
TooltipMinimalPerf.default 1877 1900 0.99:1
AttachmentSlotsPerf.default 896 915 0.98:1
DividerMinimalPerf.default 284 291 0.98:1
ListNestedPerf.default 448 455 0.98:1
GridMinimalPerf.default 280 290 0.97:1
FlexMinimalPerf.default 234 243 0.96:1
LabelMinimalPerf.default 322 336 0.96:1
ButtonMinimalPerf.default 138 146 0.95:1
CarouselMinimalPerf.default 363 389 0.93:1
ChatWithPopoverPerf.default 287 309 0.93:1
SkeletonMinimalPerf.default 275 301 0.91:1
CardMinimalPerf.default 439 488 0.9:1

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 30, 2022

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 770 771 5000
Breadcrumb mount 2313 2310 1000
Checkbox mount 2249 2199 5000
CheckboxBase mount 1957 1947 5000
ChoiceGroup mount 3863 3824 5000
ComboBox mount 737 762 1000
CommandBar mount 8839 8815 1000
ContextualMenu mount 9566 9594 1000
DefaultButton mount 938 937 5000
DetailsRow mount 3000 2975 5000
DetailsRowFast mount 3026 3015 5000
DetailsRowNoStyles mount 2927 2825 5000
Dialog mount 2517 2521 1000
DocumentCardTitle mount 148 138 1000
Dropdown mount 2896 2759 5000
FocusTrapZone mount 1565 1539 5000
FocusZone mount 1525 1513 5000
IconButton mount 1371 1379 5000
Label mount 315 317 5000
Layer mount 3693 3704 5000
Link mount 432 420 5000
MenuButton mount 1189 1197 5000
MessageBar mount 1938 1855 5000
Nav mount 2667 2672 1000
OverflowSet mount 1001 972 5000
Panel mount 2047 2061 1000
Persona mount 819 820 1000
Pivot mount 1107 1096 1000
PrimaryButton mount 1059 1078 5000
Rating mount 6639 6591 5000
SearchBox mount 1095 1088 5000
Shimmer mount 2524 2457 5000
Slider mount 1673 1705 5000
SpinButton mount 3890 3833 5000
Spinner mount 403 392 5000
SplitButton mount 2433 2440 5000
Stack mount 463 477 5000
StackWithIntrinsicChildren mount 1869 1824 5000
StackWithTextChildren mount 4528 4499 5000
SwatchColorPicker mount 9080 9035 5000
TagPicker mount 1959 1917 5000
TeachingBubble mount 73476 72617 5000
Text mount 396 389 5000
TextField mount 1125 1147 5000
ThemeProvider mount 1027 1029 5000
ThemeProvider virtual-rerender 713 716 5000
ThemeProvider virtual-rerender-with-unmount 1561 1580 5000
Toggle mount 712 704 5000
buttonNative mount 107 100 5000

Adds a CLI application for Stress Test that allows test configurations
to easily be generated and run. This makes running large test suites
as simple as a single command and eliminates the need for most npm
scripts that previously existed for this package.
This command allows the application to be built via the CLI.

It adds:

- Support for different Griffel build modes (runtime, build time, extraction)
- Building dependencies for Stress Test (e.g., @fluentui/react)
- Running Webpack dev server via CLI
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.

TBH I think that it might be reasonable to change it to TS and use ts-node that is blazing fast now because we use swc (#24255).

apps/stress-test/package.json Outdated Show resolved Hide resolved
apps/stress-test/scripts/commands/buildTestConfig.js Outdated Show resolved Hide resolved
@spmonahan
Copy link
Contributor Author

TBH I think that it might be reasonable to change it to TS and use ts-node that is blazing fast now because we use swc (#24255).

I've been thinking that too. TS and JSDoc work pretty well together but I feel that I've already spent a lot more time working through typing issues with this set up than I would have with just plain TS.

I'm going to exclude the scripts folder from type checking for now and follow up with a full TS converstion in #24724.

- clean up package.json
- disable type checking for scripts
@spmonahan spmonahan merged commit f7a7a4c into microsoft:master Sep 8, 2022
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Sep 9, 2022
* master: (63 commits)
  feat: add helper types to assist DOM element handling (microsoft#24722)
  applying package updates
  Textarea/hc bug (microsoft#24701)
  Fix null ref in use slider (microsoft#24728)
  Add Field unit tests, and remove snapshot tests (microsoft#24706)
  Stress Test: add build commands (microsoft#24575)
  Coachmark - useOffsetHeight should cause re-render on each set state to match v7 functionality (microsoft#24702)
  Implement screener tests for Field components (microsoft#24684)
  Update Field types to clean up react-field.api.md (microsoft#24703)
  fix(Popup): remove rotate(360deg) from PopupContent content styles (microsoft#24432)
  fix(FocusZone): should reset tabindex when focus is outside the zone with prop `shouldResetActiveElementWhenTabFromZone` (microsoft#24463)
  Fix greyed out legend key contrast ratio (microsoft#24714)
  fix: Portal compat should apply `focus-visible` ponyfill (microsoft#24712)
  Fix artifact error (microsoft#24717)
  chore(react-dialog): remove localShorthands in favor of griffel shorthands (microsoft#24715)
  Skip screener checks for draft PRs with exception of appropriately la… (microsoft#24694)
  fix: Remove provider classname from focus styles (microsoft#24710)
  feat: autocontrolled `useTable` hook (microsoft#24688)
  feat: add dialog properties to getNativeElementProps (microsoft#24698)
  Using migrate rather than upgrade term (microsoft#24695)
  ...
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.

Stress Test: Test different Griffel CSS options
5 participants