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

docs: improve DX when using new setup for docs with storybook #20283

Merged
merged 4 commits into from
Oct 21, 2021

Conversation

Hotell
Copy link
Contributor

@Hotell Hotell commented Oct 21, 2021

Pull request checklist

Description of changes

Focus areas to test

(optional)

@@ -1,6 +1,6 @@
import { withFluentProvider, withStrictMode } from '@fluentui/react-storybook';
import 'cypress-storybook/react';
import dedent from 'dedent';
import * as dedent from 'dedent';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was TS error before ( we don't have synthetic default imports enabled )

@@ -157,6 +157,7 @@
"cypress-storybook": "0.5.1",
"danger": "^6.0.5",
"del": "6.0.0",
"dedent": "0.7.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding explicitly version which is used for custom logic ( removing hidden dependency )

@@ -182,7 +182,6 @@ const templates = {

return localConfig;
},
previewHead: rootMain.previewHead,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

2021-10-21 at 13 42

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 21, 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 7c24ae9:

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

@size-auditor
Copy link

size-auditor bot commented Oct 21, 2021

Asset size changes

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

Baseline commit: 25435def33d60a9314ccdcf63a1ee37f47513c50 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Oct 21, 2021

📊 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 25435def33d60a9314ccdcf63a1ee37f47513c50

@fabricteam
Copy link
Collaborator

fabricteam commented Oct 21, 2021

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1003 1054 5000
BaseButton mount 1028 1049 5000
Breadcrumb mount 2736 2772 1000
ButtonNext mount 565 547 5000
Checkbox mount 1707 1695 5000
CheckboxBase mount 1471 1464 5000
ChoiceGroup mount 5188 5270 5000
ComboBox mount 1050 1058 1000
CommandBar mount 10679 10574 1000
ContextualMenu mount 6794 6898 1000
DefaultButton mount 1236 1262 5000
DetailsRow mount 4143 4124 5000
DetailsRowFast mount 4143 4185 5000
DetailsRowNoStyles mount 3913 3922 5000
Dialog mount 2575 2564 1000
DocumentCardTitle mount 185 184 1000
Dropdown mount 3516 3513 5000
FluentProviderNext mount 3356 3336 5000
FluentProviderWithTheme mount 217 215 10
FluentProviderWithTheme virtual-rerender 109 108 10
FluentProviderWithTheme virtual-rerender-with-unmount 228 241 10
FocusTrapZone mount 1933 1962 5000
FocusZone mount 1935 1923 5000
IconButton mount 1923 2021 5000
Label mount 374 376 5000
Layer mount 3434 3285 5000
Link mount 576 555 5000
MakeStyles mount 1897 1928 50000
MenuButton mount 1675 1743 5000
MessageBar mount 2224 2202 5000
Nav mount 3643 3679 1000
OverflowSet mount 1211 1228 5000
Panel mount 2491 2462 1000
Persona mount 899 952 1000
Pivot mount 1591 1613 1000
PrimaryButton mount 1466 1462 5000
Rating mount 8770 8816 5000
SearchBox mount 1506 1603 5000
Shimmer mount 2802 2839 5000
Slider mount 2151 2145 5000
SpinButton mount 5421 5392 5000
Spinner mount 470 454 5000
SplitButton mount 3468 3464 5000
Stack mount 579 602 5000
StackWithIntrinsicChildren mount 1935 2015 5000
StackWithTextChildren mount 5421 5352 5000
SwatchColorPicker mount 11367 11508 5000
Tabs mount 1517 1560 1000
TagPicker mount 2964 2940 5000
TeachingBubble mount 13648 13691 5000
Text mount 493 492 5000
TextField mount 1579 1541 5000
ThemeProvider mount 1331 1277 5000
ThemeProvider virtual-rerender 667 680 5000
ThemeProvider virtual-rerender-with-unmount 2063 2068 5000
Toggle mount 924 936 5000
buttonNative mount 147 167 5000

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
ButtonMinimalPerf.default 226 197 1.15:1
ChatDuplicateMessagesPerf.default 352 318 1.11:1
TreeWith60ListItems.default 236 212 1.11:1
LabelMinimalPerf.default 463 422 1.1:1
FlexMinimalPerf.default 332 304 1.09:1
RefMinimalPerf.default 270 249 1.08:1
TextAreaMinimalPerf.default 607 563 1.08:1
AnimationMinimalPerf.default 481 448 1.07:1
ToolbarMinimalPerf.default 1099 1024 1.07:1
CarouselMinimalPerf.default 547 515 1.06:1
FormMinimalPerf.default 507 481 1.05:1
HeaderMinimalPerf.default 415 394 1.05:1
ListWith60ListItems.default 731 693 1.05:1
MenuMinimalPerf.default 974 932 1.05:1
SkeletonMinimalPerf.default 421 402 1.05:1
StatusMinimalPerf.default 783 747 1.05:1
BoxMinimalPerf.default 390 375 1.04:1
MenuButtonMinimalPerf.default 1873 1794 1.04:1
PopupMinimalPerf.default 649 627 1.04:1
DividerMinimalPerf.default 401 388 1.03:1
PortalMinimalPerf.default 184 178 1.03:1
TooltipMinimalPerf.default 1157 1128 1.03:1
AlertMinimalPerf.default 319 313 1.02:1
AttachmentMinimalPerf.default 195 191 1.02:1
ChatMinimalPerf.default 722 705 1.02:1
ChatWithPopoverPerf.default 434 425 1.02:1
CheckboxMinimalPerf.default 2952 2891 1.02:1
DatepickerMinimalPerf.default 6071 5927 1.02:1
EmbedMinimalPerf.default 4713 4609 1.02:1
ReactionMinimalPerf.default 445 435 1.02:1
ButtonOverridesMissPerf.default 1960 1944 1.01:1
DropdownManyItemsPerf.default 776 768 1.01:1
ItemLayoutMinimalPerf.default 1342 1334 1.01:1
RosterPerf.default 1309 1298 1.01:1
ButtonSlotsPerf.default 621 623 1:1
CardMinimalPerf.default 632 633 1:1
LoaderMinimalPerf.default 762 765 1:1
SegmentMinimalPerf.default 389 388 1:1
SliderMinimalPerf.default 1833 1826 1:1
SplitButtonMinimalPerf.default 4758 4755 1:1
TableManyItemsPerf.default 2188 2184 1:1
CustomToolbarPrototype.default 4468 4472 1:1
TreeMinimalPerf.default 895 894 1:1
VideoMinimalPerf.default 720 719 1:1
AvatarMinimalPerf.default 219 222 0.99:1
DialogMinimalPerf.default 809 817 0.99:1
DropdownMinimalPerf.default 3359 3383 0.99:1
ProviderMergeThemesPerf.default 1814 1825 0.99:1
AccordionMinimalPerf.default 181 185 0.98:1
HeaderSlotsPerf.default 859 876 0.98:1
ListMinimalPerf.default 587 596 0.98:1
InputMinimalPerf.default 1398 1435 0.97:1
RadioGroupMinimalPerf.default 482 499 0.97:1
IconMinimalPerf.default 695 714 0.97:1
TableMinimalPerf.default 453 468 0.97:1
ListCommonPerf.default 711 743 0.96:1
ProviderMinimalPerf.default 1197 1243 0.96:1
AttachmentSlotsPerf.default 1178 1240 0.95:1
ImageMinimalPerf.default 426 448 0.95:1
LayoutMinimalPerf.default 411 434 0.95:1
ListNestedPerf.default 611 642 0.95:1
TextMinimalPerf.default 385 407 0.95:1
GridMinimalPerf.default 368 391 0.94:1

@Hotell Hotell marked this pull request as ready for review October 21, 2021 13:34
@Hotell Hotell requested a review from a team as a code owner October 21, 2021 13:34
@Hotell Hotell added this to the October Project Cycle Q4 2021 milestone Oct 21, 2021
@Hotell Hotell enabled auto-merge (squash) October 21, 2021 14:00
@Hotell
Copy link
Contributor Author

Hotell commented Oct 21, 2021

hmm looks like I'm running into same issue like Peter (#20126) - (VR tests are filing) when deleting the babel.plugin file, meaning it is still probably being used somehow. We'll need to do more investigation which is outside of scope of this PR - thus I'm gonna revert that commit.

2021-10-21 at 18 29

@Hotell Hotell force-pushed the hotell/build-system/tweak-sb-docs branch from a17e2a7 to 7c24ae9 Compare October 21, 2021 16:34
@Hotell Hotell merged commit 1df0025 into microsoft:master Oct 21, 2021
@Hotell Hotell deleted the hotell/build-system/tweak-sb-docs branch October 22, 2021 09:24
mlp73 pushed a commit to mlp73/fluentui that referenced this pull request Jan 17, 2022
…oft#20283)

* chore: use explicit version of dedent which is used for custom logic

* refactor(.storybook): normalize handling importing fs files and make preview-head explicit to not confuse with default sb behaviour when loading custom preview-head.html

* feat(typings): improve addons types to get better DX for consumers

* fix(tools): undo manually adding previewHead as that is already spread from root
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.

4 participants