angular/packages/router/test
Andrew Scott 1da28f4825 feat(router): Add callback to execute when a view transition is created (#52002)
This commit adds the ability to provide a function that will get called
immediately after the view transition is created. This will allow
developers to do things like add/remove classes from the DOM when the
transition animation is finished, skip the transition based on
application conditions, etc. Having access to the transition unlocks
just about every example outlined in https://developer.chrome.com/docs/web-platform/view-transitions.

Note that the timing of the `updateCallback` execution is in the spec as
being called asyncronously (https://drafts.csswg.org/css-view-transitions-1/#callbackdef-updatecallback).
This means the `onViewTransitionCreated` callback is guaranteed to
execute before the update callback which in turn means it is guaranteed
to execute before the view transition `ready`/animation. As a result, it
is safe/effictive to add classes to the document in the
`onViewTransitionCreated` function in order to control animations of
that transition and then remove those classes in the transition's `finished`
`Promise`. The animation also doesn't start until the `Promise` returned
by `updateCallback` resolves, so this would also guarantee that the
animation starts asynchronously.

resolves #51827

PR Close #52002
2023-10-10 11:16:22 -07:00
..
directives refactor(router): Ensure data is bound to components in change detection following navigation (#49741) 2023-04-12 09:33:11 -07:00
operators refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -07:00
utils build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
apply_redirects.spec.ts fix(router): Allow redirects after an absolute redirect (#51731) 2023-09-26 10:59:20 -07:00
bootstrap.spec.ts feat(router): Add option to skip the first view transition (#51825) 2023-09-22 09:48:09 -07:00
BUILD.bazel fix(router): Ensure title observable gets latest values (#51561) 2023-08-31 16:42:44 +00:00
computed_state_restoration.spec.ts fix(router): Remove deprecated Router properties (#51502) 2023-08-29 19:47:58 +00:00
config.spec.ts refactor(router): code cleaning (#48259) 2022-12-09 09:59:20 -08:00
create_router_state.spec.ts fix(router): Route matching should only happen once when navigating (#49163) 2023-03-29 14:40:41 -07:00
create_url_tree.spec.ts fix(router): Apply named outlets to children empty paths not appearing in the URL (#51292) 2023-08-10 09:18:30 -07:00
default_export_component.ts feat(router): auto-unwrap default exports when lazy loading (#47586) 2022-10-04 14:40:58 -07:00
default_export_routes.ts feat(router): auto-unwrap default exports when lazy loading (#47586) 2022-10-04 14:40:58 -07:00
helpers.ts refactor(router): Remove legacy url creation code (#49360) 2023-03-22 16:37:01 +01:00
integration.spec.ts refactor(router): Remove internal state tracking for browserUrlTree (#48065) 2023-09-19 16:50:56 +02:00
page_title_strategy_spec.ts build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
recognize.spec.ts fix(router): children of routes with loadComponent should not inherit parent data by default (#52114) 2023-10-10 09:36:37 -07:00
regression_integration.spec.ts refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -07:00
router.spec.ts refactor(router): move location methods into state_manager.ts (#52032) 2023-10-05 11:02:07 -07:00
router_link_spec.ts refactor(router): use transform to coerce input values (#50589) 2023-06-06 14:15:50 -07:00
router_preloader.spec.ts fix(router): Ensure Router preloading works with lazy component and static children (#49571) 2023-03-24 10:41:10 -07:00
router_scroller.spec.ts Revert "refactor(router): Remove zone code from router scroller (#49238)" (#49311) 2023-03-03 18:31:04 +00:00
router_state.spec.ts refactor(router): code cleaning (#48259) 2022-12-09 09:59:20 -08:00
shared.spec.ts fix(router): fix error when calling ParamMap.get function (#31599) 2020-06-25 11:57:24 -07:00
standalone.spec.ts refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -07:00
url_serializer.spec.ts build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
url_tree.spec.ts refactor(router): run spell check on router package (#50445) 2023-05-24 13:56:56 +00:00
view_transitions.spec.ts feat(router): Add callback to execute when a view transition is created (#52002) 2023-10-10 11:16:22 -07:00