-
Notifications
You must be signed in to change notification settings - Fork 25.8k
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
fix(router): Update Navigation#initialUrl
to match documentation and reality
#43863
Conversation
c21a2f8
to
5748e6c
Compare
5748e6c
to
0dd6b3d
Compare
0dd6b3d
to
faa8d9c
Compare
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.
Reviewed-for: public-api
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.
Reviewed-for: public-api
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: public-api
…d reality BREAKING CHANGE: * The type of `initialUrl` is set to `string|UrlTree` but in reality, the `Router` only sets it to a value that will always be `UrlTree` * `initialUrl` is documented as "The target URL passed into the `Router#navigateByUrl()` call before navigation" but the value actually gets set to something completely different. It's set to the current internal `UrlTree` of the Router at the time navigation occurs. With this change, there is no exact replacement for the old value of `initialUrl` because it was enver intended to be exposed. `Router.url` is likely the best replacement for this. In more specific use-cases, tracking the `finalUrl` between successful navigations can also be used as a replacement.
faa8d9c
to
cfbca2a
Compare
@atscott Is this ready for merge? Just asking since it looks green, but is not marked for merge. |
@dylhunn It's pending one change in g3 that I think could break with this change (even though there's no test that fails) |
@atscott Sounds good, looks like that g3 change was just submitted! |
caretaker note: please merge and sync on its own. While TGP was green and uses of |
Thanks Andrew, I'll merge this afternoon and sync separately tomorrow morning. |
This PR was merged into the repository by commit 64f837d. |
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. |
…d reality (angular#43863) BREAKING CHANGE: * The type of `initialUrl` is set to `string|UrlTree` but in reality, the `Router` only sets it to a value that will always be `UrlTree` * `initialUrl` is documented as "The target URL passed into the `Router#navigateByUrl()` call before navigation" but the value actually gets set to something completely different. It's set to the current internal `UrlTree` of the Router at the time navigation occurs. With this change, there is no exact replacement for the old value of `initialUrl` because it was enver intended to be exposed. `Router.url` is likely the best replacement for this. In more specific use-cases, tracking the `finalUrl` between successful navigations can also be used as a replacement. PR Close angular#43863
BREAKING CHANGE:
initialUrl
is set tostring|UrlTree
but in reality,the
Router
only sets it to a value that will always beUrlTree
initialUrl
is documented as "The target URL passed into theRouter#navigateByUrl()
call before navigation" but the valueactually gets set to something completely different. It's set to the
current internal
UrlTree
of the Router at the time navigationoccurs.
PR-only note:
TGP showed no failures as a result of this change. We could consider
exposing the old
t.currentRawUrl
value as a new property onNavigation
if this does end up breaking someone. That said,I don't believe this value was intended to be exposed and it's likely
that anyone using it currently could or should use something else
to do the task it's being used for.