-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat: Implement state management for toasts #27800
Conversation
Starts with the simplest use case - make a toast appear configurable with: - timeout - position
packages/fluentui/react-northstar/src/components/Animation/Animation.tsx
Show resolved
Hide resolved
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
InfoButton | mount | 21 | 19 | 5000 | Possible regression |
All results
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 737 | 716 | 5000 | |
Button | mount | 369 | 372 | 5000 | |
Field | mount | 1263 | 1298 | 5000 | |
FluentProvider | mount | 905 | 908 | 5000 | |
FluentProviderWithTheme | mount | 115 | 109 | 10 | |
FluentProviderWithTheme | virtual-rerender | 98 | 91 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 103 | 101 | 10 | |
InfoButton | mount | 21 | 19 | 5000 | Possible regression |
MakeStyles | mount | 1127 | 1119 | 50000 | |
Persona | mount | 2030 | 2011 | 5000 | |
SpinButton | mount | 1591 | 1595 | 5000 |
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 4a35e67:
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 27f252e27361df75a94c5bc5b09fc0097fefd969 (build) |
Perf Analysis (
|
Scenario | Current PR Ticks | Baseline Ticks | Ratio | Regression Analysis |
---|---|---|---|---|
ButtonMinimalPerf.default | 113 | 109 | 1.04:1 | analysis |
Perf tests with no regressions
Scenario | Current PR Ticks | Baseline Ticks | Ratio |
---|---|---|---|
AccordionMinimalPerf.default | 110 | 101 | 1.09:1 |
ChatMinimalPerf.default | 553 | 527 | 1.05:1 |
InputMinimalPerf.default | 766 | 731 | 1.05:1 |
TextMinimalPerf.default | 258 | 246 | 1.05:1 |
ChatWithPopoverPerf.default | 245 | 236 | 1.04:1 |
HeaderSlotsPerf.default | 568 | 547 | 1.04:1 |
MenuMinimalPerf.default | 625 | 603 | 1.04:1 |
PortalMinimalPerf.default | 122 | 117 | 1.04:1 |
ProviderMinimalPerf.default | 280 | 268 | 1.04:1 |
RefMinimalPerf.default | 142 | 136 | 1.04:1 |
AvatarMinimalPerf.default | 135 | 131 | 1.03:1 |
CarouselMinimalPerf.default | 348 | 338 | 1.03:1 |
DropdownManyItemsPerf.default | 503 | 490 | 1.03:1 |
GridMinimalPerf.default | 250 | 243 | 1.03:1 |
LabelMinimalPerf.default | 282 | 273 | 1.03:1 |
LayoutMinimalPerf.default | 271 | 262 | 1.03:1 |
ListMinimalPerf.default | 389 | 378 | 1.03:1 |
StatusMinimalPerf.default | 518 | 501 | 1.03:1 |
IconMinimalPerf.default | 487 | 472 | 1.03:1 |
TextAreaMinimalPerf.default | 359 | 350 | 1.03:1 |
TreeMinimalPerf.default | 605 | 590 | 1.03:1 |
AnimationMinimalPerf.default | 372 | 365 | 1.02:1 |
ButtonSlotsPerf.default | 411 | 404 | 1.02:1 |
CardMinimalPerf.default | 378 | 371 | 1.02:1 |
SegmentMinimalPerf.default | 255 | 251 | 1.02:1 |
SliderMinimalPerf.default | 946 | 923 | 1.02:1 |
CustomToolbarPrototype.default | 1954 | 1921 | 1.02:1 |
AttachmentSlotsPerf.default | 838 | 828 | 1.01:1 |
ButtonOverridesMissPerf.default | 836 | 826 | 1.01:1 |
DatepickerMinimalPerf.default | 4600 | 4533 | 1.01:1 |
DialogMinimalPerf.default | 583 | 578 | 1.01:1 |
EmbedMinimalPerf.default | 2415 | 2393 | 1.01:1 |
FormMinimalPerf.default | 269 | 267 | 1.01:1 |
ItemLayoutMinimalPerf.default | 907 | 901 | 1.01:1 |
ReactionMinimalPerf.default | 277 | 275 | 1.01:1 |
TableMinimalPerf.default | 296 | 293 | 1.01:1 |
TooltipMinimalPerf.default | 1632 | 1616 | 1.01:1 |
BoxMinimalPerf.default | 250 | 249 | 1:1 |
CheckboxMinimalPerf.default | 1571 | 1566 | 1:1 |
DropdownMinimalPerf.default | 1821 | 1812 | 1:1 |
FlexMinimalPerf.default | 200 | 201 | 1:1 |
ListCommonPerf.default | 508 | 508 | 1:1 |
MenuButtonMinimalPerf.default | 1264 | 1269 | 1:1 |
RosterPerf.default | 1836 | 1832 | 1:1 |
PopupMinimalPerf.default | 452 | 451 | 1:1 |
RadioGroupMinimalPerf.default | 337 | 336 | 1:1 |
SkeletonMinimalPerf.default | 255 | 254 | 1:1 |
SplitButtonMinimalPerf.default | 3068 | 3057 | 1:1 |
ToolbarMinimalPerf.default | 658 | 657 | 1:1 |
TreeWith60ListItems.default | 117 | 117 | 1:1 |
VideoMinimalPerf.default | 533 | 534 | 1:1 |
AlertMinimalPerf.default | 196 | 197 | 0.99:1 |
ChatDuplicateMessagesPerf.default | 185 | 186 | 0.99:1 |
ProviderMergeThemesPerf.default | 971 | 981 | 0.99:1 |
TableManyItemsPerf.default | 1434 | 1442 | 0.99:1 |
DividerMinimalPerf.default | 259 | 264 | 0.98:1 |
HeaderMinimalPerf.default | 259 | 267 | 0.97:1 |
LoaderMinimalPerf.default | 237 | 245 | 0.97:1 |
AttachmentMinimalPerf.default | 96 | 100 | 0.96:1 |
ImageMinimalPerf.default | 274 | 284 | 0.96:1 |
ListWith60ListItems.default | 470 | 491 | 0.96:1 |
ListNestedPerf.default | 369 | 409 | 0.9:1 |
📊 Bundle size reportUnchanged fixtures
|
🕵 FluentUI-v0 No visual regressions between this PR and main |
🕵 fluentuiv9 No visual regressions between this PR and main |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
BaseButton | mount | 1024 | 1011 | 5000 | |
Breadcrumb | mount | 2607 | 2613 | 1000 | |
Checkbox | mount | 2682 | 2652 | 5000 | |
CheckboxBase | mount | 2347 | 2370 | 5000 | |
ChoiceGroup | mount | 4770 | 4850 | 5000 | |
ComboBox | mount | 1095 | 1051 | 1000 | |
CommandBar | mount | 9610 | 9697 | 1000 | |
ContextualMenu | mount | 20082 | 21334 | 1000 | |
DefaultButton | mount | 1224 | 1246 | 5000 | |
DetailsRow | mount | 3639 | 3696 | 5000 | |
DetailsRowFast | mount | 3683 | 3661 | 5000 | |
DetailsRowNoStyles | mount | 3431 | 3352 | 5000 | |
Dialog | mount | 4244 | 4284 | 1000 | |
DocumentCardTitle | mount | 371 | 376 | 1000 | |
Dropdown | mount | 3217 | 3179 | 5000 | |
FocusTrapZone | mount | 1832 | 1871 | 5000 | |
FocusZone | mount | 1735 | 1738 | 5000 | |
GroupedList | mount | 68437 | 81500 | 2 | |
GroupedList | virtual-rerender | 33450 | 33403 | 2 | |
GroupedList | virtual-rerender-with-unmount | 87605 | 88261 | 2 | |
GroupedListV2 | mount | 365 | 368 | 2 | |
GroupedListV2 | virtual-rerender | 338 | 353 | 2 | |
GroupedListV2 | virtual-rerender-with-unmount | 375 | 375 | 2 | |
IconButton | mount | 1825 | 1832 | 5000 | |
Label | mount | 529 | 539 | 5000 | |
Layer | mount | 4412 | 4500 | 5000 | |
Link | mount | 627 | 636 | 5000 | |
MenuButton | mount | 1526 | 1554 | 5000 | |
MessageBar | mount | 31973 | 31850 | 5000 | |
Nav | mount | 3164 | 3187 | 1000 | |
OverflowSet | mount | 1216 | 1210 | 5000 | |
Panel | mount | 2596 | 2660 | 1000 | |
Persona | mount | 1210 | 1185 | 1000 | |
Pivot | mount | 1456 | 1471 | 1000 | |
PrimaryButton | mount | 1336 | 1352 | 5000 | |
Rating | mount | 7354 | 7453 | 5000 | |
SearchBox | mount | 1514 | 1490 | 5000 | |
Shimmer | mount | 2995 | 2999 | 5000 | |
Slider | mount | 2140 | 2152 | 5000 | |
SpinButton | mount | 4662 | 4635 | 5000 | |
Spinner | mount | 607 | 622 | 5000 | |
SplitButton | mount | 3093 | 3141 | 5000 | |
Stack | mount | 667 | 651 | 5000 | |
StackWithIntrinsicChildren | mount | 1368 | 1383 | 5000 | |
StackWithTextChildren | mount | 4085 | 4116 | 5000 | |
SwatchColorPicker | mount | 9925 | 9878 | 5000 | |
TagPicker | mount | 2571 | 2544 | 5000 | |
Text | mount | 578 | 600 | 5000 | |
TextField | mount | 1554 | 1565 | 5000 | |
ThemeProvider | mount | 1393 | 1413 | 5000 | |
ThemeProvider | virtual-rerender | 905 | 900 | 5000 | |
ThemeProvider | virtual-rerender-with-unmount | 2116 | 2128 | 5000 | |
Toggle | mount | 945 | 995 | 5000 | |
buttonNative | mount | 322 | 309 | 5000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is definitely a "whole new world" of an API model, which makes sense as the Toast problem is more of imperative API, I guess?!
Would be nice to have a follow through react-toast
initial implementation 😁.
TLDR: LGTM, nit: basically some naming things and some
packages/react-components/react-toast/src/components/Toaster.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/react-toast/src/state/vanilla/createToast.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-toast/src/state/vanilla/createToast.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-toast/src/state/useToastFactory.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-toast/src/state/useToastFactory.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-toast/stories/Toast/CustomTimeout.stories.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/react-toast/src/state/vanilla/toaster.ts
Outdated
Show resolved
Hide resolved
🕵 fluentuiv8 No visual regressions between this PR and main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing files owned by v-build
* master: feat(react-drawer): create DrawerBody component (microsoft#27581) feat(react-tree): TreeItem itemType restructure (microsoft#27799) feat: Implement state management for toasts (microsoft#27800) bugfix: fix VisibleFlatTreeItemGenerator omitting visible items (microsoft#27802) fix: overflowManager should always dispatch initial state (microsoft#27756) fix(react-badge): Remove white border around presence badge when on a dark background (microsoft#27780) react-tags: rename dismissable to dismissible (microsoft#27798) chore: update ownership of react-tags (microsoft#27795) applying package updates feat(react-tags): Replace `avatar` prop with `media`; polish styles for spacing (microsoft#27725) RFC appearance migration (microsoft#24181) chore(react-skeleton): Release react-skeleton to stable (microsoft#27767) fix(Coachmark): Remove positioning regression and update bounds on resize (microsoft#27782) applying package updates fix(v8): explicitly publish dist folder after node 16 upgrade (microsoft#27769)
* feat/drawer-header: fix: add changefiles feat(react-drawer): create DrawerBody component (microsoft#27581) feat(react-tree): TreeItem itemType restructure (microsoft#27799) feat: Implement state management for toasts (microsoft#27800) bugfix: fix VisibleFlatTreeItemGenerator omitting visible items (microsoft#27802) fix: overflowManager should always dispatch initial state (microsoft#27756) fix(react-badge): Remove white border around presence badge when on a dark background (microsoft#27780) react-tags: rename dismissable to dismissible (microsoft#27798) chore: update ownership of react-tags (microsoft#27795) applying package updates feat(react-tags): Replace `avatar` prop with `media`; polish styles for spacing (microsoft#27725) RFC appearance migration (microsoft#24181) chore(react-skeleton): Release react-skeleton to stable (microsoft#27767) fix(Coachmark): Remove positioning regression and update bounds on resize (microsoft#27782) applying package updates fix(v8): explicitly publish dist folder after node 16 upgrade (microsoft#27769)
* master: (29 commits) feat(react-drawer): create DrawerBody component (microsoft#27581) feat(react-tree): TreeItem itemType restructure (microsoft#27799) feat: Implement state management for toasts (microsoft#27800) bugfix: fix VisibleFlatTreeItemGenerator omitting visible items (microsoft#27802) fix: overflowManager should always dispatch initial state (microsoft#27756) fix(react-badge): Remove white border around presence badge when on a dark background (microsoft#27780) react-tags: rename dismissable to dismissible (microsoft#27798) chore: update ownership of react-tags (microsoft#27795) applying package updates feat(react-tags): Replace `avatar` prop with `media`; polish styles for spacing (microsoft#27725) RFC appearance migration (microsoft#24181) chore(react-skeleton): Release react-skeleton to stable (microsoft#27767) fix(Coachmark): Remove positioning regression and update bounds on resize (microsoft#27782) applying package updates fix(v8): explicitly publish dist folder after node 16 upgrade (microsoft#27769) applying package updates fix: do not use outlineStyle: none in createCustomFocusIndicatorStyle (microsoft#26089) fix: Scale pulse animation with percentages and flip wave animation's direction (microsoft#27654) Publish dist folder that got removed due to node 16 upgrade (microsoft#27764) fix(scripts-update-release-notes): properly handle git for-each-ref cmd call to not fail release notes update (microsoft#27757) ...
Starts with the simplest use case - make a toast appear configurable with:
The main toast management will be done in vanilla js, so that it can be reusable by non-react code in the future (i.e. web-components)
Addresses #27776