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

[no-Jira] Deduplicate frontend yarn packages #1197

Merged
merged 1 commit into from
Dec 3, 2024
Merged

[no-Jira] Deduplicate frontend yarn packages #1197

merged 1 commit into from
Dec 3, 2024

Conversation

canac
Copy link
Contributor

@canac canac commented Nov 15, 2024

Description

I hope this will decrease bundle sizes because emotion packages won't be included in the bundle multiple times anymore.

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@canac canac added the Preview Environment Add this label to create an Amplify Preview label Nov 15, 2024
@canac canac self-assigned this Nov 15, 2024
Copy link
Contributor

Preview branch generated at https://yarn-dedupe.d3dytjb8adxkk5.amplifyapp.com

Copy link
Contributor

Bundle sizes [mpdx-react]

Compared against 5f6646c

No significant changes found

@canac canac requested a review from dr-bizz November 15, 2024 21:21
@canac
Copy link
Contributor Author

canac commented Nov 15, 2024

@dr-bizz I guess this doesn't actually change the bundle sizes. I can close this if you think it's not worth doing.

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

How did you know it was duplicated, and then how did you remove it. Is there a yarn command?

@canac
Copy link
Contributor Author

canac commented Nov 18, 2024

How did you know it was duplicated, and then how did you remove it. Is there a yarn command?

@dr-bizz yarn dedupe --check will show you packages that can be deduplicated, and yarn dedupe will do the deduplication. For this PR I ran yarn dedupe '@emotion/*' '@mui/*' '@popper/*' to only deduplicate packages that look like they are used on the frontend. Most of the duplicates appear to come from dev dependencies and aren't included in the client bundle.

@canac
Copy link
Contributor Author

canac commented Dec 2, 2024

@dr-bizz Did you have any more thoughts on this? The change in bundle size isn't enough to trigger the bundle analyzer comment, but it goes down by 235 bytes for _app.js and about 300 additional bytes for the flows/setup and fixCommittmentInfo pages.

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

You are fine to merge this, even if it doesn't change that much

@canac canac merged commit 80ef0ab into main Dec 3, 2024
19 checks passed
@canac canac deleted the yarn-dedupe branch December 3, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants