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

(EAI-598) [UI] Investigate further code splitting #563

Merged
merged 4 commits into from
Dec 2, 2024
Merged

Conversation

nlarew
Copy link
Collaborator

@nlarew nlarew commented Nov 26, 2024

Jira: (EAI-598) [UI] Investigate further code splitting

Changes

  • Adds some additional code splitting & lazy loading to some components inside of the chat window view
  • Note the build output includes more, smaller, chunks. There is still some significant heft to the Message component that I think comes from the LG Chat markdown. Need to look upstream for a fix there.

Before (current main):

...
build/es/ConversationProvider.js            67.30 kB │ gzip:  16.89 kB
build/es/lodash.js                         121.75 kB │ gzip:  30.95 kB
build/es/index3.js                         173.01 kB │ gzip:  35.20 kB
build/es/index7.js                         181.52 kB │ gzip:  54.19 kB
build/es/messageLinks.js                   210.30 kB │ gzip:  41.70 kB
build/es/index2.js                         313.03 kB │ gzip:  83.32 kB
build/es/ui-text.js                        328.27 kB │ gzip:  66.02 kB
build/es/ChatWindow.js                   2,060.51 kB │ gzip: 418.91 kB
✓ built in 5.17s

After (this PR):

...
build/es/ConversationProvider.js            67.33 kB │ gzip:  16.89 kB
build/es/ChatWindow.js                      75.68 kB │ gzip:  13.25 kB
build/es/ChatMessageFeed.js                 77.13 kB │ gzip:  16.42 kB
build/es/lodash.js                         120.77 kB │ gzip:  30.56 kB
build/es/index13.js                        131.94 kB │ gzip:  44.06 kB
build/es/index6.js                         160.88 kB │ gzip:  31.62 kB
build/es/index15.js                        202.81 kB │ gzip:  39.37 kB
build/es/InputBar.js                       305.09 kB │ gzip:  61.32 kB
build/es/index2.js                         313.00 kB │ gzip:  83.31 kB
build/es/MessageRating.js                  612.44 kB │ gzip: 116.19 kB
build/es/MessageContent2.js              1,201.38 kB │ gzip: 262.81 kB
✓ built in 5.02s

@nlarew nlarew requested a review from mongodben November 26, 2024 19:51
Comment on lines +42 to +43
// TODO: Use this to animate the transition after https://jira.mongodb.org/browse/LG-3965 is merged.
// const ratingCommentInputVisible = hasRating && status !== "submitted" && status !== "abandoned";
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we have ticket for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@mongodben mongodben left a comment

Choose a reason for hiding this comment

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

lgtm (mostly based on trust). what do you think is the actual performance impact of this? like how many MS imprvoement on load time?

@nlarew
Copy link
Collaborator Author

nlarew commented Dec 2, 2024

what do you think is the actual performance impact of this

Honestly pretty minimal, though we'd need to test to get actual numbers. Should have some small effect though.

@nlarew nlarew merged commit 2c31bd1 into main Dec 2, 2024
1 check passed
@nlarew nlarew deleted the codesplit-chatfeed branch December 2, 2024 22:52
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.

2 participants