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

feat(nextjs): Make tracing package treeshakable #5166

Merged
merged 6 commits into from
May 25, 2022

Conversation

lforst
Copy link
Member

@lforst lforst commented May 25, 2022

Makes @sentry/tracing treeshakable from @sentry/nextjs, by text-replacing __SENTRY_TRACING__ with false in any bundler or pre-processor.

Ref: https://getsentry.atlassian.net/browse/WEB-713

@lforst lforst requested a review from Lms24 May 25, 2022 14:36
@github-actions
Copy link
Contributor

github-actions bot commented May 25, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.36 KB (-3.86% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 60.05 KB (-7.06% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.21 KB (-3.46% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 53.67 KB (-7.43% 🔽)
@sentry/browser - Webpack (gzipped + minified) 19.92 KB (-14.26% 🔽)
@sentry/browser - Webpack (minified) 63.13 KB (-22.75% 🔽)
@sentry/react - Webpack (gzipped + minified) 19.95 KB (-14.31% 🔽)
@sentry/nextjs Client - Webpack (gzipped + minified) 43.74 KB (-8.99% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.38 KB (-2.66% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 23.92 KB (-2.31% 🔽)

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.

Nice work! 🚀 🚀

@@ -12,6 +12,11 @@ describe('index', () => {
describe('Integrations', () => {
it('is exported correctly', () => {
Object.keys(Integrations).forEach(key => {
// Skip BrowserTracing because it doesn't have a static id field.
if (key !== 'BrowserTracing') {
Copy link
Member

Choose a reason for hiding this comment

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

This should be the other way round, right?

Suggested change
if (key !== 'BrowserTracing') {
if (key === 'BrowserTracing') {

Copy link
Member Author

Choose a reason for hiding this comment

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

yup thanks 😄

@lforst lforst merged commit 2b36cab into 7.x May 25, 2022
@lforst lforst deleted the lforst-treeshake-next-tracing branch May 25, 2022 15:26
@AbhiPrasad AbhiPrasad added this to the 7.0.0 milestone May 30, 2022
mydea added a commit that referenced this pull request Apr 4, 2023
This was removed in #5166 due to tree shaking concerns, however we have had a static ID for replay and it has been working fine so far.
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