Implemented lazy loading to desired components
Issue #383
Brief Title
implemented lazy loading
Acceptance Criteria fulfillment
- [x] MessageToolbox in Message.js
- [x] Menu in ChatHeader.js
- [x] EmojiPicker in ChatInputFormattingToolbar.js
- [x] AudioMessageRecorder in ChatInputFormattingToolbar.js
- [x] ThreadHeader in ChatHeader.js
- [x] Attachments in Message.js
#Fixes Issue #383
PR Test Details
I have used react lazy, and suspense to ensure the components are rendered upon there first render and the initial bundle size is reduced
This pull request introduces code-splitting and lazy loading for several components across different parts of the application to improve performance by reducing the initial load time. The changes primarily involve the use of React's lazy and Suspense for dynamic imports.
Lazy loading and code-splitting:
-
packages/layout_editor/src/views/ChatHeader/ChatHeader.jsx: Added lazy loading for theMenucomponent and wrapped its usage withSuspense. [1] [2] [3] -
packages/layout_editor/src/views/Message/Message.jsx: Added lazy loading for theMessageToolboxcomponent and wrapped its usage withSuspense. [1] [2] -
packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js: Added lazy loading for theEmojiPickerandAudioMessageRecordercomponents and wrapped their usage withSuspense. [1] [2] [3] [4] [5] -
packages/react/src/views/Message/Message.js: Added lazy loading for theAttachmentsandMessageToolboxcomponents and wrapped their usage withSuspense. [1] [2] [3] [4] [5] [6] [7]
Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace <pr_number> with the actual PR number.
@Spiral-Memory @sidmohanty11 please review
Hey @tazsq
We'll have to see if we need lazy loadings here.. maybe we aren't looking for it right now.. still I'll look into it and let you know
Hey @tazsq
We'll have to see if we need lazy loadings here.. maybe we aren't looking for it right now.. still I'll look into it and let you know
Hey @Spiral-Memory @sidmohanty11 can you revert on this issue?