-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(react): Add support for cross-usage of React Router instrumentations #15283
base: develop
Are you sure you want to change the base?
Conversation
07b80f0
to
b4dfd0e
Compare
b2480b5
to
5f36173
Compare
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky tests
To view more test analytics, go to the Test Analytics Dashboard |
size-limit report 📦
|
186754b
to
24c7931
Compare
24c7931
to
4081708
Compare
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 change!
}, | ||
}); | ||
const activeSpan = getActiveSpan(); | ||
const isAlreadyInNavigationSpan = activeSpan && spanToJSON(activeSpan).op === 'navigation'; |
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.
Could we not also get that directly from the span?
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.
I think we can remove all server related code from this test
"express": "4.20.0", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"react-router-dom": "^6.28.0", |
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.
Wdyt about testing this one on v7?
This started to be an issue after we added support for descendant React Router routes.
React Router does not limit users to only one way to declare routes. Currently, we provide instrumentation for 3 ways of declaring RR routes:
useRoutes
Sentry.wrapUseRoutes
<Routes />
Sentry.withReactRouterRouting
createBrowserRouter
Sentry.wrapCreateBrowserRouter
createHashRouter
Sentry.wrapCreateBrowserRouter
createMemoryRouter
Sentry.wrapCreateMemoryRouter
When users decide to declare their routes using more than one of these options together, we risk losing context while rebuilding parameterised span names.
This PR adds: