Skip to content

Conversation

@ling1726
Copy link
Contributor

@ling1726 ling1726 commented Aug 5, 2022

Successor to #21828 since there were a lot of conflicts that happened while Floating UI was stuck in v0

No breaking changes expected ✅

Fixes #22067
Fixes #21840

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 5, 2022

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 288a4c0:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration
twilight-haze-flvcvk Issue #21840

@size-auditor
Copy link

size-auditor bot commented Aug 5, 2022

Asset size changes

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

Baseline commit: d4fc91782fa73209f6dc0a25c04d1f2e5618ee2e (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 5, 2022

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1270 1170 5000
Button mount 962 959 5000
FluentProvider mount 1525 1524 5000
FluentProviderWithTheme mount 631 549 10
FluentProviderWithTheme virtual-rerender 587 583 10
FluentProviderWithTheme virtual-rerender-with-unmount 625 620 10
MakeStyles mount 1773 1876 50000
SpinButton mount 2397 2399 5000

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 5, 2022

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
ButtonMinimalPerf.default 141 119 1.18:1
AnimationMinimalPerf.default 448 386 1.16:1
RadioGroupMinimalPerf.default 372 332 1.12:1
TreeWith60ListItems.default 149 133 1.12:1
PortalMinimalPerf.default 151 136 1.11:1
ProviderMinimalPerf.default 335 302 1.11:1
ListMinimalPerf.default 425 391 1.09:1
AttachmentSlotsPerf.default 932 874 1.07:1
ItemLayoutMinimalPerf.default 964 901 1.07:1
RefMinimalPerf.default 185 173 1.07:1
ChatWithPopoverPerf.default 321 303 1.06:1
TableMinimalPerf.default 337 319 1.06:1
AttachmentMinimalPerf.default 130 124 1.05:1
DividerMinimalPerf.default 295 280 1.05:1
DropdownMinimalPerf.default 2646 2528 1.05:1
MenuButtonMinimalPerf.default 1408 1354 1.04:1
TextMinimalPerf.default 291 280 1.04:1
ToolbarMinimalPerf.default 791 762 1.04:1
AccordionMinimalPerf.default 120 117 1.03:1
GridMinimalPerf.default 284 275 1.03:1
ImageMinimalPerf.default 306 297 1.03:1
InputMinimalPerf.default 1092 1062 1.03:1
SkeletonMinimalPerf.default 284 275 1.03:1
ButtonSlotsPerf.default 453 442 1.02:1
ChatMinimalPerf.default 629 619 1.02:1
DialogMinimalPerf.default 644 634 1.02:1
SliderMinimalPerf.default 1410 1378 1.02:1
CarouselMinimalPerf.default 393 391 1.01:1
HeaderMinimalPerf.default 296 292 1.01:1
ListWith60ListItems.default 504 497 1.01:1
RosterPerf.default 910 897 1.01:1
ReactionMinimalPerf.default 311 308 1.01:1
TextAreaMinimalPerf.default 409 405 1.01:1
CustomToolbarPrototype.default 2292 2273 1.01:1
TooltipMinimalPerf.default 915 907 1.01:1
TreeMinimalPerf.default 677 671 1.01:1
BoxMinimalPerf.default 281 282 1:1
CardMinimalPerf.default 439 441 1:1
CheckboxMinimalPerf.default 2261 2255 1:1
EmbedMinimalPerf.default 3404 3407 1:1
LoaderMinimalPerf.default 563 564 1:1
MenuMinimalPerf.default 709 709 1:1
ProviderMergeThemesPerf.default 1062 1057 1:1
StatusMinimalPerf.default 556 557 1:1
TableManyItemsPerf.default 1558 1554 1:1
ButtonOverridesMissPerf.default 1252 1266 0.99:1
ChatDuplicateMessagesPerf.default 229 231 0.99:1
LayoutMinimalPerf.default 294 296 0.99:1
ListNestedPerf.default 450 455 0.99:1
SplitButtonMinimalPerf.default 3588 3615 0.99:1
DatepickerMinimalPerf.default 4506 4615 0.98:1
DropdownManyItemsPerf.default 552 561 0.98:1
FlexMinimalPerf.default 233 238 0.98:1
ListCommonPerf.default 516 525 0.98:1
HeaderSlotsPerf.default 625 642 0.97:1
IconMinimalPerf.default 497 511 0.97:1
AlertMinimalPerf.default 216 224 0.96:1
VideoMinimalPerf.default 503 528 0.95:1
AvatarMinimalPerf.default 149 158 0.94:1
LabelMinimalPerf.default 277 295 0.94:1
SegmentMinimalPerf.default 254 279 0.91:1
PopupMinimalPerf.default 464 522 0.89:1
FormMinimalPerf.default 290 329 0.88:1

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 5, 2022

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-combobox
Combobox (including child components)
75.081 kB
24.145 kB
70.912 kB
23.183 kB
-4.169 kB
-962 B
react-combobox
Dropdown (including child components)
74.594 kB
24.134 kB
70.425 kB
23.166 kB
-4.169 kB
-968 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
192.719 kB
52.784 kB
188.488 kB
51.744 kB
-4.231 kB
-1.04 kB
react-menu
Menu (including children components)
118.878 kB
36.004 kB
114.702 kB
35.037 kB
-4.176 kB
-967 B
react-menu
Menu (including selectable components)
122.077 kB
36.497 kB
117.901 kB
35.533 kB
-4.176 kB
-964 B
react-popover
Popover
106.135 kB
32.236 kB
101.926 kB
31.275 kB
-4.209 kB
-961 B
react-positioning
usePositioning
23.854 kB
8.299 kB
19.656 kB
7.388 kB
-4.198 kB
-911 B
react-tooltip
Tooltip
45.515 kB
15.545 kB
41.307 kB
14.586 kB
-4.208 kB
-959 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
533 B
341 B
global-context
createContextSelector
554 B
348 B
priority-overflow
createOverflowManager
2.936 kB
1.212 kB
react-accordion
Accordion (including children components)
79.485 kB
24.082 kB
react-alert
Alert
82.763 kB
20.582 kB
react-avatar
Avatar
48.172 kB
13.615 kB
react-avatar
AvatarGroup
13.43 kB
5.382 kB
react-avatar
AvatarGroupItem
64.878 kB
18.284 kB
react-badge
Badge
22.494 kB
7.157 kB
react-badge
CounterBadge
23.397 kB
7.449 kB
react-badge
PresenceBadge
23.947 kB
7.022 kB
react-button
Button
36.396 kB
9.575 kB
react-button
CompoundButton
43.469 kB
10.812 kB
react-button
MenuButton
39.014 kB
10.456 kB
react-button
SplitButton
46.506 kB
11.827 kB
react-button
ToggleButton
51.91 kB
11.003 kB
react-card
Card - All
67.42 kB
19.249 kB
react-card
Card
63.102 kB
18.167 kB
react-card
CardFooter
8.461 kB
3.555 kB
react-card
CardHeader
9.504 kB
3.896 kB
react-card
CardPreview
8.562 kB
3.61 kB
react-components
react-components: FluentProvider & webLightTheme
32.688 kB
10.736 kB
react-dialog
Dialog (including children components)
85.064 kB
25.293 kB
react-divider
Divider
16.321 kB
5.837 kB
react-image
Image
10.68 kB
4.215 kB
react-input
Input
23.554 kB
7.644 kB
react-label
Label
9.238 kB
3.815 kB
react-link
Link
12.197 kB
4.912 kB
react-overflow
hooks only
10.839 kB
4.146 kB
react-portal
Portal
10.49 kB
3.845 kB
react-provider
FluentProvider
15.565 kB
5.818 kB
react-radio
Radio
36.13 kB
11.947 kB
react-radio
RadioGroup
14.319 kB
5.711 kB
react-select
Select
20.746 kB
7.299 kB
react-slider
Slider
31.988 kB
10.019 kB
react-spinbutton
SpinButton
43.899 kB
12.362 kB
react-spinner
Spinner
19.932 kB
6.363 kB
react-switch
Switch
32.438 kB
10.218 kB
react-text
Text - Default
11.572 kB
4.537 kB
react-text
Text - Wrappers
14.882 kB
4.977 kB
react-textarea
Textarea
23.078 kB
7.707 kB
react-theme
Single theme token import
69 B
89 B
react-theme
Teams: all themes
28.995 kB
6.215 kB
react-theme
Teams: Light theme
16.973 kB
4.86 kB
react-utilities
SSRProvider
189 B
161 B
🤖 This report was generated against d4fc91782fa73209f6dc0a25c04d1f2e5618ee2e

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 5, 2022

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 981 1021 5000
Breadcrumb mount 2908 2887 1000
Checkbox mount 2836 2831 5000
CheckboxBase mount 2434 2450 5000
ChoiceGroup mount 5126 5034 5000
ComboBox mount 1033 1010 1000
CommandBar mount 11210 11152 1000
ContextualMenu mount 12302 12359 1000
DefaultButton mount 1260 1194 5000
DetailsRow mount 4085 4035 5000
DetailsRowFast mount 4049 3979 5000
DetailsRowNoStyles mount 3851 3930 5000
Dialog mount 3082 3038 1000
DocumentCardTitle mount 194 174 1000
Dropdown mount 3496 3497 5000
FocusTrapZone mount 1987 2035 5000
FocusZone mount 2010 1904 5000
IconButton mount 1876 1924 5000
Label mount 388 383 5000
Layer mount 3372 3308 5000
Link mount 499 514 5000
MenuButton mount 1618 1623 5000
MessageBar mount 2259 2273 5000
Nav mount 3477 3514 1000
OverflowSet mount 1212 1168 5000
Panel mount 2358 2379 1000
Persona mount 1049 1062 1000
Pivot mount 1577 1523 1000
PrimaryButton mount 1394 1430 5000
Rating mount 8340 8250 5000
SearchBox mount 1465 1407 5000
Shimmer mount 2731 2615 5000
Slider mount 2114 2107 5000
SpinButton mount 5329 5423 5000
Spinner mount 453 465 5000
SplitButton mount 3482 3453 5000
Stack mount 548 555 5000
StackWithIntrinsicChildren mount 2436 2393 5000
StackWithTextChildren mount 5476 5538 5000
SwatchColorPicker mount 12296 12353 5000
TagPicker mount 2859 2859 5000
TeachingBubble mount 97180 98702 5000
Text mount 477 450 5000
TextField mount 1524 1493 5000
ThemeProvider mount 1261 1294 5000
ThemeProvider virtual-rerender 722 734 5000
ThemeProvider virtual-rerender-with-unmount 1942 1956 5000
Toggle mount 852 867 5000
buttonNative mount 146 142 5000

@ling1726 ling1726 marked this pull request as ready for review August 5, 2022 13:39
@ling1726 ling1726 requested review from a team as code owners August 5, 2022 13:39
Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

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

FYI: There is a snapshot problem that breaks tests 👀

@@ -0,0 +1,7 @@
{
"type": "minor",
Copy link
Member

Choose a reason for hiding this comment

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

I would say that it's a patch, as we didn't bring anything new

// Warning: (ae-internal-missing-underscore) The name "mergeArrowOffset" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
// @public
Copy link
Member

Choose a reason for hiding this comment

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

This should not be public, right?

// @internal
export function usePositioning(options?: UsePopperOptions): {
// @public (undocumented)
export function usePositioning(options: UsePositioningOptions): {
Copy link
Member

Choose a reason for hiding this comment

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

It was not public before, are we making it public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch 👍

@layershifter
Copy link
Member

Please add to PR's description that "no breaking changes are expected" 🐱

@ling1726
Copy link
Contributor Author

ling1726 commented Aug 5, 2022

FYI: There is a snapshot problem that breaks tests 👀

Yeah I'm debugging it, it's a bigger pandora's box .... stay tuned 👀👀

Comment on lines 77 to 86
// This is super duper stuuuuuuupid
// FIXME for node > 14
// node 15 introduces promise rejection which means that any components
// tests need to be `it('', async () => {})` otherwise there can be race conditions with
// JSOM being torn down before this promise is resolved.
// Unless all tests that ever use `usePositioning` are turned into async tests, any logging during testing
// will actually be counter productive
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-console
console.error('[usePositioning]: Failed to calculate position', err);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

uuuuh @Hotell any ideas here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems that the issue with test-library is known floating-ui/floating-ui#1845. This workaround will stay unless we want our partners to spend an unknown amount of time updating their tests 😬😬

Copy link
Contributor

Choose a reason for hiding this comment

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

"sounds good", thanks for additional investigation, lets ship this !

// JSOM being torn down before this promise is resolved.
// Unless all tests that ever use `usePositioning` are turned into async tests, any logging during testing
// will actually be counter productive
if (process.env.NODE_ENV === 'development') {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we use check as we do in other places ?

Suggested change
if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV !== 'production') {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

});
})
.catch(err => {
// This is super duper stuuuuuuupid
Copy link
Contributor

Choose a reason for hiding this comment

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

can we rephrase this a bit ? :D

@ling1726 ling1726 closed this Aug 8, 2022
@ling1726 ling1726 reopened this Aug 8, 2022
@ling1726 ling1726 closed this Aug 8, 2022
@ling1726 ling1726 reopened this Aug 8, 2022
@ling1726 ling1726 closed this Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade from Popper to Floating UI RTL affects vertical cross axis offsets for popper

5 participants