Uh oh!
There was an error while loading. Please reload this page.
fix(react): Add support for cross-usage of React Router instrumentations - #15283
Conversation
07b80f0 to
b4dfd0eCompareb2480b5 to
5f36173Compare❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
size-limit report 📦
|
186754b to
24c7931Compare24c7931 to
4081708Compare| }, | ||
| }); | ||
| const activeSpan = getActiveSpan(); | ||
| const isAlreadyInNavigationSpan = activeSpan && spanToJSON(activeSpan).op === 'navigation'; |
There was a problem hiding this comment.
Could we not also get that directly from the span?
There was a problem hiding this comment.
Looking at the rest of the uses in the repo, I think op is obtained like this. Could not see a way to get it directly from the span.
There was a problem hiding this comment.
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.
Wdyt about testing this one on v7?
onurtemizkan
commented
Feb 24, 2025
Thanks for the review, and sorry for the late updates @chargome. |
AbhiPrasad
commented
Feb 25, 2025
I caused a merge conflict for this 😅 - sorry about that! Should be easy to rebase though. |
9fcb54f to
88fac09Compare
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:
useRoutesSentry.wrapUseRoutes<Routes />Sentry.withReactRouterRoutingcreateBrowserRouterSentry.wrapCreateBrowserRoutercreateHashRouterSentry.wrapCreateBrowserRoutercreateMemoryRouterSentry.wrapCreateMemoryRouterWhen 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: