Skip to content

feat(browser): Export BrowserTracing from package #7366

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

Closed
wants to merge 12 commits into from

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Mar 7, 2023

closes #7342

Building on the work in #7345, this PR exports BrowserTracing from the @sentry/browser package.

This means performance monitoring for the browser now looks like so:

import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: "__DSN__",
  tracesSampleRate: 1.0,
  integrations: [new Sentry.BrowserTracing()]
});

If you don't want to use BrowserTracing, you'll have to add the tracing extensions yourself:

import * as Sentry from '@sentry/browser';

Sentry.addTracingExtensions();

Sentry.init({
  dsn: "__DSN__",
  tracesSampleRate: 1.0,
});

@AbhiPrasad AbhiPrasad requested review from a team, mydea and lforst and removed request for a team March 7, 2023 11:57
@@ -115,7 +115,8 @@
"typescript": "3.8.3"
},
"resolutions": {
"**/agent-base": "5"
"**/agent-base": "5",
"**/jest-resolve": "29.5.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

Have to bump this so that we get around jestjs/jest#9771, which requires Jest >= 28

@AbhiPrasad
Copy link
Member Author

One day I'll merge this

and it will be glorious!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.89 KB (+3.81% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 62.24 KB (-0.5% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.62 KB (+4.6% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55.32 KB (-0.38% 🔽)
@sentry/browser - Webpack (gzipped + minified) 20.56 KB (+0.29% 🔺)
@sentry/browser - Webpack (minified) 62.32 KB (-6.98% 🔽)
@sentry/react - Webpack (gzipped + minified) 20.6 KB (+0.36% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.48 KB (-1.5% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.27 KB (+3.94% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 26.75 KB (+5.07% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 44.41 KB (+3.14% 🔺)
@sentry/replay - Webpack (gzipped + minified) 37.55 KB (+1.22% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 62.84 KB (+3.36% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 55.87 KB (+3.1% 🔺)

@AbhiPrasad
Copy link
Member Author

Closing this because it will break webpack 4 :(

We can only make this change in v8.

@AbhiPrasad AbhiPrasad closed this Mar 7, 2023
@AbhiPrasad AbhiPrasad deleted the abhi-browser-tracing-in-browser branch March 7, 2023 16:39
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.

Move BrowserTracing to @sentry/browser
3 participants