Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

feat(FlexItem): allow custom values as size#2313

Merged
silviuaavram merged 3 commits intomasterfrom
feat/allow-css-as-size-flex-item
Feb 4, 2020
Merged

feat(FlexItem): allow custom values as size#2313
silviuaavram merged 3 commits intomasterfrom
feat/allow-css-as-size-flex-item

Conversation

@silviuaavram
Copy link
Collaborator

@silviuaavram silviuaavram commented Feb 4, 2020

Allows any string passed as size prop to FlexItem and uses that value as fallback if none of the existing size values are passed.

  /** Defines size of the item. */
  size?: 'size.half' | 'size.quarter' | 'size.small' | 'size.medium' | 'size.large' | string

Values such as size={'30rem'} or size={'400px'} should work now and would end up as flex-basis on the FlexItem.

Fixes #2110

@silviuaavram silviuaavram changed the title Feat/allow css as size flex item feat(FlexItem): allow custom values as size Feb 4, 2020
@DustyTheBot
Copy link
Collaborator

DustyTheBot commented Feb 4, 2020

Perf comparison

Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🔧 Avatar.Fluent 0.55 0.41 1.34:1 2000 1094
🔧 Button.Fluent 1.21 0.16 7.56:1 1000 1207
🔧 Checkbox.Fluent 1.4 0.29 4.83:1 1000 1400
🔧 Dialog.Fluent 0.32 0.17 1.88:1 5000 1585
🔧 Dropdown.Fluent 4.6 0.52 8.85:1 1000 4597
🔧 Icon.Fluent 0.25 0.03 8.33:1 5000 1271
🔧 Image.Fluent 0.12 0.08 1.5:1 5000 582
🔧 Slider.Fluent 1.94 0.4 4.85:1 1000 1935
🦄 Text.Fluent 0.05 0.16 0.31:1 5000 271
🦄 Tooltip.Fluent 0.42 18.57 0.02:1 5000 2093

🔧 Needs work     🎯 On target     🦄 Amazing

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
BoxMinimalPerf.default 289 231 1.25:1
HeaderSlotsPerf.default 1778 1525 1.17:1
Dropdown.Fluent 4597 3950 1.16:1
ButtonMinimalPerf.default 1452 1265 1.15:1
Image.Fluent 582 509 1.14:1
VideoMinimalPerf.default 750 662 1.13:1
AttachmentMinimalPerf.default 1112 997 1.12:1
Text.Fluent 271 242 1.12:1
DropdownManyItemsPerf.default 692 627 1.1:1
FormMinimalPerf.default 996 904 1.1:1
ChatWithPopoverPerf.default 678 620 1.09:1
CustomToolbarPrototype.default 5041 4620 1.09:1
DialogMinimalPerf.default 1891 1763 1.07:1
DropdownMinimalPerf.default 4660 4358 1.07:1
PortalMinimalPerf.default 304 285 1.07:1
ChatMinimalPerf.default 1749 1652 1.06:1
GridMinimalPerf.default 905 854 1.06:1
LabelMinimalPerf.default 2193 2093 1.05:1
MenuButtonMinimalPerf.default 1831 1745 1.05:1
Checkbox.Fluent 1400 1338 1.05:1
AccordionMinimalPerf.default 218 209 1.04:1
AlertMinimalPerf.default 605 584 1.04:1
AttachmentSlotsPerf.default 3567 3421 1.04:1
InputMinimalPerf.default 1285 1238 1.04:1
ListCommonPerf.default 1323 1267 1.04:1
ProviderMergeThemesPerf.default 1460 1414 1.03:1
StatusMinimalPerf.default 988 961 1.03:1
EmbedMinimalPerf.default 6862 6758 1.02:1
MenuMinimalPerf.default 2344 2302 1.02:1
TextMinimalPerf.default 299 294 1.02:1
TreeMinimalPerf.default 1002 980 1.02:1
Button.Fluent 1207 1188 1.02:1
ListMinimalPerf.default 790 784 1.01:1
SplitButtonMinimalPerf.default 14571 14494 1.01:1
Slider.Fluent 1935 1913 1.01:1
RadioGroupMinimalPerf.default 480 478 1:1
ChatDuplicateMessagesPerf.default 559 567 0.99:1
FlexMinimalPerf.default 382 387 0.99:1
SegmentMinimalPerf.default 1512 1532 0.99:1
TextAreaMinimalPerf.default 3724 3745 0.99:1
ItemLayoutMinimalPerf.default 2112 2160 0.98:1
ReactionMinimalPerf.default 3068 3131 0.98:1
CheckboxMinimalPerf.default 7287 7538 0.97:1
ImageMinimalPerf.default 658 676 0.97:1
LayoutMinimalPerf.default 600 617 0.97:1
ToolbarMinimalPerf.default 845 870 0.97:1
Avatar.Fluent 1094 1124 0.97:1
CarouselMinimalPerf.default 1933 2021 0.96:1
Icon.Fluent 1271 1318 0.96:1
ButtonSlotsPerf.default 1844 1944 0.95:1
DividerMinimalPerf.default 1012 1070 0.95:1
RefMinimalPerf.default 188 198 0.95:1
AvatarMinimalPerf.default 593 633 0.94:1
LoaderMinimalPerf.default 2925 3112 0.94:1
TooltipMinimalPerf.default 2630 2804 0.94:1
Dialog.Fluent 1585 1732 0.92:1
PopupMinimalPerf.default 433 474 0.91:1
ProviderMinimalPerf.default 683 757 0.9:1
SliderMinimalPerf.default 2197 2505 0.88:1
AnimationMinimalPerf.default 457 525 0.87:1
IconMinimalPerf.default 1197 1372 0.87:1
Tooltip.Fluent 2093 2441 0.86:1
TableMinimalPerf.default 653 786 0.83:1
HierarchicalTreeMinimalPerf.default 797 1020 0.78:1
HeaderMinimalPerf.default 419 544 0.77:1

Generated by 🚫 dangerJS

Copy link
Contributor

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Please add changelog entry before merging

@silviuaavram silviuaavram merged commit 7270655 into master Feb 4, 2020
@silviuaavram silviuaavram deleted the feat/allow-css-as-size-flex-item branch February 4, 2020 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flex.Item support for numerical value in "size" property

3 participants