angular/packages/router/test
Andrew Scott ce1b915868 fix(router): Allow redirects after an absolute redirect (#51731)
The router currently restricts all further redirects after an absolute
redirect. Because there's no documented reason for _why_ this
restriction is in place, I'm now deeming this unnecessary. Developers
should not be restricted in this manner. Instead, configs that may
have caused infinite redirects in the past should be updated to not be
infinite. It is confusing to ignore configs with redirects after an
absolute redirect occurred because it creates different matching rules
depending on the whether an absolute redirect has happened or not.

For additional context on why I believe removing this restriction is
necessary, #13373 asks for allowing `redirectTo` to be a function. It
would make sense to allow this function to return a `UrlTree` like other
guards in the Router. When guards in the `Router` return `UrlTree`, they
cancel the current navigation and start a new one to re-do the route
matching. Since we're already in the router matching part, we don't need
to cancel the navigation. However, the restriction on absolute redirects
here then creates a weird situation where developers wouldn't see any
other redirects if they returned a `UrlTree` as an absolute redirect
from `redirectTo`.

resolves #39770

BREAKING CHANGE: Absolute redirects no longer prevent further redirects.
Route configurations may need to be adjusted to prevent infinite
redirects where additional redirects were previously ignored after an
absolute redirect occurred.

PR Close #51731
2023-09-26 10:59:20 -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): Route matching should only happen once when navigating (#49163) 2023-03-29 14:40:41 -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): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -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 option to skip the first view transition (#51825) 2023-09-22 09:48:09 -07:00