-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(react): Avoid multiple name updates on navigation spans #17438
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
02e08c9
fix(react): Avoid multiple name updates on navigation spans
onurtemizkan 86f2aef
Update `activeSpan` instead of `rootSpan`
onurtemizkan 51dd07d
Reimplement
onurtemizkan 42365cb
Clean up
onurtemizkan b10e5b6
Move under folder
onurtemizkan 451daba
Add missing local exports
onurtemizkan 2b78f54
Move `getGlobalLocation` to utils
onurtemizkan 4dd2674
Return to `updateNavigationSpan`
onurtemizkan 6378a64
Add unit tests
onurtemizkan c46ee84
Reorder to minimize diff
onurtemizkan 453f5c6
Clean up more
onurtemizkan 60a9d7c
Introduce `isLikeLazyRouteContext`
onurtemizkan 7d51896
Merge branch 'develop' into onur/react-router-multiple-name-updates
chargome 93f8599
add comment for compat utils
chargome c54e779
refactor updatePageloadTransaction
chargome 6c7429b
use isThenable
chargome File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...es/e2e-tests/test-applications/react-router-7-lazy-routes/src/pages/AnotherLazyRoutes.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
export const anotherNestedRoutes = [ | ||
{ | ||
path: 'sub', | ||
children: [ | ||
{ | ||
index: true, | ||
element: ( | ||
<div id="another-lazy-route"> | ||
Another Lazy Route | ||
<Link to="/lazy/inner/999/888/777" id="navigate-to-inner"> | ||
Navigate to Inner Lazy Route | ||
</Link> | ||
</div> | ||
), | ||
}, | ||
{ | ||
path: ':id', | ||
children: [ | ||
{ | ||
index: true, | ||
element: <div id="another-lazy-route-with-id">Another Lazy Route with ID</div>, | ||
}, | ||
{ | ||
path: ':subId', | ||
element: ( | ||
<div id="another-lazy-route-deep"> | ||
Another Deep Lazy Route | ||
<Link to="/lazy/inner/111/222/333" id="navigate-to-inner-from-deep"> | ||
Navigate to Inner from Deep | ||
</Link> | ||
</div> | ||
), | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// These exports provide utility functions for React Router v6 compatibility (as of now v6 and v7) | ||
|
||
// Main exports from instrumentation | ||
export type { ReactRouterOptions } from './instrumentation'; | ||
export { | ||
createReactRouterV6CompatibleTracingIntegration, | ||
createV6CompatibleWithSentryReactRouterRouting, | ||
createV6CompatibleWrapCreateBrowserRouter, | ||
createV6CompatibleWrapCreateMemoryRouter, | ||
createV6CompatibleWrapUseRoutes, | ||
handleNavigation, | ||
handleExistingNavigationSpan, | ||
createNewNavigationSpan, | ||
addResolvedRoutesToParent, | ||
processResolvedRoutes, | ||
updateNavigationSpan, | ||
} from './instrumentation'; | ||
|
||
// Utility exports | ||
export { | ||
resolveRouteNameAndSource, | ||
getNormalizedName, | ||
initializeRouterUtils, | ||
isLikelyLazyRouteContext, | ||
locationIsInsideDescendantRoute, | ||
prefixWithSlash, | ||
rebuildRoutePathFromAllRoutes, | ||
pathEndsWithWildcard, | ||
pathIsWildcardAndHasChildren, | ||
getNumberOfUrlSegments, | ||
} from './utils'; | ||
|
||
// Lazy route exports | ||
export { createAsyncHandlerProxy, handleAsyncHandlerResult, checkRouteForAsyncHandler } from './lazy-routes'; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.