Skip to content
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

fix(EventListener): do not use defaultProps #28725

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Aug 3, 2023

New Behavior

No deprecation warnings with React 18 in EventListener component.

Related Issue(s)

@layershifter layershifter requested a review from a team as a code owner August 3, 2023 12:58
@github-actions github-actions bot added this to the August Project Cycle Q4 2023 milestone Aug 3, 2023
@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 3, 2023

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 0f055f1:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

📊 Bundle size report

🤖 This report was generated against 44b128284cf90386b75dfba7336e4950428820bf

@fabricteam
Copy link
Collaborator

🕵 FluentUIV0 No visual regressions between this PR and main

@size-auditor
Copy link

size-auditor bot commented Aug 3, 2023

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-northstar-Chat 159.446 kB 159.513 kB ExceedsBaseline     67 bytes
office-ui-fabric-react fluentui-react-northstar-Datepicker 193.768 kB 193.835 kB ExceedsBaseline     67 bytes
office-ui-fabric-react fluentui-react-northstar-Menu 132.497 kB 132.564 kB ExceedsBaseline     67 bytes
office-ui-fabric-react fluentui-react-northstar-SplitButton 184.697 kB 184.764 kB ExceedsBaseline     67 bytes
office-ui-fabric-react fluentui-react-northstar-MenuButton 168.377 kB 168.444 kB ExceedsBaseline     67 bytes
office-ui-fabric-react fluentui-react-northstar-Dropdown 203.774 kB 203.841 kB ExceedsBaseline     67 bytes
office-ui-fabric-react fluentui-react-northstar-Popup 138.468 kB 138.535 kB ExceedsBaseline     67 bytes
office-ui-fabric-react fluentui-react-northstar-Portal 59.811 kB 59.874 kB ExceedsBaseline     63 bytes
office-ui-fabric-react fluentui-react-northstar-Toolbar 180.854 kB 180.917 kB ExceedsBaseline     63 bytes
office-ui-fabric-react fluentui-react-northstar-Dialog 117.057 kB 117.12 kB ExceedsBaseline     63 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: 44b128284cf90386b75dfba7336e4950428820bf (build)

@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AttachmentMinimalPerf.default 88 78 1.13:1
ButtonMinimalPerf.default 88 80 1.1:1
FormMinimalPerf.default 243 220 1.1:1
FlexMinimalPerf.default 160 147 1.09:1
AvatarMinimalPerf.default 107 101 1.06:1
BoxMinimalPerf.default 198 186 1.06:1
ButtonOverridesMissPerf.default 675 639 1.06:1
ProviderMinimalPerf.default 199 189 1.05:1
ButtonSlotsPerf.default 315 303 1.04:1
HeaderMinimalPerf.default 211 202 1.04:1
ImageMinimalPerf.default 224 216 1.04:1
RefMinimalPerf.default 110 106 1.04:1
AlertMinimalPerf.default 161 157 1.03:1
AttachmentSlotsPerf.default 649 629 1.03:1
CarouselMinimalPerf.default 256 248 1.03:1
ListNestedPerf.default 338 328 1.03:1
ProviderMergeThemesPerf.default 674 657 1.03:1
StatusMinimalPerf.default 399 389 1.03:1
TreeMinimalPerf.default 483 471 1.03:1
DividerMinimalPerf.default 205 201 1.02:1
GridMinimalPerf.default 198 195 1.02:1
RadioGroupMinimalPerf.default 261 257 1.02:1
ReactionMinimalPerf.default 216 212 1.02:1
VideoMinimalPerf.default 436 427 1.02:1
AccordionMinimalPerf.default 78 77 1.01:1
DropdownManyItemsPerf.default 395 392 1.01:1
MenuButtonMinimalPerf.default 944 938 1.01:1
SliderMinimalPerf.default 742 738 1.01:1
SplitButtonMinimalPerf.default 2229 2199 1.01:1
TextAreaMinimalPerf.default 290 286 1.01:1
ToolbarMinimalPerf.default 525 521 1.01:1
TreeWith60ListItems.default 87 86 1.01:1
AnimationMinimalPerf.default 305 304 1:1
CheckboxMinimalPerf.default 1134 1137 1:1
DialogMinimalPerf.default 446 448 1:1
EmbedMinimalPerf.default 1855 1860 1:1
LoaderMinimalPerf.default 196 196 1:1
PortalMinimalPerf.default 85 85 1:1
CustomToolbarPrototype.default 1478 1477 1:1
TooltipMinimalPerf.default 1252 1248 1:1
ChatMinimalPerf.default 423 428 0.99:1
ChatWithPopoverPerf.default 194 196 0.99:1
DatepickerMinimalPerf.default 3513 3540 0.99:1
DropdownMinimalPerf.default 1386 1404 0.99:1
ItemLayoutMinimalPerf.default 708 715 0.99:1
LabelMinimalPerf.default 215 217 0.99:1
LayoutMinimalPerf.default 202 204 0.99:1
PopupMinimalPerf.default 342 344 0.99:1
TableManyItemsPerf.default 1132 1138 0.99:1
HeaderSlotsPerf.default 454 465 0.98:1
InputMinimalPerf.default 518 530 0.98:1
ListCommonPerf.default 384 392 0.98:1
RosterPerf.default 1510 1539 0.98:1
SegmentMinimalPerf.default 193 197 0.98:1
TextMinimalPerf.default 185 188 0.98:1
ListMinimalPerf.default 302 312 0.97:1
CardMinimalPerf.default 299 313 0.96:1
IconMinimalPerf.default 380 394 0.96:1
ChatDuplicateMessagesPerf.default 153 161 0.95:1
MenuMinimalPerf.default 471 495 0.95:1
TableMinimalPerf.default 228 241 0.95:1
ListWith60ListItems.default 361 384 0.94:1
SkeletonMinimalPerf.default 193 206 0.94:1

@layershifter layershifter merged commit 595d43b into microsoft:master Aug 3, 2023
21 checks passed
@layershifter layershifter deleted the fix/event-default-props branch August 3, 2023 14:23
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Aug 7, 2023
* master:
  chore(cxe-prg): migrate to new slot API (microsoft#28752)
  chore(teams-prg): migrate to new slot API (microsoft#28751)
  chore: re-export slot and assertSlots methods (microsoft#28755)
  Docs(react-tree): Improve docs and stories (microsoft#28741)
  feat: implements nested tree selection (microsoft#28668)
  applying package updates
  applying package updates
  feature(react-utilities): implements new slot methods (`slot` and `assertSlots`) (microsoft#28373)
  fix(TimePicker): Selection now works in locales that don't use "am"/"pm" in their time format (microsoft#28469)
  bugfix: ensures controlled state works properly + (microsoft#28665)
  feat(tokens): Add status color tokens (microsoft#28006)
  feat(tokens): Add colorBrandStroke2Contrast and colorNeutralStrokeAlpha2 (microsoft#28638)
  Made BreadcrumbButton consistent with Item and Link (microsoft#28672)
  fix(EventListener): do not use `defaultProps` (microsoft#28725)
@therealgilles
Copy link

therealgilles commented Jun 16, 2024

Is this change in any available release? I am using 0.66.5 and defaultProps are still there. Is it possible the dist directory did not get rebuilt?

// node_modules/@fluentui/react-component-event-listener/dist/es/EventListener.js
import { useEventListener } from './useEventListener';
export var EventListener = /*#__PURE__*/function () {
  function EventListener(props) {
    useEventListener(props);
    return null;
  }
  EventListener.defaultProps = {
    capture: false
  };
  return EventListener;
}();
//# sourceMappingURL=EventListener.js.map

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.

Update defaultProps usage in EventListener component to comply with future changes
4 participants