-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix(makeStyles): handle comma separated selectors #20348
Conversation
π Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: b5b740100714724214e097fae2f7c1f51f294e35 (build) |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 1025 | 1047 | 5000 | |
BaseButton | mount | 1046 | 1070 | 5000 | |
Breadcrumb | mount | 2780 | 2804 | 1000 | |
ButtonNext | mount | 580 | 570 | 5000 | |
Checkbox | mount | 1759 | 1719 | 5000 | |
CheckboxBase | mount | 1468 | 1494 | 5000 | |
ChoiceGroup | mount | 5257 | 5344 | 5000 | |
ComboBox | mount | 1046 | 1079 | 1000 | |
CommandBar | mount | 10921 | 10832 | 1000 | |
ContextualMenu | mount | 6932 | 6843 | 1000 | |
DefaultButton | mount | 1293 | 1263 | 5000 | |
DetailsRow | mount | 4163 | 4136 | 5000 | |
DetailsRowFast | mount | 4154 | 4282 | 5000 | |
DetailsRowNoStyles | mount | 3953 | 3997 | 5000 | |
Dialog | mount | 2742 | 2749 | 1000 | |
DocumentCardTitle | mount | 179 | 189 | 1000 | |
Dropdown | mount | 3659 | 3659 | 5000 | |
FluentProviderNext | mount | 3442 | 3463 | 5000 | |
FluentProviderWithTheme | mount | 210 | 224 | 10 | |
FluentProviderWithTheme | virtual-rerender | 108 | 114 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 255 | 237 | 10 | |
FocusTrapZone | mount | 1981 | 1945 | 5000 | |
FocusZone | mount | 1939 | 1912 | 5000 | |
IconButton | mount | 1989 | 2037 | 5000 | |
Label | mount | 392 | 386 | 5000 | |
Layer | mount | 3305 | 3294 | 5000 | |
Link | mount | 532 | 523 | 5000 | |
MakeStyles | mount | 1933 | 1944 | 50000 | |
MenuButton | mount | 1679 | 1665 | 5000 | |
MessageBar | mount | 2212 | 2176 | 5000 | |
Nav | mount | 3682 | 3654 | 1000 | |
OverflowSet | mount | 1248 | 1248 | 5000 | |
Panel | mount | 2594 | 2651 | 1000 | |
Persona | mount | 927 | 929 | 1000 | |
Pivot | mount | 1602 | 1579 | 1000 | |
PrimaryButton | mount | 1437 | 1475 | 5000 | |
Rating | mount | 8771 | 8807 | 5000 | |
SearchBox | mount | 1487 | 1537 | 5000 | |
Shimmer | mount | 2861 | 2880 | 5000 | |
Slider | mount | 2194 | 2189 | 5000 | |
SpinButton | mount | 5578 | 5922 | 5000 | |
Spinner | mount | 453 | 469 | 5000 | |
SplitButton | mount | 3555 | 3495 | 5000 | |
Stack | mount | 581 | 588 | 5000 | |
StackWithIntrinsicChildren | mount | 1941 | 1942 | 5000 | |
StackWithTextChildren | mount | 5369 | 5444 | 5000 | |
SwatchColorPicker | mount | 11484 | 11596 | 5000 | |
Tabs | mount | 1646 | 1565 | 1000 | |
TagPicker | mount | 2887 | 2892 | 5000 | |
TeachingBubble | mount | 13897 | 13977 | 5000 | |
Text | mount | 474 | 489 | 5000 | |
TextField | mount | 1525 | 1561 | 5000 | |
ThemeProvider | mount | 1283 | 1327 | 5000 | |
ThemeProvider | virtual-rerender | 663 | 656 | 5000 | |
ThemeProvider | virtual-rerender-with-unmount | 2079 | 2089 | 5000 | |
Toggle | mount | 915 | 910 | 5000 | |
buttonNative | mount | 174 | 166 | 5000 |
Perf Analysis (@fluentui/react-northstar
)
Perf tests with no regressions
Scenario | Current PR Ticks | Baseline Ticks | Ratio |
---|---|---|---|
CardMinimalPerf.default | 677 | 622 | 1.09:1 |
ItemLayoutMinimalPerf.default | 1476 | 1379 | 1.07:1 |
RefMinimalPerf.default | 261 | 243 | 1.07:1 |
AttachmentMinimalPerf.default | 190 | 179 | 1.06:1 |
PortalMinimalPerf.default | 198 | 187 | 1.06:1 |
AnimationMinimalPerf.default | 463 | 442 | 1.05:1 |
IconMinimalPerf.default | 714 | 678 | 1.05:1 |
CarouselMinimalPerf.default | 542 | 521 | 1.04:1 |
DropdownManyItemsPerf.default | 797 | 764 | 1.04:1 |
HeaderMinimalPerf.default | 423 | 408 | 1.04:1 |
ListCommonPerf.default | 747 | 716 | 1.04:1 |
ListMinimalPerf.default | 572 | 551 | 1.04:1 |
StatusMinimalPerf.default | 770 | 741 | 1.04:1 |
ChatDuplicateMessagesPerf.default | 343 | 333 | 1.03:1 |
ListWith60ListItems.default | 742 | 719 | 1.03:1 |
PopupMinimalPerf.default | 637 | 618 | 1.03:1 |
RadioGroupMinimalPerf.default | 511 | 497 | 1.03:1 |
SegmentMinimalPerf.default | 398 | 388 | 1.03:1 |
TooltipMinimalPerf.default | 1165 | 1132 | 1.03:1 |
AvatarMinimalPerf.default | 219 | 215 | 1.02:1 |
ChatMinimalPerf.default | 737 | 721 | 1.02:1 |
ImageMinimalPerf.default | 441 | 432 | 1.02:1 |
LabelMinimalPerf.default | 458 | 448 | 1.02:1 |
TreeWith60ListItems.default | 210 | 206 | 1.02:1 |
AccordionMinimalPerf.default | 184 | 182 | 1.01:1 |
AttachmentSlotsPerf.default | 1206 | 1192 | 1.01:1 |
ChatWithPopoverPerf.default | 435 | 431 | 1.01:1 |
DialogMinimalPerf.default | 831 | 826 | 1.01:1 |
FlexMinimalPerf.default | 307 | 305 | 1.01:1 |
MenuMinimalPerf.default | 940 | 927 | 1.01:1 |
ProviderMinimalPerf.default | 1244 | 1228 | 1.01:1 |
SplitButtonMinimalPerf.default | 4793 | 4733 | 1.01:1 |
TableManyItemsPerf.default | 2149 | 2135 | 1.01:1 |
TextAreaMinimalPerf.default | 599 | 591 | 1.01:1 |
ToolbarMinimalPerf.default | 1058 | 1047 | 1.01:1 |
TreeMinimalPerf.default | 885 | 872 | 1.01:1 |
DatepickerMinimalPerf.default | 5955 | 5937 | 1:1 |
DividerMinimalPerf.default | 403 | 402 | 1:1 |
EmbedMinimalPerf.default | 4662 | 4669 | 1:1 |
LayoutMinimalPerf.default | 409 | 408 | 1:1 |
ListNestedPerf.default | 627 | 624 | 1:1 |
MenuButtonMinimalPerf.default | 1816 | 1812 | 1:1 |
SkeletonMinimalPerf.default | 406 | 405 | 1:1 |
TableMinimalPerf.default | 467 | 465 | 1:1 |
CustomToolbarPrototype.default | 4499 | 4483 | 1:1 |
ButtonOverridesMissPerf.default | 1935 | 1945 | 0.99:1 |
CheckboxMinimalPerf.default | 2954 | 2984 | 0.99:1 |
DropdownMinimalPerf.default | 3385 | 3420 | 0.99:1 |
FormMinimalPerf.default | 474 | 478 | 0.99:1 |
GridMinimalPerf.default | 390 | 395 | 0.99:1 |
InputMinimalPerf.default | 1429 | 1442 | 0.99:1 |
SliderMinimalPerf.default | 1837 | 1857 | 0.99:1 |
BoxMinimalPerf.default | 392 | 399 | 0.98:1 |
ButtonMinimalPerf.default | 196 | 201 | 0.98:1 |
HeaderSlotsPerf.default | 860 | 878 | 0.98:1 |
LoaderMinimalPerf.default | 755 | 771 | 0.98:1 |
ProviderMergeThemesPerf.default | 1808 | 1850 | 0.98:1 |
TextMinimalPerf.default | 398 | 406 | 0.98:1 |
ButtonSlotsPerf.default | 623 | 641 | 0.97:1 |
ReactionMinimalPerf.default | 426 | 445 | 0.96:1 |
RosterPerf.default | 1302 | 1366 | 0.95:1 |
AlertMinimalPerf.default | 305 | 324 | 0.94:1 |
VideoMinimalPerf.default | 690 | 731 | 0.94:1 |
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 446c1d7:
|
}); | ||
|
||
it('handles spacing', () => { | ||
expect(normalizePseudoSelector(' :hover')).toMatchInlineSnapshot(`"& :hover"`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, does the spacing have any impact on the final result ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://codesandbox.io/s/react-css-in-js-with-fela-forked-2xo8f?file=/src/components/C.css
Yes, check this one (hover text) π
expect(normalizePseudoSelector(' :hover')).toMatchInlineSnapshot(`"& :hover"`); | ||
}); | ||
|
||
it('handles multiple pseudos', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test has the same name as the one under it
it('handles multiple pseudos', () => { | |
it('handles comma separated pseudos', () => { |
expect(normalizePseudoSelector(':focus:hover')).toMatchInlineSnapshot(`"&:focus:hover"`); | ||
}); | ||
|
||
it('handles multiple with comma', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test seems like just a combination of those above.... is it necessary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are kinda same, but not the same π
Anyway I merged the into a single it
π
* fix(makeStyles): handle comma separated selectors * Change files * fix fmt * add comments * update tests
Pull request checklist
Addresses an existing issue: Fixes #0000$ yarn change
Description of changes
This PR fixes a problem originally reported by @khmakoto π
β¬β¬β¬
After debugging the problem I discovered that comma separated selectors are not handled properly. In the same time they supported in SASS:
β¬β¬β¬
They supported in
mergeStyles()
(styling solution from v8):fluentui/packages/merge-styles/src/mergeStyles.test.ts
Lines 83 to 89 in b5b7401
And it the end they supported by Stylis (CSS preprocessor used in
makeStyles()
), our problem was that we were passing wrong input to Stylis:This PR fixes the reported issue and add new unit tests.