Skip to content

Conversation

@Hotell
Copy link
Contributor

@Hotell Hotell commented Nov 24, 2022

Previous Behavior

not all v8 and v8 related packages have enabled isolatedModules which leads to compiler errors/warnings when esbuild/swc/babel is being used.

not following isolatedModules may also cause worse tree-shake-ability on consumers side and issues when migrating to new TS versions in the future.

New Behavior

All v8 and v8 related packages have enabled isolatedModules

  • explicit type imports applied within merge-styles which is a direct dependency of fluentui/react (the main culpirt of compiler errors when using v8)
  • @fluentui/font-icons-mdl2 remains the only package in our repo without isolatedModules
    • its because it uses constEnums and removing those would be a breaking change 🩻

Related Issue(s)

* Types in this file provide const enums replacement that will compile with isolatedModules
*/

import type { ApiItemKind as _ApiItemKind } from '@microsoft/api-extractor-model';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately those packages heavily rely on const enums, so to be able to have isolatedModules this is the only workaround

@@ -1,17 +1,24 @@
export { IStyle, IStyleBase, IStyleBaseArray } from './IStyle';
export type { IStyle, IStyleBase, IStyleBaseArray } from './IStyle';
Copy link
Contributor Author

@Hotell Hotell Nov 24, 2022

Choose a reason for hiding this comment

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

properly enforced type exports - thanks to isolateModules

@Hotell Hotell added Fluent UI react (v8) Issues about @fluentui/react (v8) Area: Typescript labels Nov 24, 2022
@Hotell Hotell removed this from the October Project Cycle Q4 2022 milestone Nov 24, 2022
@fabricteam
Copy link
Collaborator

fabricteam commented Nov 24, 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
3.153 kB
1.299 kB
react-accordion
Accordion (including children components)
79.294 kB
24.443 kB
react-alert
Alert
82.967 kB
21.022 kB
react-avatar
Avatar
51.076 kB
14.285 kB
react-avatar
AvatarGroup
15.006 kB
6.009 kB
react-avatar
AvatarGroupItem
67.306 kB
18.581 kB
react-badge
Badge
23.357 kB
7.361 kB
react-badge
CounterBadge
24.247 kB
7.643 kB
react-badge
PresenceBadge
24.001 kB
7.049 kB
react-button
Button
32.923 kB
8.61 kB
react-button
CompoundButton
39.953 kB
9.933 kB
react-button
MenuButton
37.611 kB
9.942 kB
react-button
SplitButton
45.057 kB
11.323 kB
react-button
ToggleButton
48.753 kB
10.715 kB
react-card
Card - All
71.873 kB
20.936 kB
react-card
Card
67.651 kB
19.892 kB
react-card
CardFooter
8.617 kB
3.62 kB
react-card
CardHeader
9.792 kB
3.995 kB
react-card
CardPreview
8.718 kB
3.674 kB
react-combobox
Combobox (including child components)
78.244 kB
25.015 kB
react-combobox
Dropdown (including child components)
77.531 kB
24.927 kB
react-components
react-components: Button, FluentProvider & webLightTheme
59.018 kB
16.371 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
186.456 kB
52.327 kB
react-components
react-components: FluentProvider & webLightTheme
33.48 kB
11.037 kB
react-dialog
Dialog (including children components)
83.036 kB
24.754 kB
react-divider
Divider
16.515 kB
5.921 kB
react-image
Image
10.836 kB
4.283 kB
react-infobutton
InfoButton
117.922 kB
35.391 kB
react-input
Input
24.194 kB
7.89 kB
react-label
Label
9.394 kB
3.88 kB
react-link
Link
11.862 kB
4.885 kB
react-menu
Menu (including children components)
117.61 kB
36.287 kB
react-menu
Menu (including selectable components)
120.679 kB
36.82 kB
react-overflow
hooks only
11.004 kB
4.188 kB
react-persona
Persona
57.131 kB
15.951 kB
react-popover
Popover
103.666 kB
31.858 kB
react-portal
Portal
10.495 kB
3.851 kB
react-portal-compat
PortalCompatProvider
5.857 kB
1.978 kB
react-positioning
usePositioning
19.826 kB
7.417 kB
react-progress
Progress
13.536 kB
5.107 kB
react-provider
FluentProvider
15.817 kB
5.905 kB
react-radio
Radio
36.446 kB
12.123 kB
react-radio
RadioGroup
14.304 kB
5.72 kB
react-select
Select
23.474 kB
8.017 kB
react-slider
Slider
32.118 kB
10.192 kB
react-spinbutton
SpinButton
44.502 kB
12.812 kB
react-spinner
Spinner
20.013 kB
6.446 kB
react-switch
Switch
33.453 kB
10.581 kB
react-text
Text - Default
11.838 kB
4.625 kB
react-text
Text - Wrappers
15.148 kB
5.06 kB
react-textarea
Textarea
25.733 kB
8.328 kB
react-theme
Single theme token import
69 B
89 B
react-theme
Teams: all themes
29.722 kB
6.462 kB
react-theme
Teams: Light theme
17.51 kB
5.075 kB
react-tooltip
Tooltip
42.032 kB
14.739 kB
react-utilities
SSRProvider
180 B
159 B
🤖 This report was generated against 076ac58a921376c6ee488f10e610dc05095acbf3

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 24, 2022

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1265 1298 5000
Button mount 914 935 5000
FluentProvider mount 1500 1502 5000
FluentProviderWithTheme mount 570 584 10
FluentProviderWithTheme virtual-rerender 540 550 10
FluentProviderWithTheme virtual-rerender-with-unmount 573 579 10
MakeStyles mount 1952 1977 50000
SpinButton mount 2347 2298 5000

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 24, 2022

🕵 fluentuiv8 Open the Visual Regressions report to inspect the 7 screenshots

✅ There was 0 screenshots added, 4 screenshots removed, 1032 screenshots unchanged, 0 screenshots with different dimensions and 3 screenshots with visible difference.

unknown 7 screenshots
Image Name Diff(in Pixels) Image Type
TagPicker.Root.chromium.png 174 Changed
TagPicker.Selected - RTL.chromium.png 174 Changed
TagPicker.Selected.chromium.png 174 Changed
Pivot - Overflow.Root.Narrow - Last tab selected.chromium.png 0 Removed
Pivot - Overflow.Root.Narrow - Overflow menu.chromium.png 0 Removed
Pivot - Overflow.Tabs - RTL.Narrow - Last tab selected.chromium.png 0 Removed
Pivot - Overflow.Tabs - RTL.Narrow - Overflow menu.chromium.png 0 Removed

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 24, 2022

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
HeaderSlotsPerf.default 853 749 1.14:1
BoxMinimalPerf.default 362 321 1.13:1
ListWith60ListItems.default 664 604 1.1:1
ReactionMinimalPerf.default 391 359 1.09:1
TextAreaMinimalPerf.default 496 461 1.08:1
AnimationMinimalPerf.default 548 514 1.07:1
SkeletonMinimalPerf.default 348 326 1.07:1
ProviderMinimalPerf.default 436 411 1.06:1
RadioGroupMinimalPerf.default 456 431 1.06:1
FormMinimalPerf.default 392 374 1.05:1
StatusMinimalPerf.default 716 685 1.05:1
ChatWithPopoverPerf.default 366 352 1.04:1
FlexMinimalPerf.default 305 292 1.04:1
ProviderMergeThemesPerf.default 1342 1285 1.04:1
InputMinimalPerf.default 1206 1171 1.03:1
RosterPerf.default 2226 2160 1.03:1
PopupMinimalPerf.default 682 659 1.03:1
SegmentMinimalPerf.default 366 355 1.03:1
IconMinimalPerf.default 674 652 1.03:1
DatepickerMinimalPerf.default 6223 6083 1.02:1
DropdownMinimalPerf.default 2730 2679 1.02:1
SplitButtonMinimalPerf.default 4577 4468 1.02:1
ToolbarMinimalPerf.default 968 947 1.02:1
AttachmentSlotsPerf.default 1104 1092 1.01:1
CheckboxMinimalPerf.default 2065 2050 1.01:1
GridMinimalPerf.default 360 355 1.01:1
SliderMinimalPerf.default 1593 1582 1.01:1
CustomToolbarPrototype.default 2799 2765 1.01:1
AvatarMinimalPerf.default 199 200 1:1
CarouselMinimalPerf.default 469 470 1:1
EmbedMinimalPerf.default 3691 3690 1:1
ItemLayoutMinimalPerf.default 1241 1235 1:1
RefMinimalPerf.default 234 234 1:1
TooltipMinimalPerf.default 2347 2346 1:1
ButtonMinimalPerf.default 171 173 0.99:1
ButtonOverridesMissPerf.default 1314 1328 0.99:1
ChatDuplicateMessagesPerf.default 266 268 0.99:1
ChatMinimalPerf.default 714 723 0.99:1
LabelMinimalPerf.default 382 385 0.99:1
LayoutMinimalPerf.default 343 345 0.99:1
TableManyItemsPerf.default 1896 1908 0.99:1
TreeMinimalPerf.default 833 838 0.99:1
VideoMinimalPerf.default 746 750 0.99:1
ButtonSlotsPerf.default 540 549 0.98:1
ListNestedPerf.default 557 570 0.98:1
AttachmentMinimalPerf.default 136 140 0.97:1
DialogMinimalPerf.default 775 798 0.97:1
DividerMinimalPerf.default 349 359 0.97:1
ListMinimalPerf.default 497 512 0.97:1
DropdownManyItemsPerf.default 660 691 0.96:1
ListCommonPerf.default 659 689 0.96:1
TableMinimalPerf.default 400 417 0.96:1
AccordionMinimalPerf.default 138 146 0.95:1
AlertMinimalPerf.default 257 271 0.95:1
TextMinimalPerf.default 348 368 0.95:1
LoaderMinimalPerf.default 351 375 0.94:1
MenuMinimalPerf.default 848 898 0.94:1
MenuButtonMinimalPerf.default 1687 1795 0.94:1
ImageMinimalPerf.default 366 394 0.93:1
CardMinimalPerf.default 515 567 0.91:1
PortalMinimalPerf.default 158 178 0.89:1
HeaderMinimalPerf.default 338 384 0.88:1
TreeWith60ListItems.default 153 186 0.82:1

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 24, 2022

🕵 fluentuiv9 Open the Visual Regressions report to inspect the 2 screenshots

✅ There was 0 screenshots added, 0 screenshots removed, 1752 screenshots unchanged, 0 screenshots with different dimensions and 2 screenshots with visible difference.

unknown 2 screenshots
Image Name Diff(in Pixels) Image Type
Avatar Converged.size+active+badge.normal.chromium.png 8 Changed
Avatar Converged.size+active+ring-shadow.normal.chromium.png 4 Changed

// eslint-disable-next-line deprecation/deprecation
export { IconNames, IconNamesInput } from './IconNames';
/* eslint-disable deprecation/deprecation */
export type { IconNamesInput } from './IconNames';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

although this package is the only one in monorepo that cannot use isolateModules because const enum is used ( it would increase customer bundle size if they use typescript for compilation. if customer is not using typescript this wouldn;t be breaking change) we still get warnings from swc/babel because incorrectly re-exported type.

@size-auditor
Copy link

size-auditor bot commented Nov 24, 2022

Asset size changes

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

Baseline commit: 076ac58a921376c6ee488f10e610dc05095acbf3 (build)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 24, 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 6674c82:

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

@fabricteam
Copy link
Collaborator

fabricteam commented Nov 24, 2022

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 1197 1206 5000
Breadcrumb mount 2784 2873 1000
Checkbox mount 2662 2601 5000
CheckboxBase mount 2378 2374 5000
ChoiceGroup mount 4304 4264 5000
ComboBox mount 1194 1156 1000
CommandBar mount 9206 9296 1000
ContextualMenu mount 10162 10146 1000
DefaultButton mount 1356 1367 5000
DetailsRow mount 3411 3399 5000
DetailsRowFast mount 3395 3405 5000
DetailsRowNoStyles mount 3230 3255 5000
Dialog mount 2980 2948 1000
DocumentCardTitle mount 583 579 1000
Dropdown mount 3145 3168 5000
FocusTrapZone mount 1955 1960 5000
FocusZone mount 1933 1941 5000
GroupedList mount 1836 2064 2
GroupedList virtual-rerender 1114 1103 2
GroupedList virtual-rerender-with-unmount 1609 1625 2
GroupedListV2 mount 556 576 2
GroupedListV2 virtual-rerender 548 565 2
GroupedListV2 virtual-rerender-with-unmount 563 568 2
IconButton mount 1801 1797 5000
Label mount 753 770 5000
Layer mount 4170 4232 5000
Link mount 847 831 5000
MenuButton mount 1600 1620 5000
MessageBar mount 2317 2341 5000
Nav mount 3045 3099 1000
OverflowSet mount 1412 1408 5000
Panel mount 2565 2477 1000
Persona mount 1254 1307 1000
Pivot mount 1497 1634 1000
PrimaryButton mount 1491 1504 5000
Rating mount 7005 7020 5000
SearchBox mount 1508 1524 5000
Shimmer mount 2919 2918 5000
Slider mount 2103 2133 5000
SpinButton mount 4340 4285 5000
Spinner mount 841 821 5000
SplitButton mount 2863 2857 5000
Stack mount 864 861 5000
StackWithIntrinsicChildren mount 2352 2332 5000
StackWithTextChildren mount 5050 5044 5000
SwatchColorPicker mount 9612 9467 5000
TagPicker mount 2325 2339 5000
TeachingBubble mount 76172 76002 5000
Text mount 833 820 5000
TextField mount 1553 1563 5000
ThemeProvider mount 1446 1449 5000
ThemeProvider virtual-rerender 1141 1136 5000
ThemeProvider virtual-rerender-with-unmount 1992 2010 5000
Toggle mount 1146 1135 5000
buttonNative mount 534 535 5000

@Hotell Hotell removed this from the October Project Cycle Q4 2022 milestone Nov 24, 2022
@Hotell Hotell changed the title chore: enable isolateModules in all packages chore: enable isolateModules in all v8 packages Nov 25, 2022
@Hotell Hotell marked this pull request as ready for review November 25, 2022 12:06
@Hotell Hotell requested review from a team, Jahnp, bigbadcapers and dzearing as code owners November 25, 2022 12:06
@Hotell Hotell removed this from the October Project Cycle Q4 2022 milestone Nov 25, 2022
@Hotell Hotell force-pushed the hotell/v8/fix-isolate-modules branch from ad5a13f to 6674c82 Compare November 29, 2022 17:57
@Hotell
Copy link
Contributor Author

Hotell commented Nov 30, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@Hotell Hotell merged commit c46ff8d into microsoft:master Nov 30, 2022
@Hotell Hotell deleted the hotell/v8/fix-isolate-modules branch November 30, 2022 11:00
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Dec 1, 2022
* master:
  BREAKING: `useTable` renamed to `useTableFeatures` (microsoft#25797)
  chore: add retries for navigation in ssr-tests-v9 (microsoft#25844)
  fix: Cell actions should have correct background when row focused within (microsoft#25790)
  applying package updates
  Disable 3 Avatar Converged active stories (microsoft#25765)
  chore: introduce TS path aliases for improved DX in v8 (microsoft#25778)
  chore: prepare release react-northstar 0.65.0 (microsoft#25446)
  refactor(scripts): encapsulate v0 and v8 tooling within its domain boundaries (microsoft#25738)
  Support single point in area chart (microsoft#25842)
  chore: enable isolateModules in all v8 packages (microsoft#25774)
  chore: refactor styles for Button (microsoft#25216)
  feat: Improve docs for `DataGrid`, export as unstable (microsoft#25805)
  applying package updates
  fix: Allow data-selection-disabled to be respected by DetailsRow (microsoft#25836)
  docs(rfcs): Update recipes rfc with chosen option and add more details (microsoft#25823)
  chore(react-textarea): migrate to new package structure (microsoft#25820)
  chore(react-switch): migrate to new package structure (microsoft#25819)
  fix(react-avatar): AvatarGroup's pie layout places inline items correctly in rtl (microsoft#25822)
  chore: add few improvements to toolbar stories (microsoft#25635)
Hotell added a commit to Hotell/fluentui that referenced this pull request Feb 9, 2023
* chore: enable isolateModules in all packages

* generate changefiles

* feat: remove obsolete useTheme knob from storybook package that were causing isolateModules errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Typescript Fluent UI react (v8) Issues about @fluentui/react (v8)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants