fix(babel-make-styles): handle member expressions#18973
Conversation
|
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 b3cceba:
|
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 8ebf2d422547bda60eb22eae2b12c3bd1339ec06 (build) |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 777 | 813 | 5000 | |
| BaseButton | mount | 892 | 871 | 5000 | |
| Breadcrumb | mount | 2598 | 2612 | 1000 | |
| ButtonNext | mount | 540 | 534 | 5000 | |
| Checkbox | mount | 1515 | 1504 | 5000 | |
| CheckboxBase | mount | 1304 | 1316 | 5000 | |
| ChoiceGroup | mount | 4766 | 4780 | 5000 | |
| ComboBox | mount | 987 | 981 | 1000 | |
| CommandBar | mount | 10472 | 10477 | 1000 | |
| ContextualMenu | mount | 6453 | 6339 | 1000 | |
| DefaultButton | mount | 1143 | 1122 | 5000 | |
| DetailsRow | mount | 3800 | 3736 | 5000 | |
| DetailsRowFast | mount | 3783 | 3846 | 5000 | |
| DetailsRowNoStyles | mount | 3527 | 3533 | 5000 | |
| Dialog | mount | 2149 | 2184 | 1000 | |
| DocumentCardTitle | mount | 146 | 159 | 1000 | |
| Dropdown | mount | 3239 | 3231 | 5000 | |
| FluentProviderNext | mount | 7449 | 7347 | 5000 | |
| FocusTrapZone | mount | 1762 | 1862 | 5000 | |
| FocusZone | mount | 1849 | 1842 | 5000 | |
| IconButton | mount | 1746 | 1731 | 5000 | |
| Label | mount | 343 | 347 | 5000 | |
| Layer | mount | 1766 | 1753 | 5000 | |
| Link | mount | 465 | 492 | 5000 | |
| MakeStyles | mount | 1816 | 1818 | 50000 | |
| MenuButton | mount | 1474 | 1491 | 5000 | |
| MessageBar | mount | 2084 | 2040 | 5000 | |
| Nav | mount | 3276 | 3254 | 1000 | |
| OverflowSet | mount | 1055 | 1021 | 5000 | |
| Panel | mount | 2062 | 2073 | 1000 | |
| Persona | mount | 823 | 840 | 1000 | |
| Pivot | mount | 1404 | 1451 | 1000 | |
| PrimaryButton | mount | 1265 | 1303 | 5000 | |
| Rating | mount | 7722 | 7700 | 5000 | |
| SearchBox | mount | 1298 | 1308 | 5000 | |
| Shimmer | mount | 2563 | 2562 | 5000 | |
| Slider | mount | 1943 | 2005 | 5000 | |
| SpinButton | mount | 4997 | 5029 | 5000 | |
| Spinner | mount | 431 | 421 | 5000 | |
| SplitButton | mount | 3172 | 3151 | 5000 | |
| Stack | mount | 497 | 513 | 5000 | |
| StackWithIntrinsicChildren | mount | 1472 | 1544 | 5000 | |
| StackWithTextChildren | mount | 4443 | 4473 | 5000 | |
| SwatchColorPicker | mount | 10093 | 10120 | 5000 | |
| Tabs | mount | 1428 | 1381 | 1000 | |
| TagPicker | mount | 2413 | 2414 | 5000 | |
| TeachingBubble | mount | 11928 | 11799 | 5000 | |
| Text | mount | 420 | 423 | 5000 | |
| TextField | mount | 1377 | 1400 | 5000 | |
| ThemeProvider | mount | 1205 | 1173 | 5000 | |
| ThemeProvider | virtual-rerender | 601 | 609 | 5000 | |
| Toggle | mount | 793 | 808 | 5000 | |
| buttonNative | mount | 115 | 119 | 5000 |
Perf Analysis (@fluentui/react-northstar)
Perf tests with no regressions
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| ButtonMinimalPerf.default | 175 | 157 | 1.11:1 |
| ImageMinimalPerf.default | 377 | 354 | 1.06:1 |
| ListCommonPerf.default | 648 | 613 | 1.06:1 |
| TextAreaMinimalPerf.default | 520 | 493 | 1.05:1 |
| AnimationMinimalPerf.default | 421 | 406 | 1.04:1 |
| AttachmentMinimalPerf.default | 156 | 150 | 1.04:1 |
| ChatDuplicateMessagesPerf.default | 292 | 281 | 1.04:1 |
| DropdownMinimalPerf.default | 3193 | 3079 | 1.04:1 |
| PortalMinimalPerf.default | 188 | 180 | 1.04:1 |
| SegmentMinimalPerf.default | 353 | 340 | 1.04:1 |
| VideoMinimalPerf.default | 631 | 607 | 1.04:1 |
| ChatWithPopoverPerf.default | 372 | 360 | 1.03:1 |
| DialogMinimalPerf.default | 758 | 738 | 1.03:1 |
| SkeletonMinimalPerf.default | 352 | 343 | 1.03:1 |
| AttachmentSlotsPerf.default | 1046 | 1029 | 1.02:1 |
| ButtonSlotsPerf.default | 551 | 538 | 1.02:1 |
| CardMinimalPerf.default | 551 | 538 | 1.02:1 |
| FlexMinimalPerf.default | 289 | 284 | 1.02:1 |
| InputMinimalPerf.default | 1273 | 1249 | 1.02:1 |
| RadioGroupMinimalPerf.default | 447 | 437 | 1.02:1 |
| SplitButtonMinimalPerf.default | 3819 | 3761 | 1.02:1 |
| TextMinimalPerf.default | 353 | 346 | 1.02:1 |
| TooltipMinimalPerf.default | 1012 | 995 | 1.02:1 |
| BoxMinimalPerf.default | 344 | 340 | 1.01:1 |
| ChatMinimalPerf.default | 674 | 669 | 1.01:1 |
| DividerMinimalPerf.default | 364 | 361 | 1.01:1 |
| HeaderSlotsPerf.default | 768 | 761 | 1.01:1 |
| MenuButtonMinimalPerf.default | 1634 | 1610 | 1.01:1 |
| PopupMinimalPerf.default | 597 | 591 | 1.01:1 |
| ProviderMergeThemesPerf.default | 1685 | 1671 | 1.01:1 |
| StatusMinimalPerf.default | 677 | 673 | 1.01:1 |
| IconMinimalPerf.default | 608 | 600 | 1.01:1 |
| TableMinimalPerf.default | 401 | 399 | 1.01:1 |
| CustomToolbarPrototype.default | 3867 | 3830 | 1.01:1 |
| ToolbarMinimalPerf.default | 937 | 924 | 1.01:1 |
| TreeMinimalPerf.default | 790 | 781 | 1.01:1 |
| AccordionMinimalPerf.default | 161 | 161 | 1:1 |
| AlertMinimalPerf.default | 274 | 275 | 1:1 |
| CarouselMinimalPerf.default | 452 | 451 | 1:1 |
| CheckboxMinimalPerf.default | 2735 | 2744 | 1:1 |
| EmbedMinimalPerf.default | 4111 | 4099 | 1:1 |
| HeaderMinimalPerf.default | 360 | 359 | 1:1 |
| LayoutMinimalPerf.default | 369 | 368 | 1:1 |
| ListNestedPerf.default | 539 | 538 | 1:1 |
| RosterPerf.default | 1170 | 1168 | 1:1 |
| TableManyItemsPerf.default | 1861 | 1869 | 1:1 |
| ButtonOverridesMissPerf.default | 1691 | 1702 | 0.99:1 |
| DatepickerMinimalPerf.default | 5706 | 5747 | 0.99:1 |
| DropdownManyItemsPerf.default | 673 | 680 | 0.99:1 |
| GridMinimalPerf.default | 329 | 331 | 0.99:1 |
| ItemLayoutMinimalPerf.default | 1220 | 1235 | 0.99:1 |
| LabelMinimalPerf.default | 391 | 393 | 0.99:1 |
| MenuMinimalPerf.default | 853 | 862 | 0.99:1 |
| SliderMinimalPerf.default | 1548 | 1565 | 0.99:1 |
| TreeWith60ListItems.default | 162 | 163 | 0.99:1 |
| ListMinimalPerf.default | 505 | 516 | 0.98:1 |
| ListWith60ListItems.default | 629 | 645 | 0.98:1 |
| LoaderMinimalPerf.default | 680 | 694 | 0.98:1 |
| ProviderMinimalPerf.default | 970 | 989 | 0.98:1 |
| ReactionMinimalPerf.default | 363 | 375 | 0.97:1 |
| AvatarMinimalPerf.default | 195 | 204 | 0.96:1 |
| FormMinimalPerf.default | 397 | 412 | 0.96:1 |
| RefMinimalPerf.default | 238 | 247 | 0.96:1 |
| gridGap, | ||
| }); | ||
|
|
||
| export const typography: Record<'text' | 'header', MakeStyles> = { |
There was a problem hiding this comment.
should we also add an example with namespace export ?
There was a problem hiding this comment.
Not really, as we are testing makeStyles() call itself. Even this was throwing before:
const typography = {
header: { color: 'red' }
}
export const useStyles = makeStyles({
header: typography.header,
})|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
* fix(babel-make-styles): handle member expressions * Change files
Pull request checklist
$ yarn changeDescription of changes
This PR adds handling of
MemberExpressionin@fluentui/babel-make-stylesand covers it with tests. This fix is a blocker for #18968 where it causes a build failure: