Skip to content

Conversation

@Hotell
Copy link
Contributor

@Hotell Hotell commented Aug 26, 2022

Pre-requirements

Current Behavior

  • we use both webpack 4 and webpack 5 which adds maintenance cost and npm install size

New Behavior

  • we use only webpack 5
  • we use nohoist only for clashing bin links (storybook)
  • web-components
    • has simplified npm scripts
    • applies locked versions for devDeps
    • moves some devDeps (rollup-*) to be coherent with single version policy for devDeps in monorepo

Related Issue(s)

@Hotell Hotell changed the title Hotell/deps/migrate to webpack 5 in whole repo chore: migrate to webpack 5 in whole repo Aug 26, 2022
@github-actions github-actions bot added this to the July Project Cycle Q3 2022 milestone Aug 26, 2022
@DustyTheBot
Copy link

DustyTheBot commented Aug 26, 2022

Warnings
⚠️ There are no updates provided to CHANGELOG. Ensure there are no publicly visible changes introduced by this PR.

Generated by 🚫 dangerJS against 88616f2

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 26, 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 88616f2:

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

@size-auditor
Copy link

size-auditor bot commented Aug 26, 2022

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-northstar-Datepicker 194.068 kB 194.066 kB BelowBaseline     -2 bytes
office-ui-fabric-react fluentui-react-SelectedItemsList 219.97 kB 219.966 kB BelowBaseline     -4 bytes
office-ui-fabric-react fluentui-react-Facepile 199.315 kB 199.311 kB BelowBaseline     -4 bytes
office-ui-fabric-react fluentui-react-TimePicker 225.683 kB 225.675 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-Dropdown 220.265 kB 220.257 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-CommandBar 190.415 kB 190.407 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-TeachingBubble 193.025 kB 193.017 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-ComboBox 236.673 kB 236.665 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-Dialog 198.544 kB 198.536 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-FloatingPicker 229.565 kB 229.557 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-Nav 177.341 kB 177.333 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-SwatchColorPicker 179.724 kB 179.716 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-Grid 170.032 kB 170.024 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-SpinButton 180.744 kB 180.736 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-Panel 188.318 kB 188.31 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-ButtonGrid 170.032 kB 170.024 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-SearchBox 176.846 kB 176.838 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-Breadcrumb 189.351 kB 189.343 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-Pickers 278.779 kB 278.771 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-MessageBar 177.888 kB 177.88 kB BelowBaseline     -8 bytes
office-ui-fabric-react fluentui-react-DocumentCard 204.617 kB 204.609 kB BelowBaseline     -8 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: 7ab1b2af48066e24961610b68762683c4698eb00 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 26, 2022

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1272 1279 5000
Button mount 931 939 5000
FluentProvider mount 1483 1494 5000
FluentProviderWithTheme mount 581 580 10
FluentProviderWithTheme virtual-rerender 541 534 10
FluentProviderWithTheme virtual-rerender-with-unmount 569 582 10
MakeStyles mount 1913 1938 50000
SpinButton mount 2379 2338 5000

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 26, 2022

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
ButtonMinimalPerf.default 151 132 1.14:1
IconMinimalPerf.default 588 563 1.04:1
AnimationMinimalPerf.default 482 468 1.03:1
LabelMinimalPerf.default 344 335 1.03:1
SegmentMinimalPerf.default 311 303 1.03:1
TableMinimalPerf.default 365 354 1.03:1
BoxMinimalPerf.default 305 300 1.02:1
ButtonOverridesMissPerf.default 1023 1000 1.02:1
ChatDuplicateMessagesPerf.default 221 217 1.02:1
FormMinimalPerf.default 334 327 1.02:1
GridMinimalPerf.default 298 292 1.02:1
InputMinimalPerf.default 867 847 1.02:1
ItemLayoutMinimalPerf.default 985 967 1.02:1
ListMinimalPerf.default 461 452 1.02:1
ListNestedPerf.default 472 465 1.02:1
MenuMinimalPerf.default 743 732 1.02:1
SkeletonMinimalPerf.default 308 301 1.02:1
TextAreaMinimalPerf.default 407 399 1.02:1
VideoMinimalPerf.default 609 595 1.02:1
AttachmentMinimalPerf.default 123 122 1.01:1
AvatarMinimalPerf.default 167 166 1.01:1
DividerMinimalPerf.default 315 311 1.01:1
DropdownMinimalPerf.default 2172 2151 1.01:1
FlexMinimalPerf.default 243 240 1.01:1
HeaderMinimalPerf.default 317 315 1.01:1
LoaderMinimalPerf.default 513 506 1.01:1
PortalMinimalPerf.default 138 136 1.01:1
RadioGroupMinimalPerf.default 391 389 1.01:1
ReactionMinimalPerf.default 331 328 1.01:1
RefMinimalPerf.default 187 185 1.01:1
StatusMinimalPerf.default 606 602 1.01:1
CustomToolbarPrototype.default 2180 2158 1.01:1
TreeMinimalPerf.default 708 704 1.01:1
AttachmentSlotsPerf.default 868 864 1:1
ButtonSlotsPerf.default 421 422 1:1
CarouselMinimalPerf.default 354 354 1:1
ChatMinimalPerf.default 635 636 1:1
CheckboxMinimalPerf.default 1541 1536 1:1
DatepickerMinimalPerf.default 4699 4709 1:1
DialogMinimalPerf.default 685 686 1:1
EmbedMinimalPerf.default 2634 2636 1:1
LayoutMinimalPerf.default 316 315 1:1
ListCommonPerf.default 514 515 1:1
RosterPerf.default 1709 1704 1:1
PopupMinimalPerf.default 558 559 1:1
ProviderMergeThemesPerf.default 990 991 1:1
SliderMinimalPerf.default 1226 1228 1:1
SplitButtonMinimalPerf.default 3280 3266 1:1
TableManyItemsPerf.default 1575 1580 1:1
TooltipMinimalPerf.default 1872 1868 1:1
AlertMinimalPerf.default 221 224 0.99:1
CardMinimalPerf.default 467 472 0.99:1
ChatWithPopoverPerf.default 289 291 0.99:1
DropdownManyItemsPerf.default 533 538 0.99:1
ListWith60ListItems.default 499 503 0.99:1
MenuButtonMinimalPerf.default 1342 1358 0.99:1
ProviderMinimalPerf.default 316 318 0.99:1
ToolbarMinimalPerf.default 789 798 0.99:1
HeaderSlotsPerf.default 663 678 0.98:1
TextMinimalPerf.default 299 304 0.98:1
ImageMinimalPerf.default 333 342 0.97:1
TreeWith60ListItems.default 135 140 0.96:1
AccordionMinimalPerf.default 121 127 0.95:1

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 26, 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.511 kB
20.921 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
36.119 kB
9.647 kB
react-button
CompoundButton
43.144 kB
10.86 kB
react-button
MenuButton
38.813 kB
10.551 kB
react-button
SplitButton
46.228 kB
11.933 kB
react-button
ToggleButton
51.888 kB
11.127 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)
74.636 kB
24.186 kB
react-combobox
Dropdown (including child components)
74.236 kB
24.086 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
188.689 kB
52.37 kB
react-components
react-components: FluentProvider & webLightTheme
33.394 kB
11.007 kB
react-dialog
Dialog (including children components)
82.755 kB
24.581 kB
react-divider
Divider
16.459 kB
5.902 kB
react-image
Image
10.78 kB
4.264 kB
react-input
Input
23.757 kB
7.704 kB
react-label
Label
9.338 kB
3.86 kB
react-link
Link
11.784 kB
4.867 kB
react-menu
Menu (including children components)
116.589 kB
35.777 kB
react-menu
Menu (including selectable components)
119.658 kB
36.296 kB
react-overflow
hooks only
10.685 kB
4.104 kB
react-popover
Popover
102.963 kB
31.553 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
44.102 kB
12.425 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
25.013 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.535 kB
14.639 kB
react-utilities
SSRProvider
180 B
159 B
🤖 This report was generated against 7ab1b2af48066e24961610b68762683c4698eb00

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 26, 2022

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 1176 1187 5000
Breadcrumb mount 2930 2976 1000
Checkbox mount 2653 2627 5000
CheckboxBase mount 2363 2364 5000
ChoiceGroup mount 4393 4372 5000
ComboBox mount 1258 1256 1000
CommandBar mount 9544 9546 1000
ContextualMenu mount 11001 11064 1000
DefaultButton mount 1381 1386 5000
DetailsRow mount 3597 3621 5000
DetailsRowFast mount 3641 3630 5000
DetailsRowNoStyles mount 3469 3419 5000
Dialog mount 3097 3124 1000
DocumentCardTitle mount 584 588 1000
Dropdown mount 3220 3229 5000
FocusTrapZone mount 2002 2042 5000
FocusZone mount 1951 1943 5000
GroupedList mount 53479 59992 2
GroupedList virtual-rerender 25312 25167 2
GroupedList virtual-rerender-with-unmount 94961 93618 2
GroupedListV2 mount 560 569 2
GroupedListV2 virtual-rerender 535 531 2
GroupedListV2 virtual-rerender-with-unmount 540 568 2
IconButton mount 1955 1892 5000
Label mount 733 733 5000
Layer mount 4282 4285 5000
Link mount 849 818 5000
MenuButton mount 1703 1667 5000
MessageBar mount 2288 2347 5000
Nav mount 3278 3238 1000
OverflowSet mount 1357 1377 5000
Panel mount 2592 2537 1000
Persona mount 1277 1255 1000
Pivot mount 1658 1642 1000
PrimaryButton mount 1505 1507 5000
Rating mount 7007 6987 5000
SearchBox mount 1522 1509 5000
Shimmer mount 2892 2884 5000
Slider mount 2063 2074 5000
SpinButton mount 4688 4654 5000
Spinner mount 811 787 5000
SplitButton mount 3332 3118 5000
Stack mount 857 870 5000
StackWithIntrinsicChildren mount 2382 2338 5000
StackWithTextChildren mount 4815 4815 5000
SwatchColorPicker mount 10493 10476 5000
TagPicker mount 2609 2644 5000
TeachingBubble mount 92620 89464 5000
Text mount 797 786 5000
TextField mount 1581 1600 5000
ThemeProvider mount 1525 1528 5000
ThemeProvider virtual-rerender 1082 1079 5000
ThemeProvider virtual-rerender-with-unmount 2144 2150 5000
Toggle mount 1098 1104 5000
buttonNative mount 535 553 5000

@Hotell Hotell self-assigned this Aug 26, 2022
@Hotell Hotell force-pushed the hotell/deps/migrate-to-webpack-5-in-whole-repo branch from faa62d4 to 109980d Compare September 26, 2022 13:34
// `stylis@3` is a CJS library, there are known issues with them:
// https://github.com/rollup/rollup/issues/1267#issuecomment-446681320
const Stylis = (_Stylis as any).default || _Stylis;
const Stylis: typeof import('stylis') = (_Stylis as any).default || _Stylis;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enabling type checking

"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/scripts": "^1.0.0",
"rollup": "^2.7.6",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

single version policy

// `stylis@3` is a CJS library, there are known issues with them:
// https://github.com/rollup/rollup/issues/1267#issuecomment-446681320
const Stylis = (_Stylis as any).default || _Stylis;
const Stylis: typeof import('stylis') = (_Stylis as any).default || _Stylis;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enabling type checking

"@fluentui/react-northstar": "^0.64.0"
},
"devDependencies": {
"source-map-loader": "2.0.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.

single version policy

"start": "yarn start-storybook -p 6006 --docs",
"start-storybook": "node node_modules/@storybook/html/bin/index.js",
"build-storybook": "node node_modules/@storybook/html/bin/build.js -o ./dist/storybook --docs",
"format": "prettier -w 'src/**/(*.ts|*.html)' --ignore-path ../../.prettierignore",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

simplified aliases / aligned to use consistent vocabulary within repo

"karma-webpack": "^4.0.2",
"mocha": "^7.1.2",
"rollup": "^2.41.0",
"rollup-plugin-commonjs": "^10.1.0",
Copy link
Contributor Author

@Hotell Hotell Sep 26, 2022

Choose a reason for hiding this comment

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

all rollup* packages were propagated to single version policy approach, karma will be moved in another PR

@Hotell Hotell force-pushed the hotell/deps/migrate-to-webpack-5-in-whole-repo branch from 109980d to e3cc1c1 Compare September 26, 2022 13:41
"check:change": "beachball check",
"check:modified-files": "yarn workspace @fluentui/scripts just check-for-modified-files",
"check:affected-package": "node ./scripts/monorepo/checkIfPackagesAffected.js",
"check:installed-dependencies-versions": "satisfied --skip-invalid --ignore \"prettier|angular|lit|sass|@storybook/web-components|@storybook/html|@storybook/mdx2-csf|svelte|@testing-library|vue|@cypress/react|cypress|@swc/wasm|@cactuslab/usepubsub\"",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

storybook/web-components doesnt exist - removed

@Hotell
Copy link
Contributor Author

Hotell commented Sep 26, 2022

@chrisdholt I checked WC storybook and everything looks fine but I'd appreciate if you could double-check 🙌

"ts-node": "10.9.1",
"tsconfig-paths": "3.9.0",
"tsconfig-paths-webpack-plugin": "3.5.2",
"tsconfig-paths": "4.1.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.

bump needed as 3.x contains incompatible type definitions with latest webpack

strip-bom "^3.0.0"

tsconfig-paths@^3.12.0:
tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.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.

will be deduped once we migrated to nx 14

hints: false,
},
optimization: {
namedModules: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hotell Hotell closed this Sep 26, 2022
@Hotell Hotell reopened this Sep 26, 2022
@Hotell Hotell marked this pull request as ready for review September 26, 2022 17:17
@Hotell Hotell changed the title chore: migrate to webpack 5 in whole repo chore: migrate whole repo webpack 5 Sep 26, 2022
@Hotell Hotell changed the title chore: migrate whole repo webpack 5 chore: migrate whole repo to webpack 5 Sep 26, 2022
integrity sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==

webpack@4, webpack@^4.43.0:
webpack@4:
Copy link
Member

Choose a reason for hiding this comment

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

image

image

Wondering what still requires it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

storybook :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

storybook is very slow (known fact) as it re-builds its core on every run. Fun fact is that it also still uses webpack 4 to build itself. this will be partially mitigated in storybook 7.

@Hotell Hotell requested a review from layershifter September 27, 2022 09:13
Copy link
Member

@chrisdholt chrisdholt left a comment

Choose a reason for hiding this comment

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

LGTM - Pinging @EisenbergEffect just to sanity check.

@Hotell Hotell merged commit 337a32b into microsoft:master Oct 4, 2022
@Hotell Hotell deleted the hotell/deps/migrate-to-webpack-5-in-whole-repo branch October 4, 2022 15:46
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Oct 5, 2022
* master: (62 commits)
  chore(migrate-converged): add functionality to execute various v9 package file restructuring tasks (microsoft#24458)
  chore(react-dialog): updates stories (microsoft#25070)
  refactor Progress to remove label and description slots (microsoft#25067)
  fix(SplitButton): Remove borders from hover and pressed state in primary split buttons (microsoft#25059)
  chore(react-persona): Add vr, conformance, and unit tests (microsoft#25007)
  (docs): update Icon docs with examples (microsoft#24768)
  Split button/primary hc fix (microsoft#25066)
  chore(react-utilities): restricts trigger API types (microsoft#25044)
  Add utilities export @fluentui/style-utilities v8 (microsoft#25065)
  chore: migrate whole repo to webpack 5 (microsoft#24542)
  applying package updates
  BREAKING: refactor `useTable` to be composable (microsoft#24947)
  Added shims to shim packages (microsoft#25048)
  Add Progress SPEC (microsoft#24418)
  applying package updates
  chore(react-persona): Add bundle-size command for bundle-size fixtures (microsoft#25055)
  fix(Button): Remove margin added to buttons by Safari (microsoft#25052)
  fix: Menu triggers no longer take focus when they are mounted (microsoft#25016)
  chore: deletes react-trigger package (microsoft#25042)
  Fixed a minor typo: immmediately => immediately (microsoft#25036)
  ...
@Hotell Hotell mentioned this pull request Nov 2, 2022
28 tasks
NotWoods pushed a commit to NotWoods/fluentui that referenced this pull request Nov 18, 2022
* chore: migrate web-components to webpack5 and apply single version policy

* chore: remove nohoist for stylis

* chore: generate change files

* chore: undo @storybook/html single version policy move

* chore: dedup wepback 5

* chore: bump tsconfig-paths to resolve TS violations

* chore: dedupe terser

* chore: update karma to run with webpack 5
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.

8 participants