Skip to content
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

T dama/CodeMods - Add generic config-based codemod generator #14496

Merged

Conversation

tmaster628
Copy link
Contributor

-Added configMod.ts, which can read a codemod from a json file and return it. Take a look at upgrades.json for a sample upgrade file! Added simple testing for it too, which sets a nice precedent for testing actual codemods w/ jest and not just utilities

-Hopefully this middle ground between mod and json can also be leveraged / generalized further to add more flexibility at a high level for developers.

-TODO: Add support for more codemods -- adding support for new ones shouldn't be too tricky -- a dev just needs to set a standard for what upgrades.json should look like, and then parse that into a series of functions that can be stored. Check out getCodeModUtilitiesFromJson for more deets.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 12, 2020

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 abde9f2:

Sandbox Source
Fluent UI Button Configuration
microsoft/fluentui: codesandbox-react-template Configuration
microsoft/fluentui: codesandbox-react-next-template Configuration

@msft-github-bot
Copy link
Contributor

msft-github-bot commented Aug 12, 2020

Perf Analysis

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 948 956 5000
ButtonNext mount 598 594 5000
Checkbox mount 1655 1661 5000
CheckboxBase mount 1394 1347 5000
CheckboxNext mount 1771 1726 5000
ChoiceGroup mount 5168 5155 5000
ComboBox mount 959 923 1000
CommandBar mount 8111 8003 1000
ContextualMenu mount 14450 14619 1000
DefaultButton mount 1159 1165 5000
DetailsRow mount 3923 3660 5000
DetailsRowFast mount 3649 3731 5000
DetailsRowNoStyles mount 3484 3657 5000
Dialog mount 1583 1639 1000
DocumentCardTitle mount 1879 1938 1000
Dropdown mount 2772 2719 5000
FocusZone mount 1941 1959 5000
IconButton mount 1857 1815 5000
Label mount 381 349 5000
Link mount 445 456 5000
LinkNext mount 485 488 5000
MenuButton mount 1486 1499 5000
Nav mount 3336 3372 1000
Panel mount 1510 1535 1000
Persona mount 935 912 1000
Pivot mount 1489 1480 1000
PivotNext mount 1516 1563 1000
PrimaryButton mount 1373 1338 5000
SearchBox mount 1308 1313 5000
SearchBoxNext mount 1386 1366 5000
Slider mount 1545 1585 5000
SliderNext mount 2023 2015 5000
SpinButton mount 5235 5132 5000
SpinButtonNext mount 5306 5302 5000
Spinner mount 464 425 5000
SplitButton mount 3334 3299 5000
Stack mount 534 563 5000
StackWithIntrinsicChildren mount 2153 2163 5000
StackWithTextChildren mount 5259 5327 5000
TagPicker mount 2880 2842 5000
Text mount 441 442 5000
TextField mount 1419 1443 5000
ThemeProvider mount 3118 3125 5000
ThemeProvider virtual-rerender 466 470 5000
Toggle mount 866 889 5000
ToggleNext mount 857 866 5000
button mount 119 111 5000

Perf Analysis (Fluent)

Perf comparison
Status Scenario Fluent TPI Fabric TPI Ratio Iterations Ticks
🎯 Avatar.Fluent 0.45 0.5 0.9:1 2000 895
🦄 Button.Fluent 0.11 0.2 0.55:1 5000 544
🔧 Checkbox.Fluent 0.66 0.36 1.83:1 1000 662
🎯 Dialog.Fluent 0.16 0.22 0.73:1 5000 801
🔧 Dropdown.Fluent 3.13 0.51 6.14:1 1000 3134
🔧 Icon.Fluent 0.14 0.05 2.8:1 5000 698
🦄 Image.Fluent 0.07 0.11 0.64:1 5000 369
🔧 Slider.Fluent 1.74 0.38 4.58:1 1000 1735
🔧 Text.Fluent 0.07 0.03 2.33:1 5000 353
🦄 Tooltip.Fluent 0.11 18.41 0.01:1 5000 544

🔧 Needs work     🎯 On target     🦄 Amazing

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AttachmentMinimalPerf.default 172 153 1.12:1
HierarchicalTreeMinimalPerf.default 448 404 1.11:1
HeaderMinimalPerf.default 368 337 1.09:1
PortalMinimalPerf.default 139 129 1.08:1
AnimationMinimalPerf.default 426 397 1.07:1
FlexMinimalPerf.default 292 274 1.07:1
ProviderMergeThemesPerf.default 2144 2027 1.06:1
ReactionMinimalPerf.default 402 379 1.06:1
TextMinimalPerf.default 356 335 1.06:1
ToolbarMinimalPerf.default 1007 954 1.06:1
Text.Fluent 353 333 1.06:1
ChatDuplicateMessagesPerf.default 444 421 1.05:1
ChatMinimalPerf.default 647 617 1.05:1
RefMinimalPerf.default 228 218 1.05:1
TableMinimalPerf.default 416 398 1.05:1
AccordionMinimalPerf.default 168 162 1.04:1
CarouselMinimalPerf.default 471 451 1.04:1
FormMinimalPerf.default 410 395 1.04:1
MenuMinimalPerf.default 878 845 1.04:1
SkeletonMinimalPerf.default 410 396 1.04:1
TreeWith60ListItems.default 237 228 1.04:1
VideoMinimalPerf.default 638 614 1.04:1
AvatarMinimalPerf.default 493 480 1.03:1
BoxMinimalPerf.default 359 349 1.03:1
HeaderSlotsPerf.default 841 816 1.03:1
LayoutMinimalPerf.default 402 389 1.03:1
ListWith60ListItems.default 1149 1111 1.03:1
PopupMinimalPerf.default 704 691 1.02:1
SliderMinimalPerf.default 1748 1711 1.02:1
SplitButtonMinimalPerf.default 3995 3914 1.02:1
TextAreaMinimalPerf.default 482 472 1.02:1
AttachmentSlotsPerf.default 1168 1162 1.01:1
ButtonMinimalPerf.default 167 165 1.01:1
DialogMinimalPerf.default 767 763 1.01:1
EmbedMinimalPerf.default 1985 1970 1.01:1
GridMinimalPerf.default 329 327 1.01:1
ItemLayoutMinimalPerf.default 1287 1270 1.01:1
ListCommonPerf.default 981 970 1.01:1
LoaderMinimalPerf.default 766 759 1.01:1
MenuButtonMinimalPerf.default 1629 1612 1.01:1
ProviderMinimalPerf.default 999 994 1.01:1
CustomToolbarPrototype.default 4051 4023 1.01:1
TooltipMinimalPerf.default 814 807 1.01:1
Checkbox.Fluent 662 655 1.01:1
Image.Fluent 369 364 1.01:1
Slider.Fluent 1735 1725 1.01:1
AlertMinimalPerf.default 301 300 1:1
CardMinimalPerf.default 563 565 1:1
CheckboxMinimalPerf.default 2926 2927 1:1
ImageMinimalPerf.default 364 364 1:1
InputMinimalPerf.default 1375 1380 1:1
LabelMinimalPerf.default 400 399 1:1
ListMinimalPerf.default 468 468 1:1
TableManyItemsPerf.default 2252 2260 1:1
TreeMinimalPerf.default 902 898 1:1
ChatWithPopoverPerf.default 500 503 0.99:1
DropdownManyItemsPerf.default 790 799 0.99:1
SegmentMinimalPerf.default 356 360 0.99:1
Button.Fluent 544 552 0.99:1
Dialog.Fluent 801 806 0.99:1
Dropdown.Fluent 3134 3161 0.99:1
Icon.Fluent 698 707 0.99:1
Tooltip.Fluent 544 549 0.99:1
ButtonSlotsPerf.default 589 610 0.97:1
DividerMinimalPerf.default 360 370 0.97:1
DropdownMinimalPerf.default 3085 3178 0.97:1
ListNestedPerf.default 872 899 0.97:1
StatusMinimalPerf.default 664 692 0.96:1
IconMinimalPerf.default 665 690 0.96:1
Avatar.Fluent 895 932 0.96:1
RadioGroupMinimalPerf.default 403 429 0.94:1

@size-auditor
Copy link

size-auditor bot commented Aug 12, 2020

Asset size changes

⚠️ Insufficient baseline data to detect size changes

Unable to find bundle size details for Baseline commit: a121562

Possible causes

  • The baseline build a121562 is broken
  • The Size Auditor run for the baseline build a121562 was not triggered

Recommendations

  • Please merge your branch for this Pull request with the latest master build and commit your changes once again

@tmaster628 tmaster628 closed this Aug 13, 2020
@tmaster628 tmaster628 reopened this Aug 13, 2020
@tmaster628 tmaster628 requested a review from dzearing as a code owner August 13, 2020 22:58
@joschect joschect merged commit d6a07da into microsoft:master Aug 14, 2020
@msft-github-bot
Copy link
Contributor

🎉@fluentui/[email protected] has been released which incorporates this pull request.:tada:

Handy links:

levithomason pushed a commit to levithomason/fluentui that referenced this pull request Aug 24, 2020
…ft#14496)

* merge conflicts

* merge conflicts

* merge conflicts

* merge conflicts

* fix prop helper

* merge conflicts

* WIP improve logging

* merge conflicts

* merge conflicts

* merge conflicts

* merge conflicts

* WIP polishing

* remove logging

* add generic config mod

* Change files

* fix test

* add snapshot testing

* add snapshot

* improve logging

* new snaps

* fix tests

Co-authored-by: Trip Master <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants