chore: add Babel plugins for more components#18968
Conversation
📊 Bundle size reportUnchanged fixtures
|
|
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 0d75442:
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 17c38c14b8b57d0150341cb914fb78c8e295443c (build) |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Text | mount | 467 | 477 | 5000 | Possible regression |
All results
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 850 | 838 | 5000 | |
| BaseButton | mount | 963 | 981 | 5000 | |
| Breadcrumb | mount | 2656 | 2689 | 1000 | |
| ButtonNext | mount | 471 | 455 | 5000 | |
| Checkbox | mount | 1625 | 1603 | 5000 | |
| CheckboxBase | mount | 1431 | 1501 | 5000 | |
| ChoiceGroup | mount | 5145 | 5094 | 5000 | |
| ComboBox | mount | 999 | 1013 | 1000 | |
| CommandBar | mount | 10661 | 10239 | 1000 | |
| ContextualMenu | mount | 6351 | 6640 | 1000 | |
| DefaultButton | mount | 1270 | 1231 | 5000 | |
| DetailsRow | mount | 3988 | 4086 | 5000 | |
| DetailsRowFast | mount | 3952 | 4033 | 5000 | |
| DetailsRowNoStyles | mount | 3847 | 3834 | 5000 | |
| Dialog | mount | 2307 | 2263 | 1000 | |
| DocumentCardTitle | mount | 157 | 144 | 1000 | |
| Dropdown | mount | 3484 | 3468 | 5000 | |
| FluentProviderNext | mount | 6996 | 6986 | 5000 | |
| FocusTrapZone | mount | 1861 | 1796 | 5000 | |
| FocusZone | mount | 1801 | 1920 | 5000 | |
| IconButton | mount | 1841 | 1824 | 5000 | |
| Label | mount | 347 | 363 | 5000 | |
| Layer | mount | 1905 | 1974 | 5000 | |
| Link | mount | 496 | 506 | 5000 | |
| MakeStyles | mount | 1869 | 1857 | 50000 | |
| MenuButton | mount | 1564 | 1583 | 5000 | |
| MessageBar | mount | 2036 | 2113 | 5000 | |
| Nav | mount | 3470 | 3463 | 1000 | |
| OverflowSet | mount | 1087 | 1043 | 5000 | |
| Panel | mount | 2129 | 2076 | 1000 | |
| Persona | mount | 871 | 923 | 1000 | |
| Pivot | mount | 1469 | 1501 | 1000 | |
| PrimaryButton | mount | 1354 | 1421 | 5000 | |
| Rating | mount | 8281 | 8334 | 5000 | |
| SearchBox | mount | 1443 | 1496 | 5000 | |
| Shimmer | mount | 2732 | 2790 | 5000 | |
| Slider | mount | 2048 | 2045 | 5000 | |
| SpinButton | mount | 5272 | 5184 | 5000 | |
| Spinner | mount | 444 | 435 | 5000 | |
| SplitButton | mount | 3361 | 3451 | 5000 | |
| Stack | mount | 550 | 538 | 5000 | |
| StackWithIntrinsicChildren | mount | 1672 | 1662 | 5000 | |
| StackWithTextChildren | mount | 5108 | 4978 | 5000 | |
| SwatchColorPicker | mount | 10888 | 10904 | 5000 | |
| Tabs | mount | 1469 | 1491 | 1000 | |
| TagPicker | mount | 2592 | 2585 | 5000 | |
| TeachingBubble | mount | 12300 | 11949 | 5000 | |
| Text | mount | 467 | 477 | 5000 | Possible regression |
| TextField | mount | 1477 | 1493 | 5000 | |
| ThemeProvider | mount | 1261 | 1233 | 5000 | |
| ThemeProvider | virtual-rerender | 629 | 641 | 5000 | |
| Toggle | mount | 839 | 842 | 5000 | |
| buttonNative | mount | 105 | 112 | 5000 |
Perf Analysis (@fluentui/react-northstar)
Perf tests with no regressions
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| SegmentMinimalPerf.default | 408 | 376 | 1.09:1 |
| FormMinimalPerf.default | 470 | 436 | 1.08:1 |
| StatusMinimalPerf.default | 787 | 729 | 1.08:1 |
| TableMinimalPerf.default | 462 | 429 | 1.08:1 |
| AccordionMinimalPerf.default | 176 | 164 | 1.07:1 |
| AvatarMinimalPerf.default | 217 | 202 | 1.07:1 |
| ListCommonPerf.default | 735 | 689 | 1.07:1 |
| ButtonSlotsPerf.default | 615 | 579 | 1.06:1 |
| ChatDuplicateMessagesPerf.default | 324 | 307 | 1.06:1 |
| ImageMinimalPerf.default | 443 | 417 | 1.06:1 |
| TextMinimalPerf.default | 388 | 365 | 1.06:1 |
| BoxMinimalPerf.default | 387 | 369 | 1.05:1 |
| CarouselMinimalPerf.default | 526 | 501 | 1.05:1 |
| TreeWith60ListItems.default | 199 | 189 | 1.05:1 |
| ItemLayoutMinimalPerf.default | 1370 | 1312 | 1.04:1 |
| ChatMinimalPerf.default | 719 | 697 | 1.03:1 |
| DialogMinimalPerf.default | 841 | 817 | 1.03:1 |
| HeaderMinimalPerf.default | 410 | 399 | 1.03:1 |
| RefMinimalPerf.default | 253 | 246 | 1.03:1 |
| AttachmentSlotsPerf.default | 1198 | 1169 | 1.02:1 |
| DropdownMinimalPerf.default | 3310 | 3257 | 1.02:1 |
| FlexMinimalPerf.default | 324 | 318 | 1.02:1 |
| LabelMinimalPerf.default | 430 | 423 | 1.02:1 |
| ListMinimalPerf.default | 563 | 553 | 1.02:1 |
| ListWith60ListItems.default | 711 | 700 | 1.02:1 |
| MenuMinimalPerf.default | 937 | 922 | 1.02:1 |
| IconMinimalPerf.default | 681 | 669 | 1.02:1 |
| CardMinimalPerf.default | 631 | 625 | 1.01:1 |
| ChatWithPopoverPerf.default | 391 | 386 | 1.01:1 |
| DatepickerMinimalPerf.default | 5895 | 5862 | 1.01:1 |
| DropdownManyItemsPerf.default | 787 | 777 | 1.01:1 |
| LoaderMinimalPerf.default | 754 | 750 | 1.01:1 |
| MenuButtonMinimalPerf.default | 1756 | 1734 | 1.01:1 |
| ProviderMinimalPerf.default | 1079 | 1067 | 1.01:1 |
| TableManyItemsPerf.default | 2106 | 2082 | 1.01:1 |
| TextAreaMinimalPerf.default | 551 | 548 | 1.01:1 |
| AnimationMinimalPerf.default | 441 | 439 | 1:1 |
| HeaderSlotsPerf.default | 865 | 868 | 1:1 |
| InputMinimalPerf.default | 1340 | 1342 | 1:1 |
| LayoutMinimalPerf.default | 415 | 417 | 1:1 |
| PopupMinimalPerf.default | 601 | 601 | 1:1 |
| ReactionMinimalPerf.default | 424 | 426 | 1:1 |
| SliderMinimalPerf.default | 1635 | 1631 | 1:1 |
| SplitButtonMinimalPerf.default | 4109 | 4119 | 1:1 |
| CustomToolbarPrototype.default | 4052 | 4033 | 1:1 |
| TooltipMinimalPerf.default | 1083 | 1088 | 1:1 |
| VideoMinimalPerf.default | 704 | 702 | 1:1 |
| AlertMinimalPerf.default | 302 | 305 | 0.99:1 |
| ButtonOverridesMissPerf.default | 1819 | 1839 | 0.99:1 |
| CheckboxMinimalPerf.default | 2893 | 2920 | 0.99:1 |
| DividerMinimalPerf.default | 418 | 421 | 0.99:1 |
| PortalMinimalPerf.default | 175 | 177 | 0.99:1 |
| RadioGroupMinimalPerf.default | 490 | 494 | 0.99:1 |
| ToolbarMinimalPerf.default | 1001 | 1010 | 0.99:1 |
| TreeMinimalPerf.default | 844 | 853 | 0.99:1 |
| ButtonMinimalPerf.default | 190 | 193 | 0.98:1 |
| EmbedMinimalPerf.default | 4424 | 4503 | 0.98:1 |
| ListNestedPerf.default | 589 | 600 | 0.98:1 |
| ProviderMergeThemesPerf.default | 1679 | 1714 | 0.98:1 |
| SkeletonMinimalPerf.default | 394 | 402 | 0.98:1 |
| GridMinimalPerf.default | 365 | 377 | 0.97:1 |
| RosterPerf.default | 1248 | 1309 | 0.95:1 |
| AttachmentMinimalPerf.default | 162 | 178 | 0.91:1 |
ling1726
left a comment
There was a problem hiding this comment.
Can you just add this file in the create-package script ?
Will do 👍 |
…hore/add-missing-babel-plugins
Another unhandled issue in Babel plugin, will fix it in a separate PR. |
|
can we add it to nx migration generator instead of plop ?
|
do we have issue for that ? |
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "plugins": ["module:@fluentui/babel-make-styles", "annotate-pure-calls", "@babel/transform-react-pure-annotations"] | |||
There was a problem hiding this comment.
this will add "module:@fluentui/babel-make-styles" plugin no matter if it's needed or not. I don't think that's the way we wanna go forward -> one of reasons why I asked to implement this within nx migration generator
There was a problem hiding this comment.
That would make sense for the entire create-package utility to be an nx generator. Generally the packages we create will be for components. Even with an nx generator we would have no way of enforcing that a component package will have the babel config.
This is a good place to have until we can leverage nx fully IMO
There was a problem hiding this comment.
That would make sense for the entire create-package
yeah that's the plan
Generally the packages we create will be for components.
thats fine, again we can distinguish accordingly this info in migration generator. In future every package should use .babelrc.json no matter for what platform it is.
Even with an nx generator we would have no way of enforcing that a component package will have the babel config.
hmm not sure I follow ?
We can easily distinguish what plugins should be added for particular converged package or not via nx generator.
There was a problem hiding this comment.
also this is not blocking, just pointing out what needs to be done (here or another PR) ideally at one place (which is the primary source of truth at the moment - nx migration generator)
There was a problem hiding this comment.
I meant that it is a sufficient solution to leverage create-package so we make sure new packages are created with approriate babel config before an nx generator is ready (more complicated and longer to do)
There was a problem hiding this comment.
Adding the file to all new react packages seems like a "good enough" approach in the short term (until someone has time to convert create-package to a generator). Most new react packages will be component packages which need this file (if I'm understanding right), and if the file wasn't in the template we'd need another round of these manual fixes. If there's some package where the plugins aren't needed, that can be caught in the PR review.
This PR cannot be merged without this fix. I am working on it... 🛠 |
IMO this is out of scope this PR, but feel free to create an issue to track it 👍 |
|
The build issue was fixed in #18995, build is passing ✅ |
|
@microsoft/cxe-prg @sopranopillow can you please check this PR? |
@microsoft/cxe-prg friendly reminder 😊 |
…hore/add-missing-babel-plugins
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |
* chore: add Babel plugins for more components * Change files * add babel plugins to template * fix deps * fix versions
Pull request checklist
Addresses an existing issue: Fixes #0000$ yarn changeDescription of changes
This PR adds required Babel plugins (see #18037 for details). Also added
.babelrc.jsonintoscripts/create-package/plop-templates-reactto have these files automatically.