-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add guide for tree shaking in JavaScript #4900
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
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sentry/sentry-docs/8BUibRAVaoWhQo6YLdi2z2Zsbmp5 |
I think this might be important enough that we elevate to it's own page under https://docs.sentry.io/platforms/javascript/configuration/. What do you think? |
|
||
To mark any debug code as unused, we must replace debug flags in the sentry SDK with `false`. We outlined examples of how to do this in popular toolchains below. | ||
|
||
### Tree-shaking Debug Code with webpack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we hide these for the nextjs platform?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're right. For nextjs, only the nextjs config section makes sense. Updated in: 41391dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The writing here is solid! I've just made a number of edits to follow our style guide. Please ping me for review when you've made updates so I can give it another quick read.
Co-authored-by: Isabel <[email protected]>
@AbhiPrasad I would currently let it live under troubleshooting. When we figured out the tree shaking stuff a bit more (ie, shaking the tracing in next.js) it suddenly becomes a lot more important and I would consider moving it to its own page. |
The only consequence of this is that we would have to leave a link from the current location to the new one so that users do not get confused - IMO there's not much more to figure out, I'd rather just do it right the first time here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Nothing major on my end - mostly just wordsmithing.
Co-authored-by: Katie Byers <[email protected]>
In getsentry/sentry-javascript#4842 we made the JavaScript SDKs a little bit more tree-shakable.
We now want to explain users how to get rid of debug code if they don't want debug functionality in their code.
PR should not be merged before getsentry/sentry-javascript#4842 is released.
Ref: https://getsentry.atlassian.net/browse/WEB-772