feat(react-start-api-routes): Write the matched route path as unenumerable to request object#3607
Conversation
…rable to request object
|
@lforst , just an FYI there will likely be tanstack start for multiple frameworks, in case the sentry sdk is react-specific you might want to add |
|
for API route I hope we have a single package in the future. w.r.t. to the sentry integration: I think it would make sense to offer a generic customization point where sentry could hook in. then this request tag would solely live in e.g. sentry |
That's a great point. I somehow missed that tss will be generic. I'll publish a package with an updated name. Thanks! |
That's dope 👌
Just gauging interest in this change in general, would it make sense to add this interim until there is a proper public API? I would be like 0% mad if you all decide to break this change when you switch over to a generic customization. I am also happy to add a hook somewhere if you give me some guidance on how you would want it to look like 😄 This is kinda super duper mission critical for Sentry so I am happy to sacrifice some time on this. |
@lforst the future is now. |
|
Noice. How shall we proceed here? |
|
This PR would have to be rebased, so the change is applied instead to the shared start-api-routes package |
…parameterized-route-on-request
rebased 👍 |
|
View your CI Pipeline Execution ↗ for commit 43ad644.
☁️ Nx Cloud last updated this comment at |
|
we'll be adding middleware support for API routes which should cover this use case |
Is there a timeline for that? |
|
Discussed on Discord w/ @schiller-manuel that this change will likely become obsolete with global api middlewares. |
This comes a bit out of nowhere but I am currently building the official Sentry SDK for TSStart and one thing that is really important for tracing/spans/opentelemetry is being able to group stuff by the parameterized route.
I haven't found a nice way in the public API yet to allow reading the parameterized route in a central location that doesn't require users to wrap every single route they create.
This is probably a bit of a hack but it seemed unintrusive enough for me (since it is unenumerable) and is getting the job done wonderfully.