Skip to content

lodash imports made effecient#661

Closed
Mujtaba1598 wants to merge 1 commit into
hack4impact-uiuc:masterfrom
Mujtaba1598:master
Closed

lodash imports made effecient#661
Mujtaba1598 wants to merge 1 commit into
hack4impact-uiuc:masterfrom
Mujtaba1598:master

Conversation

@Mujtaba1598

Copy link
Copy Markdown

Status:

Ready

Description

All the lodash imports are now directed to the exact resource.

Todos

Screenshots

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fa6ca88

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mattwalo32

Copy link
Copy Markdown
Collaborator

Closes #584

@mattwalo32
mattwalo32 self-requested a review July 3, 2026 13:26
@mattwalo32

mattwalo32 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

The goal for this issue is to reduce the total bundle size of the client. Sometimes the webpage is loaded in locations that don't have great internet, so every byte helps. I ran pnpm run build and pnpm run analyze from apps/frontend to view the bundle size. On this PR, I see that the entire lodash library is still being imported:

image

The issue is this line in apps/frontend/src/utils/metadataUtils.ts:

import { camelCase } from 'lodash'

Can you change this to

import camcelCase from 'lodash/camelcase'

That will allow the build to drop the entire lodash library:

image

It saves about 50Kb in bundle size.

@Mujtaba1598

Mujtaba1598 commented Jul 7, 2026

Copy link
Copy Markdown
Author

The goal for this issue is to reduce the total bundle size of the client. Sometimes the webpage is loaded in locations that don't have great internet, so every byte helps. I ran pnpm run build and pnpm run analyze from apps/frontend to view the bundle size. On this PR, I see that the entire lodash library is still being imported:

image The issue is this line in `apps/frontend/src/utils/metadataUtils.ts`:
import { camelCase } from 'lodash'

Can you change this to

import camcelCase from 'lodash/camelcase'

That will allow the build to drop the entire lodash library:

image It saves about 50Kb in bundle size.

I had already started with the mongoose encryption changes on my local branch, and that is why I had to put this change in a separate pull request.

@mattwalo32 mattwalo32 closed this Jul 15, 2026
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.

3 participants