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

fix(build): Ensure tree shaking works properly for ESM output #11122

Merged
merged 4 commits into from Mar 15, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Mar 15, 2024

Apparently, webpack looks at sideEffects in the generated package.json, and based on this does not tree shake correctly 😬

I also bumped webpack (one of the things I tried while debugging this...).

This now puts the original sideEffects value from the original package.json and puts it into the esm package.json.

@mydea mydea self-assigned this Mar 15, 2024
Copy link
Contributor

github-actions bot commented Mar 15, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) 82.29 KB (added)
@sentry/browser (incl. Tracing, Replay) 73.62 KB (added)
@sentry/browser (incl. Tracing, Replay with Canvas) 77.43 KB (added)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.17 KB (added)
@sentry/browser (incl. Tracing) 38.25 KB (added)
@sentry/browser (incl. browserTracingIntegration) 38.25 KB (added)
@sentry/browser (incl. feedbackIntegration) 33.11 KB (added)
@sentry/browser (incl. feedbackModalIntegration) 33.2 KB (added)
@sentry/browser (incl. feedbackScreenshotIntegration) 33.21 KB (added)
@sentry/browser (incl. sendFeedback) 29.17 KB (added)
@sentry/browser 24.35 KB (added)
CDN Bundle (incl. Tracing, Replay, Feedback) 76.62 KB (added)
CDN Bundle (incl. Tracing, Replay) 71.48 KB (added)
CDN Bundle (incl. Tracing) 37.82 KB (added)
CDN Bundle 25.68 KB (added)
CDN Bundle (incl. Tracing, Replay) - uncompressed 224.12 KB (added)
CDN Bundle (incl. Tracing) - uncompressed 114.06 KB (added)
CDN Bundle - uncompressed 75.9 KB (added)
@sentry/react (incl. Tracing, Replay) 73.61 KB (added)
@sentry/react 24.37 KB (added)

Apparently, webpack looks at `sideEffects` in the generated package.json, and based on this does not tree shake correctly :grimace:
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Interesting!

@mydea mydea enabled auto-merge (squash) March 15, 2024 11:29
@mydea mydea merged commit d2005ba into develop Mar 15, 2024
89 checks passed
@mydea mydea deleted the fn/fix-treeshaking branch March 15, 2024 11:34
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
…try#11122)

Apparently, webpack looks at `sideEffects` in the generated
package.json, and based on this does not tree shake correctly 😬

I also bumped webpack (one of the things I tried while debugging
this...).

This now puts the original `sideEffects` value from the original
`package.json` and puts it into the esm package.json.
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.

None yet

3 participants