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(react): Add reactRouterV4/V5BrowserTracingIntegration for react router v4 & v5 #10488

Merged
merged 4 commits into from Feb 5, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 5, 2024

This adds new reactRouterV4BrowserTracingIntegration() and reactRouterV5BrowserTracingIntegration() exports, deprecating these old routing instrumentations.

I opted to leave as much as possible as-is for now, except for streamlining the attributes/tags we use for the instrumentation.

Tests lifted from #10430

This adds new `browserTracingReactRouterV4Integration()` and `browserTracingReactRouterV5Integration()` exports, deprecating these old routing instrumentations.

I opted to leave as much as possible as-is for now, except for streamlining the attributes/tags we use for the instrumentation.
Copy link
Contributor

github-actions bot commented Feb 5, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 78.2 KB (0%)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 69.43 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 73.36 KB (0%)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 63.04 KB (0%)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 33.38 KB (0%)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 33.25 KB (0%)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.33 KB (0%)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.34 KB (0%)
@sentry/browser - Webpack (gzipped) 22.6 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 76.17 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.72 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33.5 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.66 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 213.68 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 101.49 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 74.01 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.63 KB (0%)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 69.8 KB (0%)
@sentry/react - Webpack (gzipped) 22.63 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 87.42 KB (0%)
@sentry/nextjs Client - Webpack (gzipped) 51.57 KB (0%)
@sentry-internal/feedback - Webpack (gzipped) 17.21 KB (0%)

@mydea mydea changed the title feat(react): Add browserTracingIntegrations for router v4 & v5 feat(react): Add browserTracingIntegration for react router v4 & v5 Feb 5, 2024
Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

Lgtm! Cleaning this stuff up is gonna be hella satisfying.

Comment on lines 15 to 16
browserTracingReactRouterV4Integration,
browserTracingReactRouterV5Integration,
Copy link
Member

@lforst lforst Feb 5, 2024

Choose a reason for hiding this comment

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

Idk if this makes sense but reactRouterV5BrowserTracingIntegration would sound better to me. Any reason you chose this order? ^^

@mydea mydea changed the title feat(react): Add browserTracingIntegration for react router v4 & v5 feat(react): Add reactRouterV4/V5BrowserTracingIntegration for react router v4 & v5 Feb 5, 2024
@@ -184,3 +285,22 @@ export function withSentryRouting<P extends Record<string, any>, R extends React
return WrappedRoute;
}
/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */

function getActiveRootSpan(): Span | undefined {
Copy link
Member

Choose a reason for hiding this comment

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

might be worth lifting this utility out

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, but here it's a bit special because it also takes the activeTransaction into consideration!

@mydea mydea merged commit ef9196b into develop Feb 5, 2024
43 checks passed
@mydea mydea deleted the fn/react-router-v4-v5 branch February 5, 2024 16:37
mydea added a commit that referenced this pull request Feb 6, 2024
There is a proper replacement for all of them now.

Depends on:

* #10491
* #10489
* #10488
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.

None yet

3 participants