Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: Improve bundle size#5761

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 6 commits intomainfrombq/visualizer
Jan 18, 2023
Merged

chore: Improve bundle size#5761

BrunoQuaresma merged 6 commits intomainfrombq/visualizer
Jan 18, 2023

Conversation

BrunoQuaresma
Copy link
Collaborator

TLDR: The main bundleindex.js was reduced from499.45 KiB to355.74 KiB and reduced the size of the pages were using the emoji picker.

I noticed Vite was showing a warning about one of the chunks getting larger than500 KiB so I installed a plugin to start the analyses and to make it easier in the future, I added an npm script:yarn stats.

The initial analyses:
Screen Shot 2023-01-17 at 19 15 29
Screen Shot 2023-01-17 at 19 39 23

  • I noticed the emoji plugin was adding a lot of stuff in the main chunk
  • I also noticed lodash was doing the same even though we don't use it too much

What I made:

  • We already had a plugin calledIconField that was abstracting the emoji usage but we were not using it consistently, so I refactor the code to use it. After that, I created a lazy version of this component, so it could be loaded when it is needed only.
  • I noticed thetestHelpers was importing therange function directly from the lodash bundle instead of specifying the full path.

Result:
Screen Shot 2023-01-17 at 19 37 35
Screen Shot 2023-01-17 at 19 37 51

@BrunoQuaresmaBrunoQuaresma requested a review froma team as acode ownerJanuary 17, 2023 22:46
@BrunoQuaresmaBrunoQuaresma requested review fromcode-asher and removed request fora teamJanuary 17, 2023 22:46
@BrunoQuaresmaBrunoQuaresma self-assigned thisJan 18, 2023
@BrunoQuaresmaBrunoQuaresmaenabled auto-merge (squash)January 18, 2023 17:25
@BrunoQuaresmaBrunoQuaresma merged commit2117eb4 intomainJan 18, 2023
@BrunoQuaresmaBrunoQuaresma deleted the bq/visualizer branchJanuary 18, 2023 17:31
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 18, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@kylecarbskylecarbskylecarbs approved these changes

@code-ashercode-asherAwaiting requested review from code-ashercode-asher was automatically assigned from coder/ts

Assignees

@BrunoQuaresmaBrunoQuaresma

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@BrunoQuaresma@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp