refactor: replace useEffectEvent with useStableCallback in various hooks and components#40824
refactor: replace useEffectEvent with useStableCallback in various hooks and components#40824tassoevan wants to merge 22 commits into
Conversation
… from AppAvatar, MessageAvatar, and RoomAvatar components
…ns across components
…ions across components
…nnotations across registration components
…ations in components - Updated multiple components to remove explicit return type annotations of ReactElement, allowing TypeScript to infer the return type. - Adjusted BlockProps to use ReactElement<any> for better type compatibility. - Cleaned up imports by removing unused ReactElement imports across various files.
…onal components - Removed explicit return type annotations of ReactElement from multiple functional components across the codebase. - Updated components in Markup, PreviewMarkup, HeadingBlock, OrderedListBlock, ParagraphBlock, QuoteBlock, SpoilerBlock, TaskListBlock, UnorderedListBlock, CodeBlock, CodeElement, PreviewCodeBlock, PreviewCodeElement, ColorElement, PreviewColorElement, BoldSpan, ImageElement, InlineElements, ItalicSpan, LinkSpan, PlainSpan, PreviewInlineElements, SpoilerSpan, StrikeSpan, BigEmojiBlock, BigEmojiElement, Emoji, EmojiElement, EmojiRenderer, PreviewBigEmojiBlock, PreviewEmojiElement, KatexBlock, KatexElement, KatexErrorBoundary, PreviewKatexBlock, PreviewKatexElement, ChannelMentionElement, PreviewChannelMentionElement, PreviewUserMentionElement, UserMentionElement.
…s from components
…tations from components
- Updated multiple components to remove explicit ReactElement return type annotations, simplifying the code and improving readability. - Components affected include ThreadMetrics, ThreadMetricsFollow, ThreadMetricsParticipants, UrlPreviews, MessageAction, AttachmentsItem, DefaultAttachment, QuoteAttachment, ActionAttachmentButton, AttachmentAuthorAvatar, CollapsibleContent, Reaction, OEmbedCollapsible, OEmbedHtmlPreview, OEmbedImagePreview, OEmbedLinkPreview, OEmbedPreviewContent, OEmbedResolver, UrlAudioPreview, UrlImagePreview, UrlPreview, UrlPreviewResolver, UrlVideoPreview, MessageRoles, AllMentionNotification, MessageNotification, UnreadMessagesNotification, MessageToolbar, DatePicker, FormatSelector, Preview, TimePicker, TimezoneSelector, RoomMessage, SystemMessage, ThreadMessage, ThreadMessagePreview, RoomMessageContent, ThreadMessageContent, and ThreadMessagePreviewBody.
…nal components - Removed ReactElement type annotations from various functional components across the application for cleaner code. - Updated components such as ReactionListModal, ReactionUserTag, Reactions, ReadReceiptRow, ReadReceiptsModal, ReportMessageModal, ChatProvider, RoomProvider, and others to improve consistency and readability.
- Removed ReactElement type annotations from various components to simplify type definitions. - Updated components such as AutoCompleteDepartmentAgent, AutoCompleteOutboundProvider, RecipientSelect, and others to use implicit return types. - Improved code readability and maintainability by streamlining type imports and component definitions.
- Updated multiple components to remove explicit ReactElement return type annotations, simplifying the code. - Adjusted function signatures in various files to use implicit return types instead. - Improved consistency across the codebase by standardizing function definitions.
… components - Changed event types from FormEvent to ChangeEvent in MatrixFederationManageServerModal, MatrixFederationSearchModalContent, TwoFactorEmail, TwoFactorTOTP, AddCustomSound, EditSound, NewImportPage, PermissionsTableFilter, BooleanSettingInput, FontSettingInput, GenericSettingInput, IntSettingInput, PasswordSettingInput, RelativeUrlSettingInput, StringSettingInput, TimespanSettingInput, SettingsGroupPage, LDAPGroupPage, UsersTableFilters, DateRangePicker, CallHistoryPageFilters, Omnichannel analytics DateRangePicker, CannedResponseList, DepartmentTags, RemoveContactModal, QuickActionOptions, MessageBox, RoomMembers, ThreadList, MultiSelectCustomList, and useMediaSession.
…oks and components - Updated multiple hooks and components to use useStableCallback instead of useEffectEvent for better stability and performance. - This change affects notification handling, modal management, team management, and various UI interactions across the application. - Adjusted related imports and ensured consistent usage of the new callback method.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #40824 +/- ##
===========================================
- Coverage 69.90% 69.82% -0.08%
===========================================
Files 3337 3331 -6
Lines 123489 123010 -479
Branches 22013 22122 +109
===========================================
- Hits 86322 85890 -432
+ Misses 33813 33762 -51
- Partials 3354 3358 +4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
As a first step towards upgrading to React 19, it handles types from
@types/reactlooking forward the next major.Issue(s)
Task: ARCH-2170
Steps to test or reproduce
Further comments
No runtime change is expected from it.