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
feat(common): add historyGo method to Location service #38890
Conversation
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.
Hi @aahmedayed, thanks for the PR - I think this is a good change overall, just a few items to address.
- Add some tests to
location_spec.ts
to validate the behavior of this new method - Please update the spelling of "methode" and "methodes" in the commit message to be "method" and "methods" and add a link to the history API documentation for
History#go
.
Hi @atscott - Thanks for the review, i'll start working on it. |
Hi @atscott - I've made the adjustments required. |
3ed86c0
to
8e474e7
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.
Great work on updating the mock_platform_location
! Just a couple more small requests for testing scenarios so we have sufficient coverage.
Thank you @atscott, i'm working on it. |
e110e2a
to
365794f
Compare
@atscott - I’ve already finished the adjustments you asked for. |
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 after the fixup of the integration.spec.ts
test. Adding approval to allow this to move forward for public API review.
@aahmedayed The CI tests are failing to execute because you may have set up circleci on your fork, but don't have permission to run this level of resource class. Could you please disable CircleCI on your angular fork? |
365794f
to
16819c8
Compare
365737b
to
81d646a
Compare
public API reviewers, PTAL. Following the discussion in the FW sync today, this change has been made non-breaking by having the new functions be optional. This opens the door to fixing #13586. In addition, discussions in WICG/navigation-api#32 confirm that the current standard practice for correctly restoring state after a rejected navigation is to use the |
You can preview 81d646a at https://pr38890-81d646a.ngbuilds.io/. |
81d646a
to
9100b03
Compare
You can preview 9100b03 at https://pr38890-9100b03.ngbuilds.io/. |
@atscott quick question: the |
@AndrewKushnir Yes, this will be used in the router code in follow-up PRs. The router does not currently do any verification on similar methods that are not implemented in subclasses (or their underlying |
Thanks for additional information @atscott. The scenario I was thinking of is:
I believe the 3rd step might be a breaking change, but it'd be a part of the followup PR, so this PR should be good to go (and the followup PR would be marked as breaking change). Please let me know if my understanding is correct or the above mentioned scenario is not a valid one. Thank you. |
@AndrewKushnir - Yes, the change in the router would need to be marked as a breaking change if we made it the default and/or did not make it an opt-in option. It would also be breaking for another reason: even though it would fix currently broken behavior, developers have implemented workarounds for it which would then be incompatible/unnecessary with the |
Add new method `historyGo`, that will let the user navigate to a specific page from session history identified by its relative position to the current page. We add some tests to `location_spec.ts` to validate the behavior of the `historyGo` and `forward` methods. Add more tests for `location_spec` to test `location.historyGo(0)`, `location.historyGo()`, `location.historyGo(100)` and `location.historyGo(-100)`. We also add new tests for `Integration` spec to validate the navigation when we using `location#historyGo`. Update the `historyGo` function docs Note that this was made an optional function in the abstract classes to avoid a breaking change. Because our location classes use `implements PlatformLocation` rather than `extends PlatformLocation`, simply adding a default implementation was not sufficient to make this a non-breaking change. While we could fix the classes internal to Angular, this would still have been a breaking change for any external developers who may have followed our implementations as an example.
9100b03
to
dae6f19
Compare
You can preview dae6f19 at https://pr38890-dae6f19.ngbuilds.io/. |
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, size-tracking
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: size-tracking
I am surprised that these fairly small additions add ~700 bytes but probably there was already an increase on master.
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. |
Add new method
historyGo
, that will letthe user navigate to a specific page from session history identified by its
relative position to the current page.
We add some tests to
location_spec.ts
to validate the behavior of thehistoryGo
andforward
methods.Add more tests for
location_spec
to testlocation.historyGo(0)
,location.historyGo()
,location.historyGo(100)
andlocation.historyGo(-100)
. We also add new tests forIntegration
spec to validate the navigation when we usinglocation#historyGo
.Update the
main-es2015
size limits ofaio-local-viewengine
inaio-payloads
file.Update the
historyGo
function docsLink for the history API documentation for History#go
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information