Skip to content

feat(router): Support the new Navigation API #53321

@martinszeltins

Description

@martinszeltins

Which @angular/* package(s) are relevant/related to the feature request?

router

Description

Currently, most SPA apps on the web implement a fake "loading" bar like you can see on GitHub when navigating between pages. In a real MPA app where it performs a full page reload browsers show a native loading indicator. This has been impossible to implement until now with SPA because there was no way to show browser's native loading indicator. But now there is a new browser api called the Navigation API, specifically designed for SPA apps that finally shows a native browser loader when navigating in SPA app. 🎉

Proposed solution

Implement the new Navigation API. Yes, it is a new and bleeding edge feature but for those users with browsers that already support it (like Chrome) I think it adds a really nice UX touch.

developer.chrome.com/docs/web-platform/navigation-api
developer.mozilla.org/en-US/docs/Web/API/Navigation_API

Demo:
https://gigantic-honored-octagon.glitch.me/

(In the demo, you can activate the Add an artificial two-second delay to all navigations (should impact the loading spinner/scroll restoration/focus reset/accessibility announcements). checkbox to see the native loader appearing on the tab when navigating)

image

Alternatives considered

None because this is a new API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: routerfeatureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under consideration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions