René's URL Explorer Experiment


Title: feat(react): Add `lazyRouteManifest` option to resolve lazy-route names by onurtemizkan · Pull Request #19086 · getsentry/sentry-javascript · GitHub

Open Graph Title: feat(react): Add `lazyRouteManifest` option to resolve lazy-route names by onurtemizkan · Pull Request #19086 · getsentry/sentry-javascript

X Title: feat(react): Add `lazyRouteManifest` option to resolve lazy-route names by onurtemizkan · Pull Request #19086 · getsentry/sentry-javascript

Description: This PR will resolve the core reason for the series of fixes / handling for automatic lazy-route resolution for a while. Related: #18898, #18881, #18346, #18155, #18098, #17962, #17867, #17438, #17277 The core issue we have been trying to tackle is not having access to the complete route hierarchy when asynchronously loaded lazy routes are used. React Router provides a route manifest that we can use while matching parameterized transaction names with routes in all cases except this lazy-routes pattern. This problem has been discussed on React Router: remix-run/react-router#11113 While this has been addressed for Remix / React Router (Framework Mode), it's still not available in Library Mode. The manifest contains the lazily-loaded route, only when it's navigated to. While waiting for navigation, our transactions can be dropped for several reasons, such as user behaviour like switching tabs (document.hidden guard), hitting timeouts like idleTimeout, and potentially other reasons. This results in incomplete transaction naming with leftover wildcards, which caused broken aggregation on the Sentry dashboard. The series of attempts to fix this while keeping automatic route discovery has been prone to race conditions and required special-case handling of each edge case scenario, also requiring a considerable amount of internal logic, affecting our readability and performance. At the end, all failed in giving completely robust and deterministic results on the customers' side. This PR proposes a new option: lazyRouteManifest specifically for lazy routes. This will let us have initial information about the route hierarchy. So we can assign correct parameterized transaction names without needing to wait for navigated state. It's a static array of routes in parameterized format (needs to be maintained by the users on route hierarchy updates) like: Sentry.reactRouterV7BrowserTracingIntegration({ // ... enableAsyncRouteHandlers: true lazyRouteManifest: [ '/', '/pricing', '/features', '/login', '/signup', '/forgot-password', '/reset-password/:token', '/org/:orgSlug', '/org/:orgSlug/dashboard', '/org/:orgSlug/projects', '/org/:orgSlug/projects/:projectId', '/org/:orgSlug/projects/:projectId/settings', '/org/:orgSlug/projects/:projectId/issues', '/org/:orgSlug/projects/:projectId/issues/:issueId', '/org/:orgSlug/team', '/org/:orgSlug/team/:memberId', '/org/:orgSlug/settings', '/org/:orgSlug/billing', '/admin', '/admin/users', '/admin/users/:userId', '/admin/orgs', '/admin/orgs/:orgId', ], }) This will only be active when enableAsyncRouteHandlers is set to true To match URLs with given routes, we mimic React Router's own implementation. When this is not provided or fails, it falls back to the current behaviour This manifest is primarily for lazy routes, but the users can also add their non-lazy routes here for convenience or consistency. Also added E2E tests that will fail when (if at some point) React Router manifests include the lazy routes before navigation, so we'll be aware and plan depending on that manifest instead. We can do a cleanup for the race-condition / edge-case handling part of the code in a follow-up PR. Closes #19090 (added automatically)

Open Graph Description: This PR will resolve the core reason for the series of fixes / handling for automatic lazy-route resolution for a while. Related: #18898, #18881, #18346, #18155, #18098, #17962, #17867, #17438, #17...

X Description: This PR will resolve the core reason for the series of fixes / handling for automatic lazy-route resolution for a while. Related: #18898, #18881, #18346, #18155, #18098, #17962, #17867, #17438, #17...

Opengraph URL: https://github.com/getsentry/sentry-javascript/pull/19086

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4364988a-bbe0-1294-641d-fc7e09ea233d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC9E8:32E761:5C5554:7D0281:6B044061
html-safe-nonce62c77128a4a564fa9e3d8db623d1e9645606f526655c6fe733bf497b4c379842
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUU4OjMyRTc2MTo1QzU1NTQ6N0QwMjgxOjZCMDQ0MDYxIiwidmlzaXRvcl9pZCI6IjI5MDE5MDI2MDUzMjIzMDU2MzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac100257f1bbb28b493f3401ddd892d16726f399bf3f5e4114d75447cf5821553e
hovercard-subject-tagpull_request:3223813855
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/getsentry/sentry-javascript/pull/19086/files
twitter:imagehttps://avatars.githubusercontent.com/u/4020638?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4020638?s=400&v=4
og:image:altThis PR will resolve the core reason for the series of fixes / handling for automatic lazy-route resolution for a while. Related: #18898, #18881, #18346, #18155, #18098, #17962, #17867, #17438, #17...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/pull/19086/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fpull%2F19086%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fpull%2F19086%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/pull/19086/files
Reloadhttps://github.com/getsentry/sentry-javascript/pull/19086/files
Reloadhttps://github.com/getsentry/sentry-javascript/pull/19086/files
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests54 (54)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgetsentry%2Fsentry-javascript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgetsentry%2Fsentry-javascript%2Fissues%2Fnew%2Fchoose
onurtemizkanhttps://github.com/onurtemizkan
develophttps://github.com/getsentry/sentry-javascript/tree/develop
onur/react-router-lazy-manifest-optionhttps://github.com/getsentry/sentry-javascript/tree/onur/react-router-lazy-manifest-option
Conversation 14 https://github.com/getsentry/sentry-javascript/pull/19086
Commits 6 https://github.com/getsentry/sentry-javascript/pull/19086/commits
Checks 105 https://github.com/getsentry/sentry-javascript/pull/19086/checks
Files changed https://github.com/getsentry/sentry-javascript/pull/19086/files
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/19086/files
feat(react): Add lazyRouteManifest option to resolve lazy-route names https://github.com/getsentry/sentry-javascript/pull/19086/files#top
Show all changes 6 commits https://github.com/getsentry/sentry-javascript/pull/19086/files
690c3af feat(react): Add `lazyRouteManifest` option to resolve lazy-route names onurtemizkan Jan 29, 2026 https://github.com/getsentry/sentry-javascript/pull/19086/commits/690c3afd3d93479e419192c0080ca6b5c8742572
f7bdfda Deduplicate basename stripping, remove unused export onurtemizkan Feb 6, 2026 https://github.com/getsentry/sentry-javascript/pull/19086/commits/f7bdfda06a112ce23fe6984ec90e38bc08a384af
ee32afd Make `_stripBasename` consistent onurtemizkan Feb 6, 2026 https://github.com/getsentry/sentry-javascript/pull/19086/commits/ee32afdea1d2eec54745db071d73707ac3615983
36f900f Use for-of loops in route manifest pattern matching onurtemizkan Feb 10, 2026 https://github.com/getsentry/sentry-javascript/pull/19086/commits/36f900f83d1b0cd9e4eeab85e3641528473c5a8d
2a5fdac Align route manifest specificity sorting with React Router onurtemizkan Feb 10, 2026 https://github.com/getsentry/sentry-javascript/pull/19086/commits/2a5fdac0bf330a126301fe10a3bfef1485cd5cb8
dbf6602 Align route manifest scoring with React Router's computeScore algorithm onurtemizkan Feb 10, 2026 https://github.com/getsentry/sentry-javascript/pull/19086/commits/dbf66027a292be46173d841459f69658f8f4d5e2
Clear filters https://github.com/getsentry/sentry-javascript/pull/19086/files
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/19086/files
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/19086/files
index.tsx https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-51c2b4920740d32962ea31d0967fa17da2d44e6c60ec98c8ca170081691fe0d4
react-router-manifest.test.ts https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-acfb45ba9ae4ce577b79cbaad03b60dac27ca6ec683b7eb3fe2db7aa3c218846
transactions.test.ts https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-f4e29f14b5f2c8e353c41138a49f1150d9ee495f1b609a86fa88fb93e1f6c418
instrumentation.tsx https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
route-manifest.ts https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-42174962248722cd00413d1d5de1c923b03870ddf35c7c2e1955d66efa7397f0
utils.ts https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-c3ffa8bba8d8fd12d0a62f08b108a7600f7105ad2c930242c2cc2a1ef37b560e
route-manifest.test.ts https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-809d33bfd7d3ccc8f9297c0c26a83296bc502e8e479daba580fb399ab93245be
dev-packages/e2e-tests/test-applications/react-router-7-lazy-routes/src/index.tsxhttps://github.com/getsentry/sentry-javascript/pull/19086/files#diff-51c2b4920740d32962ea31d0967fa17da2d44e6c60ec98c8ca170081691fe0d4
View file https://github.com/getsentry/sentry-javascript/blob/dbf66027a292be46173d841459f69658f8f4d5e2/dev-packages/e2e-tests/test-applications/react-router-7-lazy-routes/src/index.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-javascript/pull/19086/{{ revealButtonHref }}
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-51c2b4920740d32962ea31d0967fa17da2d44e6c60ec98c8ca170081691fe0d4
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-51c2b4920740d32962ea31d0967fa17da2d44e6c60ec98c8ca170081691fe0d4
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-51c2b4920740d32962ea31d0967fa17da2d44e6c60ec98c8ca170081691fe0d4
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-51c2b4920740d32962ea31d0967fa17da2d44e6c60ec98c8ca170081691fe0d4
...2e-tests/test-applications/react-router-7-lazy-routes/tests/react-router-manifest.test.tshttps://github.com/getsentry/sentry-javascript/pull/19086/files#diff-acfb45ba9ae4ce577b79cbaad03b60dac27ca6ec683b7eb3fe2db7aa3c218846
View file https://github.com/getsentry/sentry-javascript/blob/dbf66027a292be46173d841459f69658f8f4d5e2/dev-packages/e2e-tests/test-applications/react-router-7-lazy-routes/tests/react-router-manifest.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-javascript/pull/19086/{{ revealButtonHref }}
...ackages/e2e-tests/test-applications/react-router-7-lazy-routes/tests/transactions.test.tshttps://github.com/getsentry/sentry-javascript/pull/19086/files#diff-f4e29f14b5f2c8e353c41138a49f1150d9ee495f1b609a86fa88fb93e1f6c418
View file https://github.com/getsentry/sentry-javascript/blob/dbf66027a292be46173d841459f69658f8f4d5e2/dev-packages/e2e-tests/test-applications/react-router-7-lazy-routes/tests/transactions.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-javascript/pull/19086/{{ revealButtonHref }}
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-f4e29f14b5f2c8e353c41138a49f1150d9ee495f1b609a86fa88fb93e1f6c418
packages/react/src/reactrouter-compat-utils/instrumentation.tsxhttps://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
View file https://github.com/getsentry/sentry-javascript/blob/dbf66027a292be46173d841459f69658f8f4d5e2/packages/react/src/reactrouter-compat-utils/instrumentation.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/getsentry/sentry-javascript/pull/19086/{{ revealButtonHref }}
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
https://github.com/getsentry/sentry-javascript/pull/19086/files#diff-d360c2bb0dad387e381cabce936d5d11e96774123adb97c6759d3a33a0aa3c94
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/19086/files
Please reload this pagehttps://github.com/getsentry/sentry-javascript/pull/19086/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.