Skip to content

feat(nextjs): Make tracing package treeshakable - #5166

Merged
lforst merged 6 commits into
7.xfrom
lforst-treeshake-next-tracing
May 25, 2022
Merged

feat(nextjs): Make tracing package treeshakable#5166
lforst merged 6 commits into
7.xfrom
lforst-treeshake-next-tracing

Conversation

@lforst

@lforstlforst commented May 25, 2022

Copy link
Copy Markdown
Contributor

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 Lms24May 25, 2022 14:36
@github-actions

github-actionsBot commented May 25, 2022

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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% 🔽)

@Lms24Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work! 🚀 🚀

Comment threadpackages/tracing/test/index.test.ts Outdated
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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.xMay 25, 2022
@lforst
lforst deleted the lforst-treeshake-next-tracing branch May 25, 2022 15:26
@AbhiPrasadAbhiPrasad 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 freeto 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

@lforst@Lms24@AbhiPrasad