feat(tanstackstart-react): Add server-side route parametrization#21147
Merged
Conversation
s1gr1d
approved these changes
May 26, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 59c5638. Configure here.
Extracts route patterns from routeTree.gen.ts at build time and matches URLs at runtime to parametrize server transaction names (e.g., `GET /users/123` becomes `GET /users/$id`). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… properties Nested routes have relative `path:` values (e.g., `/$userId`) but the `fullPaths` type union has the resolved full paths (e.g., `/users/$userId`). Also handles multi-line union format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies that /users/123 is correctly parametrized to GET /users/$userId, covering the nested route case where path: values are relative. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
A bare `$` segment matches multiple path segments (e.g., `/files/$` matches `/files/a/b/c`). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The pattern list is static at build time. Sort once and compile regexes once instead of on every request. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… sort Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Assert transaction_info.source is 'route' on all tests - Assert client-side parametrization on page and nested routes - Add API route parametrization test - Remove redundant static route unit test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…vailable Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sorting now happens once in extractRoutePatterns instead of on every request. Also adds getCurrentScope().setTransactionName() so errors captured during a request get the parametrized name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TanStack Router's generator has a quoteStyle config that can be set to "double". The regex now matches both single and double quotes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1932bb8 to
a6f5a11
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Server transactions now use parametrized route names instead of raw URLs.
GET /users/123becomesGET /users/$id, fixing high-cardinality transaction grouping.The framework provides no way to do this natively, so this is implemented using a build manifest approach that should hopefully work in most cases. Route patterns are extracted from
routeTree.gen.tsat build time and presorted by number of static/dynamic segments, then matched against request URLs at runtime inwrapFetchWithSentry.Closes #18284