Skip to content

Conversation

@logaretm
Copy link
Collaborator

What

A PR to go in tandem with getsentry/sentry-javascript#18359 once it gets merged and released.

It documents the new tree-shaking options now abstracted away into webpack.treeshake namespace. It has a few differences to the existing tree-shaking flags under the hood:

  • All options are optimized to be set to true to take effect, unlike the flags where some had to be set to true and some had to be set to false.
  • Now exposed as an SDK webpack.treeshake build options rather than needing the user to be aware of the webpack define plugin API.

Marking it as a draft to avoid merging it before the PR goes live.

@linear
Copy link

linear bot commented Dec 11, 2025

@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sentry-docs Ready Ready Preview, Comment Dec 17, 2025 2:08pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
develop-docs Ignored Ignored Preview Dec 17, 2025 2:08pm

logaretm and others added 4 commits December 16, 2025 22:22
Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
Copy link
Collaborator

@inventarSarah inventarSarah left a comment

Choose a reason for hiding this comment

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

👍
Added some suggestions


<SdkOption name="webpack.treeshake.removeDebugLogging" type="boolean" defaultValue="false">

Setting this option to `true` will remove all debug logging code from the Sentry SDK. Note that it has nothing to do with `enableLogs` or Sentry's logs product.
Copy link
Collaborator

Choose a reason for hiding this comment

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

These two sentences are a bit confusing to me -- which logs does it concern?

Copy link
Collaborator Author

@logaretm logaretm Dec 17, 2025

Choose a reason for hiding this comment

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

It's a bit tricky 😅, so ... we have those DEBUG logs that show up when the user has debug: true but they aren't removed from the bundle.

So this option is supposed to remove them from the bundle, but we have a logs product enabled by enableLogs on the SDK configuration (not build options), so this is basically trying to avoid that very confusion, that it doesn't affect the logs product and it only affect those DEBUG statements.

What do you think we could do here to explain that? this has been always a confusion point for many users.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Something like this, maybe?

Setting this option to true will remove all Sentry SDK debug logging code (the console logs that appear when you set debug: true in your SDK configuration). This doesn't affect Sentry's Logs product (controlled by the enableLogs option) or your app's logging.

Copy link
Collaborator Author

@logaretm logaretm Dec 17, 2025

Choose a reason for hiding this comment

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

Yea, I think the console mention here nails it. Thanks! Pushed it!

logaretm and others added 14 commits December 17, 2025 14:19
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Copy link
Collaborator

@inventarSarah inventarSarah left a comment

Choose a reason for hiding this comment

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

💫nice!

Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
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