Skip to content

feat(tools): add --all flag to run migrations in batch#19101

Merged
Hotell merged 2 commits intomicrosoft:masterfrom
Hotell:hotell/build-system/add-all-flag-to-migration-generator
Jul 26, 2021
Merged

feat(tools): add --all flag to run migrations in batch#19101
Hotell merged 2 commits intomicrosoft:masterfrom
Hotell:hotell/build-system/add-all-flag-to-migration-generator

Conversation

@Hotell
Copy link
Contributor

@Hotell Hotell commented Jul 23, 2021

Pull request checklist

Description of changes

  • implements --all flag to run batch migration thus keeping project setups up to date and in sync

    • 2021-07-23 at 13 21
    • 2021-07-23 at 13 20
  • handle mutually exclusive flags

    • 2021-07-23 at 13 18

Focus areas to test

(optional)

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 23, 2021

📊 Bundle size report

🤖 This report was generated against 17c38c14b8b57d0150341cb914fb78c8e295443c

@codesandbox-ci
Copy link

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

Sandbox Source
Fluent UI React Starter Configuration

@size-auditor
Copy link

size-auditor bot commented Jul 23, 2021

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 17c38c14b8b57d0150341cb914fb78c8e295443c (build)


function validateUserInput(tree: Tree, options: MigrateConvergedPkgGeneratorSchema): asserts options is AssertedSchema {
if (!options.name) {
if (options.name && options.stats) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added proper mutually exclusive flag checks for better DX and processing

});
}

function runMigrationOnProject(tree: Tree, schema: AssertedSchema, userLog: UserLog) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

encapsulated all codemod/generator logic into re-usable function which is invoked for standard invocation and multiple times when migrating in batch

export default async function (tree: Tree, schema: MigrateConvergedPkgGeneratorSchema) {
const userLog: UserLog = [];

validateUserInput(tree, schema);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

simplified logic of user input validation -> thus can be hoisted to top

return acc;
}, {} as Record<typeof projects[number], ReturnType<typeof readProjectConfiguration>>);

expect(configs['@proj/react-foo'].sourceRoot).toBeDefined();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • migrated package contains sourceRoot to project configuration within worksapce.json
  • there are many changes to be checked which are covered in other test so I came up with this most simple scenario to be checked

@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 799 800 5000
BaseButton mount 887 882 5000
Breadcrumb mount 2563 2612 1000
ButtonNext mount 420 429 5000
Checkbox mount 1497 1489 5000
CheckboxBase mount 1260 1290 5000
ChoiceGroup mount 4653 4660 5000
ComboBox mount 952 974 1000
CommandBar mount 10006 10025 1000
ContextualMenu mount 6206 6164 1000
DefaultButton mount 1130 1112 5000
DetailsRow mount 3764 3754 5000
DetailsRowFast mount 3612 3686 5000
DetailsRowNoStyles mount 3510 3473 5000
Dialog mount 2111 2137 1000
DocumentCardTitle mount 136 147 1000
Dropdown mount 3254 3180 5000
FluentProviderNext mount 7158 7212 5000
FocusTrapZone mount 1777 1732 5000
FocusZone mount 1757 1782 5000
IconButton mount 1768 1681 5000
Label mount 332 329 5000
Layer mount 1744 1759 5000
Link mount 469 472 5000
MakeStyles mount 1793 1790 50000
MenuButton mount 1434 1444 5000
MessageBar mount 1980 1998 5000
Nav mount 3206 3208 1000
OverflowSet mount 1035 1001 5000
Panel mount 2085 2059 1000
Persona mount 820 816 1000
Pivot mount 1373 1393 1000
PrimaryButton mount 1295 1274 5000
Rating mount 7531 7586 5000
SearchBox mount 1282 1309 5000
Shimmer mount 2467 2552 5000
Slider mount 1916 1904 5000
SpinButton mount 4916 4926 5000
Spinner mount 420 410 5000
SplitButton mount 3114 3114 5000
Stack mount 500 489 5000
StackWithIntrinsicChildren mount 1519 1550 5000
StackWithTextChildren mount 4480 4478 5000
SwatchColorPicker mount 9983 10068 5000
Tabs mount 1366 1485 1000
TagPicker mount 2398 2386 5000
TeachingBubble mount 11803 11782 5000
Text mount 411 398 5000
TextField mount 1358 1346 5000
ThemeProvider mount 1162 1171 5000
ThemeProvider virtual-rerender 591 599 5000
Toggle mount 794 816 5000
buttonNative mount 128 112 5000

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
PortalMinimalPerf.default 184 168 1.1:1
TreeWith60ListItems.default 182 166 1.1:1
ReactionMinimalPerf.default 378 350 1.08:1
SkeletonMinimalPerf.default 358 332 1.08:1
VideoMinimalPerf.default 644 601 1.07:1
RefMinimalPerf.default 249 235 1.06:1
FlexMinimalPerf.default 292 277 1.05:1
ChatWithPopoverPerf.default 374 358 1.04:1
FormMinimalPerf.default 392 377 1.04:1
IconMinimalPerf.default 607 585 1.04:1
TextAreaMinimalPerf.default 486 467 1.04:1
TreeMinimalPerf.default 801 768 1.04:1
ImageMinimalPerf.default 357 346 1.03:1
LayoutMinimalPerf.default 369 359 1.03:1
ListCommonPerf.default 624 606 1.03:1
TableManyItemsPerf.default 1915 1852 1.03:1
CardMinimalPerf.default 553 542 1.02:1
CheckboxMinimalPerf.default 2718 2663 1.02:1
DropdownManyItemsPerf.default 660 649 1.02:1
EmbedMinimalPerf.default 4138 4074 1.02:1
GridMinimalPerf.default 328 322 1.02:1
ItemLayoutMinimalPerf.default 1195 1171 1.02:1
LabelMinimalPerf.default 374 366 1.02:1
ListWith60ListItems.default 610 600 1.02:1
TableMinimalPerf.default 393 387 1.02:1
AlertMinimalPerf.default 269 267 1.01:1
AnimationMinimalPerf.default 408 403 1.01:1
AttachmentMinimalPerf.default 152 150 1.01:1
AttachmentSlotsPerf.default 1030 1024 1.01:1
AvatarMinimalPerf.default 187 185 1.01:1
ChatDuplicateMessagesPerf.default 292 290 1.01:1
ListNestedPerf.default 550 542 1.01:1
LoaderMinimalPerf.default 704 695 1.01:1
MenuButtonMinimalPerf.default 1631 1621 1.01:1
PopupMinimalPerf.default 586 579 1.01:1
TextMinimalPerf.default 343 340 1.01:1
ToolbarMinimalPerf.default 941 931 1.01:1
BoxMinimalPerf.default 343 343 1:1
ButtonOverridesMissPerf.default 1700 1703 1:1
ChatMinimalPerf.default 647 644 1:1
DialogMinimalPerf.default 742 740 1:1
DropdownMinimalPerf.default 3064 3049 1:1
HeaderSlotsPerf.default 743 744 1:1
InputMinimalPerf.default 1249 1244 1:1
MenuMinimalPerf.default 837 840 1:1
ProviderMinimalPerf.default 1003 1005 1:1
SegmentMinimalPerf.default 335 336 1:1
SliderMinimalPerf.default 1570 1569 1:1
SplitButtonMinimalPerf.default 3737 3754 1:1
CustomToolbarPrototype.default 3833 3852 1:1
ButtonSlotsPerf.default 528 535 0.99:1
DividerMinimalPerf.default 345 350 0.99:1
HeaderMinimalPerf.default 361 364 0.99:1
ProviderMergeThemesPerf.default 1651 1667 0.99:1
StatusMinimalPerf.default 652 656 0.99:1
CarouselMinimalPerf.default 447 456 0.98:1
DatepickerMinimalPerf.default 5221 5328 0.98:1
ListMinimalPerf.default 500 511 0.98:1
TooltipMinimalPerf.default 984 1002 0.98:1
RadioGroupMinimalPerf.default 419 432 0.97:1
AccordionMinimalPerf.default 142 148 0.96:1
ButtonMinimalPerf.default 163 172 0.95:1
RosterPerf.default 1117 1184 0.94:1

@Hotell Hotell marked this pull request as ready for review July 23, 2021 13:18
@Hotell Hotell requested a review from a team as a code owner July 23, 2021 13:18
@Hotell Hotell merged commit f7bd7db into microsoft:master Jul 26, 2021
PeterDraex pushed a commit to PeterDraex/fluentui that referenced this pull request Aug 6, 2021
* feat(tools): add --all flag to run migrations in batch
* docs(tools): update readme with new API
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.

3 participants