refactor(router): Build out integration with browser Navigation API #64905
+817
−496
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This further builds out the Router integration with the platform
Navigation API. Key features in this state include:
history.state. This means more guaranteed correctness and lessinternal code to compute traversal restorations.
Practically speaking, this means some navigations can be performed
through the platform rather than requiring
Router.navigate. Notethat because the
NavigateEventis never intercepted at this point ofthe implementation, regular anchor tags cannot be used because they
will still trigger a popstate navigation.
This implementation does not intercept the
NavigateEventbut futureiterations should. By omitting the interception, we are missing out on
features such as:
navigation, allowing for a visual loading indicator in the browser
(and ability to cancel navigation from the UI)
not
RouterLinks) and converting those to SPA navigations.Reviewer note: As with prior changes to support the Navigation API, this affects neither the behavior nor the code size of any existing, non-tree shakeable default code paths.