[RUM-15578] ✨ Add TanStack Router integration to browser-rum-react#4414
[RUM-15578] ✨ Add TanStack Router integration to browser-rum-react#4414amortemousque merged 9 commits intomainfrom
Conversation
Bundles Sizes Evolution
🚀 CPU PerformancePending... 🧠 Memory PerformancePending... |
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 41a093d | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 104ca14a4d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
fb14d64 to
cdf4d05
Compare
Co-Authored-By: Roman Gaignault <roman.gaignault@datadoghq.com> Co-Authored-By: Aymeric Mortemousque <aymeric.mortemousque@datadoghq.com>
2fecbd2 to
03ae2c8
Compare
03ae2c8 to
676db07
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 676db075e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| router.subscribe('onLoad', (event) => { | ||
| if (!event.pathChanged) { | ||
| return | ||
| } | ||
| startTanStackRouterView(router.state.matches) |
There was a problem hiding this comment.
Start views before loader work begins
Using router.subscribe('onLoad', ...) delays startTanStackRouterView until after TanStack Router has finished route loading, so fetches/errors triggered by route loader functions during navigation are attached to the previous view instead of the destination view. In apps that rely on loaders for data fetching, this produces incorrect per-view RUM attribution and can skew view-level metrics.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Discussed with Aymeric, I think this is acceptable. Tanstack Mantainer used onResolved.
BeltranBulbarellaDD
left a comment
There was a problem hiding this comment.
LGTM, I'll work on adding the basePlugin tests so we have better e2e coverage
03a3589 to
bc6cbbe
Compare
bc6cbbe to
d64ef3a
Compare
37645e6 to
153900a
Compare
Design for a fully automated Claude Code skill pipeline that generates draft Browser SDK router integration PRs from framework public docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Updated spec: skills use separate subdirectories (SKILL.md per dir) - Plan covers 7 tasks: orchestrator + 5 stage skills + validation - Each task has step-by-step instructions with exact file paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Motivation
TanStack Router is increasingly popular as a React Router replacement. Users have been requesting built-in support (see #3174), and a TanStack Router maintainer has already shared a manual implementation. This PR adds first-class TanStack Router support as a sub-entry of
@datadog/browser-rum-react.Changes
New sub-entry:
@datadog/browser-rum-react/tanstack-routercreateRouterwrapper that subscribes toonLoadevents and starts a new RUM view on each path changematch.fullPath(e.g.,/posts/$postId)event.pathChanged/files/$) substituted with actual matched pathTest app and E2E:
Compatibility:
createRouterdependency in Chrome 63 (BrowserStack)Usage:
Test instructions
yarn test:unit --spec packages/rum-react/src/domain/tanstackRouter yarn test:e2e -g "tanstack"Checklist