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(router): Add feature to support the View Transitions API #51314
Conversation
82c9144
to
68c20e5
Compare
Updating risk to medium since the view transition adds a delay to where code was synchronous before. Exact timings in the Router have historically been fragile. It is technically possible to keep the code synchronous if the feature is not enabled, but avoiding "sometimes synchronous, sometimes asynchronous" branch in the code would be ideal. |
4c36be8
to
e813133
Compare
1293543
to
1b9bc6e
Compare
bf34e47
to
f275113
Compare
Removing risk label since I ended up going with the sometimes sync, sometimes async behavior so that the default behavior is unchanged. |
e071790
to
0c58b90
Compare
TGP shows no failures for the current approach. I ran a quick test to enable view transitions unconditionally and it appears that test failures are generally due to ZoneJS and the fact that it doesn't patch the |
8927fbe
to
009b5e3
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.
Looks great, just a few minor comments.
* @returns A set of providers for use with `provideRouter`. | ||
* @see https://developer.chrome.com/docs/web-platform/view-transitions/ | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API | ||
* @experimental |
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.
I'm not sure this is reflected on AIO, should we use @developerPreview
instead?
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.
I'm not sure either but @jelbourn did mention this tag and we believe it's more appropriate given the state of the view transition API in general.
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.
@jelbourn It does appear that the @experimental
tag doesn't show up on AIO (https://ng-dev-previews-fw--pr-angular-angular-51314-y5diongs.web.app/api/router/withViewTransitions)
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
5014f17
to
e8b5d0b
Compare
Deployed aio for b3a240f to: https://ng-dev-previews-fw--pr-angular-angular-51314-y5diongs.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
The View Transitions API enables easy animations when transitioning between different DOM states. This commit adds an opt-in feature to the Router which runs the component activation and deactivation logic in the document.startViewTransition callback. If the browser does not support this API, route activation and deactivation will happen synchronously. resolves angular#49401
b822a0e
to
c92bcac
Compare
c92bcac
to
b3a240f
Compare
This PR was merged into the repository by commit 73e4bf2. |
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. |
…r#51314) The View Transitions API enables easy animations when transitioning between different DOM states. This commit adds an opt-in feature to the Router which runs the component activation and deactivation logic in the document.startViewTransition callback. If the browser does not support this API, route activation and deactivation will happen synchronously. resolves angular#49401 PR Close angular#51314
The View Transitions API enables easy animations when transitioning between different DOM states. This commit adds an opt-in feature to the Router which runs the component activation and deactivation logic in the
document.startViewTransition
callback. If the browser does not support this API, route activation and deactivation will happen synchronously.resolves #49401