Skip to content

experiment(storybook): Version and theme picker - #20294

Closed
ling1726 wants to merge 11 commits into
microsoft:masterfrom
ling1726:experiment/storybook-version-picker
Closed

experiment(storybook): Version and theme picker#20294
ling1726 wants to merge 11 commits into
microsoft:masterfrom
ling1726:experiment/storybook-version-picker

Conversation

@ling1726

@ling1726 ling1726 commented Oct 21, 2021

Copy link
Copy Markdown
Contributor

Chromatic stores published storybooks with commits, we can simply build
an azure function to keep the version -> commit mapping and integrate a
picker into the docs page

Theme picker courtesy of @Hotell with the work he's done in #19250

image

Pull request checklist

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

Description of changes

(give an overview)

Focus areas to test

(optional)

Chromatic stores published storybooks with commits, we can simply build
an azure function to keep the version -> commit mapping and integrate a
picker into the docs page
@fabricteam

fabricteam commented Oct 21, 2021

Copy link
Copy Markdown
Collaborator

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-accordion
Accordion (including children components)
57.694 kB
18.16 kB
react-avatar
Avatar
54.953 kB
15.667 kB
react-badge
Badge
23.182 kB
6.986 kB
react-badge
CounterBadge
25.642 kB
7.682 kB
react-badge
PresenceBadge
30.661 kB
8.815 kB
react-button
Button
25.501 kB
7.738 kB
react-button
CompoundButton
30.758 kB
8.689 kB
react-button
MenuButton
27.526 kB
8.413 kB
react-button
SplitButton
33.637 kB
9.597 kB
react-button
ToggleButton
34.727 kB
8.39 kB
react-card
Card - All
48.995 kB
14.558 kB
react-card
Card
44.482 kB
13.339 kB
react-card
CardFooter
8.128 kB
3.424 kB
react-card
CardHeader
9.448 kB
3.878 kB
react-card
CardPreview
8.421 kB
3.599 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
169.335 kB
48.057 kB
react-components
react-components: FluentProvider & webLightTheme
32.188 kB
10.658 kB
react-divider
Divider
15.342 kB
5.585 kB
react-image
Image
9.771 kB
3.975 kB
react-input
Input
31.319 kB
11.305 kB
react-label
Label
8.952 kB
3.708 kB
react-link
Link
11.646 kB
4.699 kB
react-make-styles
makeStaticStyles (runtime)
7.59 kB
3.321 kB
react-make-styles
makeStyles + mergeClasses (runtime)
22.175 kB
8.366 kB
react-make-styles
makeStyles + mergeClasses (build time)
2.558 kB
1.204 kB
react-menu
Menu (including children components)
105.789 kB
32.202 kB
react-menu
Menu (including selectable components)
108.065 kB
32.575 kB
react-popover
Popover
101.153 kB
30.37 kB
react-portal
Portal
6.725 kB
2.237 kB
react-positioning
usePopper
23.145 kB
7.942 kB
react-provider
FluentProvider
15.147 kB
5.573 kB
react-slider
RangedSlider
41.41 kB
11.97 kB
react-slider
Slider
34.788 kB
10.855 kB
react-switch
Switch
26.602 kB
8.557 kB
react-text
Text - Default
11.338 kB
4.418 kB
react-text
Text - Wrappers
14.407 kB
4.724 kB
react-theme
Teams: all themes
25.712 kB
6.17 kB
react-theme
Teams: Light theme
17.215 kB
5.116 kB
react-tooltip
Tooltip
45.543 kB
15.541 kB
react-utilities
SSRProvider
213 B
170 B
🤖 This report was generated against 8cee28054c8667836c0a7ffd69587b4da370658c

@codesandbox-ci

codesandbox-ci Bot commented Oct 21, 2021

Copy link
Copy Markdown

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

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

@size-auditor

size-auditor Bot commented Oct 21, 2021

Copy link
Copy Markdown

Asset size changes

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

Baseline commit: 8cee28054c8667836c0a7ffd69587b4da370658c (build)

@fabricteam

fabricteam commented Oct 21, 2021

Copy link
Copy Markdown
Collaborator

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 989 1030 5000
BaseButton mount 1000 1009 5000
Breadcrumb mount 2743 2715 1000
ButtonNext mount 520 551 5000
Checkbox mount 1714 1747 5000
CheckboxBase mount 1424 1464 5000
ChoiceGroup mount 5203 5264 5000
ComboBox mount 1051 1048 1000
CommandBar mount 10572 10784 1000
ContextualMenu mount 6565 6674 1000
DefaultButton mount 1222 1232 5000
DetailsRow mount 4016 4004 5000
DetailsRowFast mount 3950 4066 5000
DetailsRowNoStyles mount 3856 3851 5000
Dialog mount 2716 2725 1000
DocumentCardTitle mount 177 187 1000
Dropdown mount 3504 3491 5000
FluentProviderNext mount 3346 3377 5000
FluentProviderWithTheme mount 223 204 10
FluentProviderWithTheme virtual-rerender 96 105 10
FluentProviderWithTheme virtual-rerender-with-unmount 240 239 10
FocusTrapZone mount 1870 1930 5000
FocusZone mount 1846 1971 5000
IconButton mount 1928 1913 5000
Label mount 358 365 5000
Layer mount 3086 3156 5000
Link mount 514 522 5000
MakeStyles mount 1854 1839 50000
MenuButton mount 1595 1596 5000
MessageBar mount 2186 2149 5000
Nav mount 3501 3452 1000
OverflowSet mount 1218 1149 5000
Panel mount 2561 2579 1000
Persona mount 885 894 1000
Pivot mount 1524 1478 1000
PrimaryButton mount 1347 1372 5000
Rating mount 8364 8321 5000
SearchBox mount 1432 1436 5000
Shimmer mount 2703 2719 5000
Slider mount 2086 2114 5000
SpinButton mount 5205 5318 5000
Spinner mount 445 445 5000
SplitButton mount 3321 3331 5000
Stack mount 523 540 5000
StackWithIntrinsicChildren mount 1820 1765 5000
StackWithTextChildren mount 5033 5081 5000
SwatchColorPicker mount 10898 10848 5000
Tabs mount 1509 1481 1000
TagPicker mount 2801 2838 5000
TeachingBubble mount 13049 13191 5000
Text mount 449 471 5000
TextField mount 1504 1489 5000
ThemeProvider mount 1187 1211 5000
ThemeProvider virtual-rerender 613 615 5000
ThemeProvider virtual-rerender-with-unmount 1996 1977 5000
Toggle mount 856 857 5000
buttonNative mount 122 132 5000

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
RefMinimalPerf.default 253 224 1.13:1
GridMinimalPerf.default 371 344 1.08:1
MenuMinimalPerf.default 946 879 1.08:1
AlertMinimalPerf.default 325 305 1.07:1
SkeletonMinimalPerf.default 406 381 1.07:1
TextAreaMinimalPerf.default 580 542 1.07:1
TreeWith60ListItems.default 207 196 1.06:1
ChatDuplicateMessagesPerf.default 319 303 1.05:1
DropdownManyItemsPerf.default 765 731 1.05:1
RadioGroupMinimalPerf.default 495 472 1.05:1
ReactionMinimalPerf.default 412 392 1.05:1
BoxMinimalPerf.default 389 375 1.04:1
ButtonMinimalPerf.default 194 187 1.04:1
DividerMinimalPerf.default 406 391 1.04:1
FormMinimalPerf.default 458 439 1.04:1
HeaderMinimalPerf.default 383 370 1.04:1
PortalMinimalPerf.default 180 173 1.04:1
IconMinimalPerf.default 668 645 1.04:1
AccordionMinimalPerf.default 179 174 1.03:1
AttachmentSlotsPerf.default 1139 1108 1.03:1
AvatarMinimalPerf.default 224 217 1.03:1
FlexMinimalPerf.default 299 290 1.03:1
TableManyItemsPerf.default 2071 2012 1.03:1
TableMinimalPerf.default 430 419 1.03:1
AnimationMinimalPerf.default 445 438 1.02:1
AttachmentMinimalPerf.default 182 179 1.02:1
CardMinimalPerf.default 632 617 1.02:1
ItemLayoutMinimalPerf.default 1314 1285 1.02:1
LabelMinimalPerf.default 430 421 1.02:1
ListWith60ListItems.default 717 704 1.02:1
PopupMinimalPerf.default 599 590 1.02:1
ProviderMinimalPerf.default 1169 1150 1.02:1
SplitButtonMinimalPerf.default 4574 4500 1.02:1
CustomToolbarPrototype.default 4167 4100 1.02:1
VideoMinimalPerf.default 715 699 1.02:1
ButtonOverridesMissPerf.default 1865 1852 1.01:1
DatepickerMinimalPerf.default 5738 5699 1.01:1
EmbedMinimalPerf.default 4561 4496 1.01:1
InputMinimalPerf.default 1347 1339 1.01:1
RosterPerf.default 1338 1327 1.01:1
SliderMinimalPerf.default 1752 1731 1.01:1
StatusMinimalPerf.default 762 755 1.01:1
TextMinimalPerf.default 376 371 1.01:1
ImageMinimalPerf.default 398 398 1:1
LayoutMinimalPerf.default 399 401 1:1
ListMinimalPerf.default 580 580 1:1
ToolbarMinimalPerf.default 982 986 1:1
TreeMinimalPerf.default 849 851 1:1
ButtonSlotsPerf.default 581 584 0.99:1
ChatMinimalPerf.default 698 703 0.99:1
ChatWithPopoverPerf.default 395 401 0.99:1
CheckboxMinimalPerf.default 2818 2854 0.99:1
DialogMinimalPerf.default 781 792 0.99:1
DropdownMinimalPerf.default 3269 3303 0.99:1
HeaderSlotsPerf.default 830 841 0.99:1
ListCommonPerf.default 691 697 0.99:1
MenuButtonMinimalPerf.default 1713 1727 0.99:1
ProviderMergeThemesPerf.default 1667 1684 0.99:1
CarouselMinimalPerf.default 493 501 0.98:1
ListNestedPerf.default 620 631 0.98:1
TooltipMinimalPerf.default 1096 1113 0.98:1
LoaderMinimalPerf.default 746 774 0.96:1
SegmentMinimalPerf.default 374 390 0.96:1

@Hotell

Hotell commented Oct 22, 2021

Copy link
Copy Markdown
Contributor

I like the idea.

My suggestion would be to use standard storybook controls (their design system) and implement it so it aligns better with overall outcome (storybook design)

2021-10-22 at 15 46

  1. the select would render on the navbar right beyond search
  2. the select would render as another panel item

For both solution we should create a custom addon. I have created one back in August so it would be good opportunity to finish it and add this functionality as well.

btw: I saw you moved some quick n dirty addon outside this repo - I'd like us to mitigate that in the future so its all in one place

@ling1726

Copy link
Copy Markdown
Contributor Author

For both solution we should create a custom addon. [I have created one back in August]

However if we build in docs mode we no longer had addon panels and toolbar items :/

@ling1726 ling1726 changed the title experiment(storybook): Version picker experiment(storybook): Version and theme picker Oct 25, 2021
@ling1726

Copy link
Copy Markdown
Contributor Author

@Hotell Found a way to hide all default toolbar items and only add custom ones... thx for the help in #19250 !

@ling1726 ling1726 closed this Oct 25, 2021
@ling1726 ling1726 reopened this Oct 25, 2021
@Hotell

Hotell commented Oct 27, 2021

Copy link
Copy Markdown
Contributor

should this be closed ?

@ling1726 ling1726 closed this Oct 27, 2021
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