fix(babel-make-styles): handle cases when MemberExpression is a function#18995
Merged
layershifter merged 3 commits intomasterfrom Jul 19, 2021
Merged
fix(babel-make-styles): handle cases when MemberExpression is a function#18995layershifter merged 3 commits intomasterfrom
layershifter merged 3 commits intomasterfrom
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 cf52f5f:
|
Collaborator
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 63f7b2dc6293e7ea4e4f5484c6c81af1c01d80ec (build) |
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 774 | 800 | 5000 | |
| BaseButton | mount | 886 | 900 | 5000 | |
| Breadcrumb | mount | 2589 | 2660 | 1000 | |
| ButtonNext | mount | 547 | 532 | 5000 | |
| Checkbox | mount | 1505 | 1504 | 5000 | |
| CheckboxBase | mount | 1280 | 1307 | 5000 | |
| ChoiceGroup | mount | 4753 | 4748 | 5000 | |
| ComboBox | mount | 1015 | 1024 | 1000 | |
| CommandBar | mount | 10105 | 10083 | 1000 | |
| ContextualMenu | mount | 6257 | 6216 | 1000 | |
| DefaultButton | mount | 1121 | 1170 | 5000 | |
| DetailsRow | mount | 3741 | 3735 | 5000 | |
| DetailsRowFast | mount | 3686 | 3725 | 5000 | |
| DetailsRowNoStyles | mount | 3537 | 3577 | 5000 | |
| Dialog | mount | 2158 | 2207 | 1000 | |
| DocumentCardTitle | mount | 154 | 149 | 1000 | |
| Dropdown | mount | 3267 | 3269 | 5000 | |
| FluentProviderNext | mount | 7299 | 7230 | 5000 | |
| FocusTrapZone | mount | 1804 | 1815 | 5000 | |
| FocusZone | mount | 1854 | 1824 | 5000 | |
| IconButton | mount | 1716 | 1688 | 5000 | |
| Label | mount | 339 | 356 | 5000 | |
| Layer | mount | 1806 | 1795 | 5000 | |
| Link | mount | 446 | 448 | 5000 | |
| MakeStyles | mount | 1814 | 1783 | 50000 | |
| MenuButton | mount | 1468 | 1467 | 5000 | |
| MessageBar | mount | 1991 | 2012 | 5000 | |
| Nav | mount | 3283 | 3205 | 1000 | |
| OverflowSet | mount | 1060 | 1056 | 5000 | |
| Panel | mount | 2078 | 2073 | 1000 | |
| Persona | mount | 816 | 830 | 1000 | |
| Pivot | mount | 1399 | 1409 | 1000 | |
| PrimaryButton | mount | 1295 | 1306 | 5000 | |
| Rating | mount | 7546 | 7582 | 5000 | |
| SearchBox | mount | 1331 | 1308 | 5000 | |
| Shimmer | mount | 2507 | 2544 | 5000 | |
| Slider | mount | 1956 | 1945 | 5000 | |
| SpinButton | mount | 4955 | 4944 | 5000 | |
| Spinner | mount | 417 | 412 | 5000 | |
| SplitButton | mount | 3161 | 3116 | 5000 | |
| Stack | mount | 508 | 485 | 5000 | |
| StackWithIntrinsicChildren | mount | 1530 | 1560 | 5000 | |
| StackWithTextChildren | mount | 4511 | 4516 | 5000 | |
| SwatchColorPicker | mount | 10196 | 10183 | 5000 | |
| Tabs | mount | 1397 | 1540 | 1000 | |
| TagPicker | mount | 2466 | 2435 | 5000 | |
| TeachingBubble | mount | 11977 | 11816 | 5000 | |
| Text | mount | 422 | 435 | 5000 | |
| TextField | mount | 1362 | 1351 | 5000 | |
| ThemeProvider | mount | 1202 | 1189 | 5000 | |
| ThemeProvider | virtual-rerender | 608 | 609 | 5000 | |
| Toggle | mount | 793 | 803 | 5000 | |
| buttonNative | mount | 108 | 121 | 5000 |
Perf Analysis (@fluentui/react-northstar)
Perf tests with no regressions
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| AccordionMinimalPerf.default | 160 | 146 | 1.1:1 |
| SegmentMinimalPerf.default | 365 | 340 | 1.07:1 |
| ButtonSlotsPerf.default | 553 | 529 | 1.05:1 |
| HeaderSlotsPerf.default | 777 | 739 | 1.05:1 |
| ListCommonPerf.default | 625 | 601 | 1.04:1 |
| ListWith60ListItems.default | 626 | 602 | 1.04:1 |
| RefMinimalPerf.default | 237 | 228 | 1.04:1 |
| CarouselMinimalPerf.default | 454 | 441 | 1.03:1 |
| ChatDuplicateMessagesPerf.default | 301 | 292 | 1.03:1 |
| LoaderMinimalPerf.default | 698 | 678 | 1.03:1 |
| IconMinimalPerf.default | 613 | 594 | 1.03:1 |
| AnimationMinimalPerf.default | 404 | 395 | 1.02:1 |
| AvatarMinimalPerf.default | 190 | 187 | 1.02:1 |
| BoxMinimalPerf.default | 346 | 340 | 1.02:1 |
| PopupMinimalPerf.default | 595 | 581 | 1.02:1 |
| TextAreaMinimalPerf.default | 511 | 500 | 1.02:1 |
| TreeMinimalPerf.default | 799 | 783 | 1.02:1 |
| VideoMinimalPerf.default | 648 | 633 | 1.02:1 |
| ButtonOverridesMissPerf.default | 1680 | 1664 | 1.01:1 |
| ChatMinimalPerf.default | 641 | 635 | 1.01:1 |
| CheckboxMinimalPerf.default | 2745 | 2723 | 1.01:1 |
| DialogMinimalPerf.default | 760 | 752 | 1.01:1 |
| DropdownMinimalPerf.default | 3107 | 3089 | 1.01:1 |
| EmbedMinimalPerf.default | 4120 | 4080 | 1.01:1 |
| MenuButtonMinimalPerf.default | 1629 | 1620 | 1.01:1 |
| ProviderMergeThemesPerf.default | 1683 | 1660 | 1.01:1 |
| ProviderMinimalPerf.default | 1015 | 1000 | 1.01:1 |
| RadioGroupMinimalPerf.default | 439 | 436 | 1.01:1 |
| StatusMinimalPerf.default | 671 | 666 | 1.01:1 |
| TableMinimalPerf.default | 397 | 394 | 1.01:1 |
| CustomToolbarPrototype.default | 3857 | 3828 | 1.01:1 |
| AttachmentMinimalPerf.default | 152 | 152 | 1:1 |
| AttachmentSlotsPerf.default | 1051 | 1048 | 1:1 |
| FlexMinimalPerf.default | 282 | 282 | 1:1 |
| GridMinimalPerf.default | 338 | 338 | 1:1 |
| ItemLayoutMinimalPerf.default | 1212 | 1208 | 1:1 |
| LayoutMinimalPerf.default | 365 | 365 | 1:1 |
| ListMinimalPerf.default | 511 | 513 | 1:1 |
| ListNestedPerf.default | 555 | 553 | 1:1 |
| RosterPerf.default | 1117 | 1121 | 1:1 |
| PortalMinimalPerf.default | 185 | 185 | 1:1 |
| SplitButtonMinimalPerf.default | 3745 | 3730 | 1:1 |
| TableManyItemsPerf.default | 1846 | 1849 | 1:1 |
| CardMinimalPerf.default | 537 | 541 | 0.99:1 |
| DropdownManyItemsPerf.default | 669 | 678 | 0.99:1 |
| FormMinimalPerf.default | 386 | 388 | 0.99:1 |
| InputMinimalPerf.default | 1247 | 1255 | 0.99:1 |
| SliderMinimalPerf.default | 1550 | 1572 | 0.99:1 |
| ToolbarMinimalPerf.default | 909 | 918 | 0.99:1 |
| TooltipMinimalPerf.default | 993 | 1003 | 0.99:1 |
| ChatWithPopoverPerf.default | 372 | 380 | 0.98:1 |
| DatepickerMinimalPerf.default | 5244 | 5326 | 0.98:1 |
| DividerMinimalPerf.default | 345 | 353 | 0.98:1 |
| HeaderMinimalPerf.default | 352 | 358 | 0.98:1 |
| MenuMinimalPerf.default | 827 | 842 | 0.98:1 |
| SkeletonMinimalPerf.default | 337 | 347 | 0.97:1 |
| AlertMinimalPerf.default | 255 | 267 | 0.96:1 |
| LabelMinimalPerf.default | 376 | 390 | 0.96:1 |
| TextMinimalPerf.default | 346 | 359 | 0.96:1 |
| TreeWith60ListItems.default | 158 | 164 | 0.96:1 |
| ReactionMinimalPerf.default | 349 | 367 | 0.95:1 |
| ButtonMinimalPerf.default | 152 | 161 | 0.94:1 |
| ImageMinimalPerf.default | 353 | 374 | 0.94:1 |
ling1726
reviewed
Jul 19, 2021
| * } | ||
| */ | ||
| const expressionTpl = template.expression( | ||
| `%%wrapName%%(() => typeof %%expression%% === 'function' ? %%expression%%(%%themeVariableName%%) : %%expression%%)`, |
Contributor
There was a problem hiding this comment.
do you mind adding an example of the expression once it has been formatted ?
ling1726
approved these changes
Jul 19, 2021
2 tasks
Collaborator
|
🎉 Handy links: |
PeterDraex
pushed a commit
to PeterDraex/fluentui
that referenced
this pull request
Aug 6, 2021
…ion (microsoft#18995) * fix(babel-make-styles): handle cases when MemberExpression is a function * Change files * add comment, add test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request checklist
$ yarn changeDescription of changes
This PR fixes an issue that was discovered in #18968:
In #18973 I added handling for
MemberExpressions, but it was not enough as they can be represented by objects (original PR added handling for them) or functions:We also don't know in advance what kind of an expression we will get, that's why check is moved to runtime code 😅 This PR adds handling for a function case and removes redundant static checks.