Replies: 1 comment 1 reply
-
yes, must be pure. rewrites can happen a lot (link building for example) please share more details what you want to log here using a complete minimal reproducer project |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to capture an analytics event (Sentry breadcrumb) whenever a legacy redirect fires.
Two questions:
Is the rewrite input function expected to be pure (no side effects beyond URL mutation)?
The docs show it mutating the URL object, but it's unclear whether side effects like logging or analytics calls are safe here .
What's the recommended pattern for observing rewrites? Should I:
Fire the side effect directly inside input (simplest, but couples concerns)
Use a router event/hook like router.subscribe('onResolved', ...) and detect that a rewrite occurred
Something else entirely?
Appreciate any guidance on the intended contract for rewrite functions.
Beta Was this translation helpful? Give feedback.
All reactions