Repository navigation
fix: do not rely on UIEvent.view - #20022
Philipp Fritsche (ph-fritsche) wants to merge 1 commit into
Conversation
Asset size changes
Baseline commit: e726d8b364e68d28821710ea168b3ee0f7a23345 (build) |
|
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 559e69c:
|
📊 Bundle size report🤖 This report was generated against e726d8b364e68d28821710ea168b3ee0f7a23345 |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 933 | 937 | 5000 | |
| BaseButton | mount | 917 | 952 | 5000 | |
| Breadcrumb | mount | 2629 | 2674 | 1000 | |
| ButtonNext | mount | 452 | 460 | 5000 | |
| Checkbox | mount | 1513 | 1511 | 5000 | |
| CheckboxBase | mount | 1322 | 1333 | 5000 | |
| ChoiceGroup | mount | 4803 | 4899 | 5000 | |
| ComboBox | mount | 982 | 981 | 1000 | |
| CommandBar | mount | 10373 | 10393 | 1000 | |
| ContextualMenu | mount | 6585 | 6395 | 1000 | |
| DefaultButton | mount | 1147 | 1223 | 5000 | |
| DetailsRow | mount | 3770 | 3881 | 5000 | |
| DetailsRowFast | mount | 3913 | 3855 | 5000 | |
| DetailsRowNoStyles | mount | 3540 | 3584 | 5000 | |
| Dialog | mount | 2505 | 2515 | 1000 | |
| DocumentCardTitle | mount | 165 | 145 | 1000 | |
| Dropdown | mount | 3234 | 3407 | 5000 | |
| FluentProviderNext | mount | 7644 | 7688 | 5000 | |
| FluentProviderWithTheme | mount | 363 | 372 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 100 | 100 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 504 | 527 | 10 | |
| FocusTrapZone | mount | 1771 | 1877 | 5000 | |
| FocusZone | mount | 1852 | 1807 | 5000 | |
| IconButton | mount | 1979 | 1855 | 5000 | |
| Label | mount | 341 | 349 | 5000 | |
| Layer | mount | 3011 | 2999 | 5000 | |
| Link | mount | 495 | 469 | 5000 | |
| MakeStyles | mount | 1888 | 1890 | 50000 | |
| MenuButton | mount | 1491 | 1471 | 5000 | |
| MessageBar | mount | 2005 | 1998 | 5000 | |
| Nav | mount | 3388 | 3342 | 1000 | |
| OverflowSet | mount | 1140 | 1126 | 5000 | |
| Panel | mount | 2367 | 2356 | 1000 | |
| Persona | mount | 879 | 832 | 1000 | |
| Pivot | mount | 1477 | 1432 | 1000 | |
| PrimaryButton | mount | 1287 | 1305 | 5000 | |
| Rating | mount | 8038 | 7885 | 5000 | |
| SearchBox | mount | 1361 | 1335 | 5000 | |
| Shimmer | mount | 2534 | 2675 | 5000 | |
| Slider | mount | 2055 | 1935 | 5000 | |
| SpinButton | mount | 5171 | 5089 | 5000 | |
| Spinner | mount | 423 | 438 | 5000 | |
| SplitButton | mount | 3189 | 3202 | 5000 | |
| Stack | mount | 553 | 502 | 5000 | |
| StackWithIntrinsicChildren | mount | 1693 | 1759 | 5000 | |
| StackWithTextChildren | mount | 4858 | 4769 | 5000 | |
| SwatchColorPicker | mount | 10510 | 10775 | 5000 | |
| Tabs | mount | 1420 | 1476 | 1000 | |
| TagPicker | mount | 2798 | 2682 | 5000 | |
| TeachingBubble | mount | 13098 | 13402 | 5000 | |
| Text | mount | 406 | 448 | 5000 | |
| TextField | mount | 1420 | 1369 | 5000 | |
| ThemeProvider | mount | 1201 | 1203 | 5000 | |
| ThemeProvider | virtual-rerender | 628 | 622 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 1865 | 1930 | 5000 | |
| Toggle | mount | 797 | 800 | 5000 | |
| buttonNative | mount | 116 | 126 | 5000 |
Perf Analysis (@fluentui/react-northstar)
Perf tests with no regressions
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| AttachmentMinimalPerf.default | 172 | 153 | 1.12:1 |
| ListCommonPerf.default | 704 | 627 | 1.12:1 |
| TableMinimalPerf.default | 448 | 401 | 1.12:1 |
| RadioGroupMinimalPerf.default | 489 | 454 | 1.08:1 |
| IconMinimalPerf.default | 659 | 610 | 1.08:1 |
| ButtonMinimalPerf.default | 177 | 166 | 1.07:1 |
| ChatDuplicateMessagesPerf.default | 319 | 298 | 1.07:1 |
| TextMinimalPerf.default | 362 | 337 | 1.07:1 |
| AlertMinimalPerf.default | 291 | 274 | 1.06:1 |
| AvatarMinimalPerf.default | 202 | 190 | 1.06:1 |
| BoxMinimalPerf.default | 362 | 343 | 1.06:1 |
| ListMinimalPerf.default | 555 | 526 | 1.06:1 |
| ToolbarMinimalPerf.default | 1011 | 957 | 1.06:1 |
| TreeWith60ListItems.default | 201 | 189 | 1.06:1 |
| ButtonSlotsPerf.default | 574 | 549 | 1.05:1 |
| CardMinimalPerf.default | 557 | 537 | 1.04:1 |
| DividerMinimalPerf.default | 368 | 353 | 1.04:1 |
| GridMinimalPerf.default | 351 | 339 | 1.04:1 |
| LabelMinimalPerf.default | 391 | 376 | 1.04:1 |
| PortalMinimalPerf.default | 183 | 176 | 1.04:1 |
| RefMinimalPerf.default | 243 | 233 | 1.04:1 |
| SliderMinimalPerf.default | 1813 | 1751 | 1.04:1 |
| AccordionMinimalPerf.default | 162 | 158 | 1.03:1 |
| ChatMinimalPerf.default | 654 | 638 | 1.03:1 |
| DialogMinimalPerf.default | 775 | 754 | 1.03:1 |
| LayoutMinimalPerf.default | 374 | 362 | 1.03:1 |
| ListWith60ListItems.default | 653 | 632 | 1.03:1 |
| ReactionMinimalPerf.default | 398 | 385 | 1.03:1 |
| SplitButtonMinimalPerf.default | 4404 | 4279 | 1.03:1 |
| CheckboxMinimalPerf.default | 2848 | 2781 | 1.02:1 |
| CarouselMinimalPerf.default | 478 | 475 | 1.01:1 |
| DropdownMinimalPerf.default | 3284 | 3256 | 1.01:1 |
| LoaderMinimalPerf.default | 711 | 703 | 1.01:1 |
| PopupMinimalPerf.default | 599 | 591 | 1.01:1 |
| DatepickerMinimalPerf.default | 5617 | 5603 | 1:1 |
| EmbedMinimalPerf.default | 4345 | 4335 | 1:1 |
| ItemLayoutMinimalPerf.default | 1223 | 1228 | 1:1 |
| RosterPerf.default | 1187 | 1191 | 1:1 |
| SegmentMinimalPerf.default | 341 | 341 | 1:1 |
| InputMinimalPerf.default | 1358 | 1370 | 0.99:1 |
| ProviderMergeThemesPerf.default | 1754 | 1778 | 0.99:1 |
| StatusMinimalPerf.default | 683 | 688 | 0.99:1 |
| TableManyItemsPerf.default | 1928 | 1939 | 0.99:1 |
| CustomToolbarPrototype.default | 4149 | 4199 | 0.99:1 |
| TooltipMinimalPerf.default | 1038 | 1053 | 0.99:1 |
| VideoMinimalPerf.default | 635 | 642 | 0.99:1 |
| DropdownManyItemsPerf.default | 677 | 692 | 0.98:1 |
| MenuMinimalPerf.default | 836 | 854 | 0.98:1 |
| MenuButtonMinimalPerf.default | 1673 | 1706 | 0.98:1 |
| AttachmentSlotsPerf.default | 1138 | 1168 | 0.97:1 |
| ButtonOverridesMissPerf.default | 1792 | 1839 | 0.97:1 |
| ChatWithPopoverPerf.default | 381 | 391 | 0.97:1 |
| HeaderSlotsPerf.default | 753 | 779 | 0.97:1 |
| ImageMinimalPerf.default | 367 | 378 | 0.97:1 |
| TreeMinimalPerf.default | 783 | 808 | 0.97:1 |
| AnimationMinimalPerf.default | 404 | 422 | 0.96:1 |
| SkeletonMinimalPerf.default | 360 | 376 | 0.96:1 |
| TextAreaMinimalPerf.default | 476 | 496 | 0.96:1 |
| ListNestedPerf.default | 564 | 595 | 0.95:1 |
| ProviderMinimalPerf.default | 1142 | 1206 | 0.95:1 |
| HeaderMinimalPerf.default | 373 | 399 | 0.93:1 |
| FlexMinimalPerf.default | 273 | 300 | 0.91:1 |
| FormMinimalPerf.default | 387 | 442 | 0.88:1 |
| eventTarget.addEventListener('keyup', eventBuffer, true); | ||
| }; | ||
|
|
||
| type UIEventOnElement<T> = UIEvent & { currentTarget: T } |
There was a problem hiding this comment.
#20024 Adds correct typings to the event listeners, so this manual typing is no longer required
ling1726
left a comment
There was a problem hiding this comment.
The usage of event.view should be correct since the events used by whatInput should all be of type UIEvent, is there an event used here that does not support event.view
Please take a look at this testing-library/user-event#709 (comment)
|
There is Feel free to close this if a workaround for JSDOM is out of scope. |
Is Fluent completely incompatible with JSDOM ? can a workaround for testing-library be to manually set the |
|
Yes, we could add Also there are workarounds for most cases in consuming projects:
With the the current implementation of |
This seems like a problem for JS DOM, in this case is it possible to add a guard before the usage of |
|
I don't think adding code to guard against this bug is worth it. The replacement with |
|
Closing since this is an issue with JS DOM, since the events Fluent uses should support |
Pull request checklist
$ yarn changeyarn changesays:Description of changes
Replace
UIEvent.viewas it does not exist at least on some events in major browsers.See testing-library/user-event#709 (comment)
The event handlers in the utility are added on
Window.Therefore
UIEvent.viewis replaced withEvent.currentTarget.Focus areas to test
(optional)