-
Notifications
You must be signed in to change notification settings - Fork 27k
fix(router): Respect custom UrlSerializer handling of query parameters
#64449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8f36ff9 to
6e5e777
Compare
Previously, query parameters passed to `router.createUrlTree` were simply converted to strings. This meant that any custom serialization logic in a custom `UrlSerializer` was not applied. This could lead to inconsistencies between navigations triggered from the URL bar (which are parsed by the serializer) and navigations triggered programmatically. This change ensures that query parameters are normalized using the provided `UrlSerializer`. The values are serialized and then parsed to ensure they are in the same format as if they had come from a URL. This allows custom serializers to handle complex objects in query parameters consistently. Fixes angular#47307
6e5e777 to
5a94154
Compare
|
Targeting major and marking risky despite the green TGP. |
thePunderWoman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
reviewed-for: fw-general, public-api
|
This PR was merged into the repository. The changes were merged into the following branches:
|
… parameters (angular#64449)" This reverts commit 46ae034.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Previously, query parameters passed to
router.createUrlTreewere simply converted to strings. This meant that any custom serialization logic in a customUrlSerializerwas not applied. This could lead to inconsistencies between navigations triggered from the URL bar (which are parsed by the serializer) and navigations triggered programmatically.This change ensures that query parameters are normalized using the provided
UrlSerializer. The values are serialized and then parsed to ensure they are in the same format as if they had come from a URL. This allows custom serializers to handle complex objects in query parameters consistently.Fixes #47307