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

ref: Build to ESM for tree shaking #117

Merged
merged 6 commits into from
Feb 14, 2025

Conversation

spalmurray-codecov
Copy link
Collaborator

@spalmurray-codecov spalmurray-codecov commented Feb 14, 2025

This PR changes updates our webpack config to use ESM instead of CJS modules so we can actually do tree shaking. The reason for this is our extension failed Chrome's review process due to some third party script loading code from the Sentry SDK. We don't actually use this code and it should be removed from our bundle with tree shaking.

@spalmurray-codecov spalmurray-codecov changed the title ref: Compile to ESM for tree shaking ref: Build to ESM for tree shaking Feb 14, 2025
@spalmurray-codecov spalmurray-codecov marked this pull request as ready for review February 14, 2025 19:52
Copy link

codecov bot commented Feb 14, 2025

Bundle Report

Changes will decrease total bundle size by 688.18kB (-52.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
codecov-browser-extension-array-push 635.29kB -688.18kB (-52.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: codecov-browser-extension-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
vendor.js -362.48kB 380.95kB -48.76%
background.js -319.78kB 197.59kB -61.81%
popup.js -2.5kB 25.91kB -8.79%
githubFile.js -1.99kB 9.92kB -16.71%
githubPR.js -1.44kB 5.21kB -21.61%

Files in vendor.js:

  • ./src/content/github/common/constants.ts → Total Size: 472 bytes

ajay-sentry
ajay-sentry previously approved these changes Feb 14, 2025
Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

looks good!

@spalmurray-codecov spalmurray-codecov merged commit 5513811 into main Feb 14, 2025
3 checks passed
@spalmurray-codecov spalmurray-codecov deleted the spalmurray/fix-tree-shaking branch February 14, 2025 20:37
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