fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

PoC: build(storybook): add storybook-package-context-loader for better mono-repo support

Open willwill96 opened this issue 3 years ago • 7 comments
trafficstars

Context

I was developing this functionality for my own mono-repo but I was using this repo as a playground because it is already fleshed out with lots of individual components, which is how I would like to structure mine as well. Feel free to take or leave these changes!

Current Behavior

Vanilla Storybook

New Behavior

Adds a custom docs page to give a little more context for the relevant package. Ex:

image

Related Issue(s)

Fixes #

willwill96 avatar Sep 03 '22 00:09 willwill96

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 34590bc271bf8df03b63fb60e421811e46c3271e:

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

codesandbox-ci[bot] avatar Sep 03 '22 00:09 codesandbox-ci[bot]

Asset size changes

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

Baseline commit: f9f7d0fb7506d2af70af355a26d7a44b49df5f58 (build)

size-auditor[bot] avatar Sep 03 '22 00:09 size-auditor[bot]

📊 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)
79.36 kB
24.06 kB
react-alert
Alert
83.739 kB
20.823 kB
react-avatar
Avatar
48.281 kB
13.647 kB
react-avatar
AvatarGroup
14.85 kB
5.942 kB
react-avatar
AvatarGroupItem
68.249 kB
18.99 kB
react-badge
Badge
22.5 kB
7.158 kB
react-badge
CounterBadge
23.403 kB
7.45 kB
react-badge
PresenceBadge
23.947 kB
7.022 kB
react-button
Button
36.347 kB
9.559 kB
react-button
CompoundButton
43.373 kB
10.775 kB
react-button
MenuButton
38.965 kB
10.438 kB
react-button
SplitButton
46.495 kB
11.82 kB
react-button
ToggleButton
51.861 kB
10.983 kB
react-card
Card - All
67.458 kB
19.264 kB
react-card
Card
63.14 kB
18.176 kB
react-card
CardFooter
8.461 kB
3.555 kB
react-card
CardHeader
9.504 kB
3.896 kB
react-card
CardPreview
8.562 kB
3.61 kB
react-combobox
Combobox (including child components)
73.757 kB
23.969 kB
react-combobox
Dropdown (including child components)
73.344 kB
23.876 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
188.778 kB
51.891 kB
react-components
react-components: FluentProvider & webLightTheme
33.259 kB
10.952 kB
react-dialog
Dialog (including children components)
85.361 kB
25.458 kB
react-divider
Divider
16.359 kB
5.853 kB
react-image
Image
10.68 kB
4.215 kB
react-input
Input
23.498 kB
7.617 kB
react-label
Label
9.238 kB
3.815 kB
react-link
Link
12.231 kB
4.925 kB
react-menu
Menu (including children components)
115.697 kB
35.316 kB
react-menu
Menu (including selectable components)
118.896 kB
35.806 kB
react-overflow
hooks only
10.685 kB
4.104 kB
react-popover
Popover
102.835 kB
31.498 kB
react-portal
Portal
10.576 kB
3.875 kB
react-positioning
usePositioning
19.7 kB
7.404 kB
react-provider
FluentProvider
15.655 kB
5.835 kB
react-radio
Radio
36.025 kB
11.914 kB
react-radio
RadioGroup
14.148 kB
5.654 kB
react-select
Select
20.746 kB
7.299 kB
react-slider
Slider
32.07 kB
10.033 kB
react-spinbutton
SpinButton
43.843 kB
12.336 kB
react-spinner
Spinner
19.877 kB
6.392 kB
react-switch
Switch
32.562 kB
10.253 kB
react-text
Text - Default
11.682 kB
4.561 kB
react-text
Text - Wrappers
14.992 kB
4.995 kB
react-textarea
Textarea
23.674 kB
7.83 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 f9f7d0fb7506d2af70af355a26d7a44b49df5f58

fabricteam avatar Sep 03 '22 01:09 fabricteam

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1577 1586 5000
Button mount 1180 1136 5000
FluentProvider mount 1892 1917 5000
FluentProviderWithTheme mount 738 741 10
FluentProviderWithTheme virtual-rerender 696 735 10
FluentProviderWithTheme virtual-rerender-with-unmount 754 743 10
MakeStyles mount 2258 2205 50000
SpinButton mount 2944 3045 5000

fabricteam avatar Sep 03 '22 01:09 fabricteam

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AccordionMinimalPerf.default 153 133 1.15:1
VideoMinimalPerf.default 750 677 1.11:1
FormMinimalPerf.default 389 356 1.09:1
IconMinimalPerf.default 680 622 1.09:1
SegmentMinimalPerf.default 351 329 1.07:1
ReactionMinimalPerf.default 380 360 1.06:1
DropdownManyItemsPerf.default 670 642 1.04:1
MenuMinimalPerf.default 840 805 1.04:1
ButtonSlotsPerf.default 549 531 1.03:1
HeaderMinimalPerf.default 358 348 1.03:1
ProviderMinimalPerf.default 408 397 1.03:1
StatusMinimalPerf.default 672 653 1.03:1
TableMinimalPerf.default 396 385 1.03:1
ButtonMinimalPerf.default 161 158 1.02:1
ChatDuplicateMessagesPerf.default 292 287 1.02:1
DatepickerMinimalPerf.default 5765 5656 1.02:1
DropdownMinimalPerf.default 3156 3095 1.02:1
ImageMinimalPerf.default 393 387 1.02:1
SliderMinimalPerf.default 1674 1645 1.02:1
SplitButtonMinimalPerf.default 4395 4329 1.02:1
TableManyItemsPerf.default 1866 1822 1.02:1
ToolbarMinimalPerf.default 910 893 1.02:1
ButtonOverridesMissPerf.default 1482 1471 1.01:1
ChatWithPopoverPerf.default 377 373 1.01:1
DialogMinimalPerf.default 766 760 1.01:1
DividerMinimalPerf.default 351 346 1.01:1
FlexMinimalPerf.default 282 278 1.01:1
InputMinimalPerf.default 1309 1296 1.01:1
LabelMinimalPerf.default 365 362 1.01:1
ListMinimalPerf.default 499 496 1.01:1
RefMinimalPerf.default 226 223 1.01:1
SkeletonMinimalPerf.default 336 333 1.01:1
TextMinimalPerf.default 328 326 1.01:1
BoxMinimalPerf.default 324 323 1:1
CardMinimalPerf.default 526 528 1:1
GridMinimalPerf.default 322 322 1:1
PopupMinimalPerf.default 629 630 1:1
RadioGroupMinimalPerf.default 428 430 1:1
TextAreaMinimalPerf.default 455 457 1:1
TreeWith60ListItems.default 155 155 1:1
AnimationMinimalPerf.default 515 519 0.99:1
AttachmentMinimalPerf.default 157 159 0.99:1
CarouselMinimalPerf.default 449 453 0.99:1
EmbedMinimalPerf.default 4087 4108 0.99:1
HeaderSlotsPerf.default 745 750 0.99:1
ListCommonPerf.default 603 608 0.99:1
ListNestedPerf.default 540 544 0.99:1
LoaderMinimalPerf.default 697 707 0.99:1
MenuButtonMinimalPerf.default 1718 1739 0.99:1
PortalMinimalPerf.default 167 169 0.99:1
ProviderMergeThemesPerf.default 1275 1294 0.99:1
AttachmentSlotsPerf.default 1088 1108 0.98:1
CheckboxMinimalPerf.default 2681 2728 0.98:1
ItemLayoutMinimalPerf.default 1188 1216 0.98:1
CustomToolbarPrototype.default 2869 2936 0.98:1
TooltipMinimalPerf.default 2311 2347 0.98:1
ListWith60ListItems.default 583 599 0.97:1
RosterPerf.default 2117 2176 0.97:1
AvatarMinimalPerf.default 180 187 0.96:1
ChatMinimalPerf.default 702 730 0.96:1
LayoutMinimalPerf.default 342 355 0.96:1
TreeMinimalPerf.default 769 821 0.94:1
AlertMinimalPerf.default 252 272 0.93:1

fabricteam avatar Sep 03 '22 01:09 fabricteam

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 917 927 5000
Breadcrumb mount 2900 2942 1000
Checkbox mount 2612 2643 5000
CheckboxBase mount 2323 2281 5000
ChoiceGroup mount 4700 4697 5000
ComboBox mount 1029 987 1000
CommandBar mount 11144 10941 1000
ContextualMenu mount 12687 12496 1000
DefaultButton mount 1128 1165 5000
DetailsRow mount 3889 3951 5000
DetailsRowFast mount 4040 3873 5000
DetailsRowNoStyles mount 3784 3766 5000
Dialog mount 3189 3284 1000
DocumentCardTitle mount 177 187 1000
Dropdown mount 3363 3426 5000
FocusTrapZone mount 1982 1914 5000
FocusZone mount 1839 1877 5000
IconButton mount 1778 1860 5000
Label mount 337 359 5000
Layer mount 4645 4633 5000
Link mount 483 490 5000
MenuButton mount 1517 1523 5000
MessageBar mount 2200 2262 5000
Nav mount 3448 3492 1000
OverflowSet mount 1156 1111 5000
Panel mount 2576 2549 1000
Persona mount 1003 1035 1000
Pivot mount 1468 1468 1000
PrimaryButton mount 1298 1322 5000
Rating mount 7961 7950 5000
SearchBox mount 1305 1300 5000
Shimmer mount 2903 2922 5000
Slider mount 2009 2051 5000
SpinButton mount 5101 5461 5000
Spinner mount 455 433 5000
SplitButton mount 3251 3251 5000
Stack mount 537 515 5000
StackWithIntrinsicChildren mount 2371 2338 5000
StackWithTextChildren mount 5219 5255 5000
SwatchColorPicker mount 12032 11960 5000
TagPicker mount 2769 2604 5000
TeachingBubble mount 101261 99489 5000
Text mount 438 427 5000
TextField mount 1435 1408 5000
ThemeProvider mount 1358 1321 5000
ThemeProvider virtual-rerender 764 802 5000
ThemeProvider virtual-rerender-with-unmount 2114 2072 5000
Toggle mount 796 837 5000
buttonNative mount 143 137 5000

fabricteam avatar Sep 03 '22 01:09 fabricteam

This pull request has been automatically marked as stale because it was marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 5 days of this comment. Thank you for your contributions to Fluent UI!

msft-fluent-ui-bot avatar Sep 20 '22 15:09 msft-fluent-ui-bot