angular/goldens/public-api/router/errors.md
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

47 lines
1.2 KiB
Markdown

## API Report File for "angular-srcs"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
// @public
export const enum RuntimeErrorCode {
// (undocumented)
EMPTY_PATH_WITH_PARAMS = 4009,
// (undocumented)
FOR_ROOT_CALLED_TWICE = 4007,
// (undocumented)
INFINITE_REDIRECT = 4016,
// (undocumented)
INVALID_DOUBLE_DOTS = 4005,
// (undocumented)
INVALID_ROOT_URL_SEGMENT = 4015,
// (undocumented)
INVALID_ROUTE_CONFIG = 4014,
// (undocumented)
MISPLACED_OUTLETS_COMMAND = 4004,
// (undocumented)
MISSING_REDIRECT = 4001,
// (undocumented)
NAMED_OUTLET_REDIRECT = 4000,
// (undocumented)
NO_MATCH = 4002,
// (undocumented)
NULLISH_COMMAND = 4008,
// (undocumented)
OUTLET_ALREADY_ACTIVATED = 4013,
// (undocumented)
OUTLET_NOT_ACTIVATED = 4012,
// (undocumented)
ROOT_SEGMENT_MATRIX_PARAMS = 4003,
// (undocumented)
TWO_SEGMENTS_WITH_SAME_OUTLET = 4006,
// (undocumented)
UNEXPECTED_VALUE_IN_URL = 4011,
// (undocumented)
UNPARSABLE_URL = 4010
}
// (No @packageDocumentation comment for this package)
```