-
Notifications
You must be signed in to change notification settings - Fork 134
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(rum-react)!: support react-router 6 #1410
Conversation
* If the path/name is given as array, use the computed path | ||
* to get the current transaction name | ||
*/ | ||
function getTransactionName(name, props) { |
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.
FYI, react-router 6 doesn't allow to define array paths
} | ||
|
||
export function getNumberOfUrlSegments(url) { | ||
return url.split('/').filter(currentSegment => currentSegment.length > 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.
React-router 6 doesn't allow defining a regex as a path. Splitting by /
is enough
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.
Did first pass. generally looks good. Waiting for the E2E tests to finalize the review.
6541d4a
to
458f480
Compare
458f480
to
84f9629
Compare
@@ -51,10 +63,13 @@ function App() { | |||
</li> | |||
</ul> | |||
<Suspense fallback={<div>Loading...</div>}> | |||
<Switch> |
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.
Is this file even required, given there is no switch functionality in the new router, I would be fine with deleting this part of the code.
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.
LGTM 🎉
c6f80ab
to
46d13d5
Compare
Related to: #1176
Summary
This PR makes it possible to instrument applications with react-router 6.
The API we expose will look like the following snippet:
All the routes defined within
<ApmRoutes>
will be instrumented.IMPORTANT:
This PR will not instrument the mechanism named RouteProvider and there are no plans to do so in the midterm.
Note:
E2E are still pending to finishreact-router 6 doesn't support IE11. - E2E tests for React will no longer be executed for that browser.