Skip to content

Conversation

@tudorpopams
Copy link
Contributor

@tudorpopams tudorpopams commented Sep 22, 2022

Current Behavior

  1. We don't have a reusable build action, thus having to manually write the build commands (and specific parameters) each time.
  2. yarn build --to <workspace> command doesn't cache the content while being ran in the pipeline, thus causing full builds on each run.

New Behavior

This PR adds a custom build action that can be reused everywhere else and more important, it enables Backfill remote caching so that each run will only build what is invalidated (ie new). This solution makes build times for cached resources almost 5 times faster.

The long term goal is to replace this solution with something that offers better DX and scalability, such as NX.

@size-auditor
Copy link

size-auditor bot commented Sep 22, 2022

Asset size changes

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

Baseline commit: 9f774b95fbc119b55838315e2515e93b4ba62445 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 22, 2022

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1269 1279 5000
Button mount 921 936 5000
FluentProvider mount 1481 1515 5000
FluentProviderWithTheme mount 578 579 10
FluentProviderWithTheme virtual-rerender 536 552 10
FluentProviderWithTheme virtual-rerender-with-unmount 583 581 10
MakeStyles mount 1923 1929 50000
SpinButton mount 2326 2317 5000

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 22, 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 b76255b:

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

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 22, 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)
79.037 kB
24.059 kB
react-alert
Alert
84.117 kB
21.07 kB
react-avatar
Avatar
48.828 kB
13.842 kB
react-avatar
AvatarGroup
14.95 kB
5.989 kB
react-avatar
AvatarGroupItem
68.796 kB
19.182 kB
react-badge
Badge
22.6 kB
7.205 kB
react-badge
CounterBadge
23.49 kB
7.489 kB
react-badge
PresenceBadge
24.05 kB
7.067 kB
react-button
Button
36.278 kB
9.636 kB
react-button
CompoundButton
43.303 kB
10.852 kB
react-button
MenuButton
38.972 kB
10.536 kB
react-button
SplitButton
46.418 kB
11.916 kB
react-button
ToggleButton
52.145 kB
11.108 kB
react-card
Card - All
67.17 kB
19.281 kB
react-card
Card
62.852 kB
18.198 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)
74.642 kB
24.19 kB
react-combobox
Dropdown (including child components)
74.242 kB
24.089 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
189.156 kB
52.385 kB
react-components
react-components: FluentProvider & webLightTheme
33.4 kB
11.008 kB
react-dialog
Dialog (including children components)
82.438 kB
24.444 kB
react-divider
Divider
16.459 kB
5.902 kB
react-image
Image
10.78 kB
4.264 kB
react-input
Input
23.762 kB
7.706 kB
react-label
Label
9.338 kB
3.86 kB
react-link
Link
11.806 kB
4.868 kB
react-menu
Menu (including children components)
116.718 kB
35.78 kB
react-menu
Menu (including selectable components)
119.787 kB
36.289 kB
react-overflow
hooks only
10.685 kB
4.104 kB
react-popover
Popover
102.929 kB
31.542 kB
react-portal
Portal
10.582 kB
3.875 kB
react-portal-compat
PortalCompatProvider
5.857 kB
1.978 kB
react-positioning
usePositioning
19.7 kB
7.404 kB
react-progress
Progress
13.44 kB
5.247 kB
react-provider
FluentProvider
15.761 kB
5.885 kB
react-radio
Radio
36.39 kB
12.103 kB
react-radio
RadioGroup
14.248 kB
5.7 kB
react-select
Select
20.846 kB
7.346 kB
react-slider
Slider
31.759 kB
10.064 kB
react-spinbutton
SpinButton
44.102 kB
12.425 kB
react-spinner
Spinner
19.977 kB
6.438 kB
react-switch
Switch
33.342 kB
10.557 kB
react-text
Text - Default
11.782 kB
4.605 kB
react-text
Text - Wrappers
15.092 kB
5.044 kB
react-textarea
Textarea
25.018 kB
8.133 kB
react-theme
Single theme token import
69 B
89 B
react-theme
Teams: all themes
29.65 kB
6.444 kB
react-theme
Teams: Light theme
17.486 kB
5.057 kB
react-tooltip
Tooltip
41.541 kB
14.646 kB
react-utilities
SSRProvider
180 B
159 B
🤖 This report was generated against 9f774b95fbc119b55838315e2515e93b4ba62445

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 22, 2022

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
PortalMinimalPerf.default 145 136 1.07:1
ChatWithPopoverPerf.default 307 291 1.05:1
SkeletonMinimalPerf.default 314 299 1.05:1
AccordionMinimalPerf.default 125 120 1.04:1
ButtonMinimalPerf.default 142 137 1.04:1
GridMinimalPerf.default 304 293 1.04:1
BoxMinimalPerf.default 311 303 1.03:1
CarouselMinimalPerf.default 365 355 1.03:1
DividerMinimalPerf.default 318 308 1.03:1
FlexMinimalPerf.default 251 243 1.03:1
ReactionMinimalPerf.default 338 327 1.03:1
SegmentMinimalPerf.default 313 305 1.03:1
TableMinimalPerf.default 364 354 1.03:1
AlertMinimalPerf.default 228 224 1.02:1
AvatarMinimalPerf.default 170 166 1.02:1
EmbedMinimalPerf.default 2658 2615 1.02:1
LabelMinimalPerf.default 339 332 1.02:1
ProviderMinimalPerf.default 323 317 1.02:1
ToolbarMinimalPerf.default 814 795 1.02:1
TreeMinimalPerf.default 720 706 1.02:1
AnimationMinimalPerf.default 479 475 1.01:1
AttachmentMinimalPerf.default 129 128 1.01:1
AttachmentSlotsPerf.default 880 871 1.01:1
ButtonOverridesMissPerf.default 1026 1020 1.01:1
DialogMinimalPerf.default 689 683 1.01:1
DropdownMinimalPerf.default 2179 2157 1.01:1
FormMinimalPerf.default 330 327 1.01:1
HeaderMinimalPerf.default 317 314 1.01:1
InputMinimalPerf.default 857 847 1.01:1
LoaderMinimalPerf.default 515 512 1.01:1
MenuMinimalPerf.default 738 733 1.01:1
MenuButtonMinimalPerf.default 1371 1352 1.01:1
PopupMinimalPerf.default 562 558 1.01:1
ProviderMergeThemesPerf.default 994 989 1.01:1
RadioGroupMinimalPerf.default 390 387 1.01:1
IconMinimalPerf.default 567 560 1.01:1
TextMinimalPerf.default 308 306 1.01:1
TooltipMinimalPerf.default 1876 1865 1.01:1
TreeWith60ListItems.default 130 129 1.01:1
VideoMinimalPerf.default 621 614 1.01:1
CardMinimalPerf.default 466 464 1:1
ChatMinimalPerf.default 641 638 1:1
CheckboxMinimalPerf.default 1523 1520 1:1
DatepickerMinimalPerf.default 4775 4760 1:1
HeaderSlotsPerf.default 673 671 1:1
ListNestedPerf.default 478 478 1:1
RosterPerf.default 1693 1700 1:1
SliderMinimalPerf.default 1234 1229 1:1
StatusMinimalPerf.default 603 600 1:1
TableManyItemsPerf.default 1562 1562 1:1
TextAreaMinimalPerf.default 408 407 1:1
CustomToolbarPrototype.default 2166 2156 1:1
DropdownManyItemsPerf.default 537 540 0.99:1
ImageMinimalPerf.default 345 348 0.99:1
ItemLayoutMinimalPerf.default 970 983 0.99:1
SplitButtonMinimalPerf.default 3271 3294 0.99:1
LayoutMinimalPerf.default 313 318 0.98:1
ListMinimalPerf.default 448 455 0.98:1
ListWith60ListItems.default 492 503 0.98:1
RefMinimalPerf.default 186 189 0.98:1
ButtonSlotsPerf.default 421 434 0.97:1
ChatDuplicateMessagesPerf.default 208 217 0.96:1
ListCommonPerf.default 511 530 0.96:1

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 22, 2022

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 1592 1584 5000
Breadcrumb mount 3798 3722 1000
Checkbox mount 3410 3474 5000
CheckboxBase mount 3091 3113 5000
ChoiceGroup mount 5988 5975 5000
ComboBox mount 1633 1572 1000
CommandBar mount 12327 12215 1000
ContextualMenu mount 14335 14394 1000
DefaultButton mount 1836 1856 5000
DetailsRow mount 4818 4812 5000
DetailsRowFast mount 4757 4777 5000
DetailsRowNoStyles mount 4596 4580 5000
Dialog mount 3962 3926 1000
DocumentCardTitle mount 752 749 1000
Dropdown mount 4303 4294 5000
FocusTrapZone mount 2574 2556 5000
FocusZone mount 2476 2500 5000
GroupedList mount 71282 81926 2
GroupedList virtual-rerender 33793 33609 2
GroupedList virtual-rerender-with-unmount 112052 112444 2
GroupedListV2 mount 720 700 2
GroupedListV2 virtual-rerender 671 666 2
GroupedListV2 virtual-rerender-with-unmount 708 697 2
IconButton mount 2565 2532 5000
Label mount 928 935 5000
Layer mount 5467 5490 5000
Link mount 1088 1071 5000
MenuButton mount 2217 2246 5000
MessageBar mount 3166 2961 5000
Nav mount 4349 4271 1000
OverflowSet mount 1744 1744 5000
Panel mount 3189 3246 1000
Persona mount 1646 1699 1000
Pivot mount 2123 2136 1000
PrimaryButton mount 2023 1998 5000
Rating mount 9622 9578 5000
SearchBox mount 2047 2026 5000
Shimmer mount 3851 3850 5000
Slider mount 2709 2785 5000
SpinButton mount 6113 6141 5000
Spinner mount 1021 1013 5000
SplitButton mount 4091 4076 5000
Stack mount 1129 1133 5000
StackWithIntrinsicChildren mount 3284 3268 5000
StackWithTextChildren mount 6724 6602 5000
SwatchColorPicker mount 13778 13743 5000
TagPicker mount 3466 3500 5000
TeachingBubble mount 112765 114507 5000
Text mount 1046 1016 5000
TextField mount 2152 2149 5000
ThemeProvider mount 1944 1916 5000
ThemeProvider virtual-rerender 1364 1378 5000
ThemeProvider virtual-rerender-with-unmount 2729 2748 5000
Toggle mount 1437 1438 5000
buttonNative mount 703 682 5000

@tudorpopams tudorpopams added the CI label Sep 23, 2022
@tudorpopams tudorpopams force-pushed the cicd/build-action branch 2 times, most recently from 13115e8 to d254428 Compare September 26, 2022 09:24
@tudorpopams tudorpopams requested a review from a team September 27, 2022 12:21
@gouttierre gouttierre requested a review from Hotell September 27, 2022 12:22
uses: ./.github/actions/build-to
with:
workspaces: '@fluentui/public-docsite-v9'
backfill-cache-provider-options: ${{ secrets.BACKFILL_CACHE_PROVIDER_OPTIONS }}
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please update our build docs for the docsite release so that this is all in there ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The documentation has been updated for the Chromatic deployment and a new one for the Github Pages deployment was created.

@Hotell Hotell changed the title feat(cicd): add reusable build action ci(.github): add reusable build action Sep 30, 2022
Copy link
Contributor

@Hotell Hotell left a comment

Choose a reason for hiding this comment

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

added some suggestions, otherwise 🚢.it()

run: yarn build --to @fluentui/public-docsite-v9
uses: ./.github/actions/build-to
with:
workspaces: '@fluentui/public-docsite-v9'
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: can this be an array (based on the naming), if not can we rename this to workspace ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked up the option of having inputs as arrays but apparently it's not possible. I thought of naming it workspace initially but you could still pass multiple values here and it will still work.

Copy link
Contributor

Choose a reason for hiding this comment

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

how would that look like ? @fluentui/public-docsite-v9,@fluentui/foo,@fluentui/bar ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Space separated, @fluentui/public-docsite-v9 @fluentui/foo,@fluentui/bar. There's the option of using JS arrays and then JSON.parse them, but I think that will make them worse: community/community#11692 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah lets avoid that. last thing - can you please add documentation to that input so one can find how to define multiple workspaces ? ty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment to give more details about why we chose this approach and improved the field's description.

name: 'Build workspaces'
description: 'Runs the build command for specific workspaces.'
inputs:
workspaces:
Copy link
Contributor

Choose a reason for hiding this comment

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

based on my previous comment, this should be rather singular

Suggested change
workspaces:
workspace:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of the previous discussion (about this input being an array), I think we should keep it plural, ie workspaces.

…pdate all actions to use the new action

Update .github/actions/build-to/action.yml

Co-authored-by: Martin Hochel <[email protected]>
@tudorpopams tudorpopams merged commit 79174e4 into microsoft:master Oct 3, 2022
GeoffCoxMSFT pushed a commit to GeoffCoxMSFT/fluentui that referenced this pull request Oct 3, 2022
…pdate all actions to use the new action (microsoft#24910)

Update .github/actions/build-to/action.yml

Co-authored-by: Martin Hochel <[email protected]>

Co-authored-by: Martin Hochel <[email protected]>
NotWoods pushed a commit to NotWoods/fluentui that referenced this pull request Nov 18, 2022
…pdate all actions to use the new action (microsoft#24910)

Update .github/actions/build-to/action.yml

Co-authored-by: Martin Hochel <[email protected]>

Co-authored-by: Martin Hochel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants