Skip to content

fix(router): skip split when piercing empty path outlets - #71121

Open
atscott wants to merge 1 commit into
angular:mainfrom
atscott:router-empty-path-outlet-cleanup
Open

atscott wants to merge 1 commit into
angular:mainfrom
atscott:router-empty-path-outlet-cleanup

Conversation

@atscott

@atscott atscott commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

split is designed to split remaining primary outlet segments alongside empty-path named outlets (createChildrenForEmptyPaths wraps slicedSegments in res[PRIMARY_OUTLET]). When piercing an empty-path route to look for a named outlet among its descendants (!matchedOnOutlet), remainingSegments belong to that named outlet rather than PRIMARY_OUTLET.

Previously, split was called even when !matchedOnOutlet, which required the isSelfEvaluating workaround in #67708 to ignore an empty-path route for the same outlet being evaluated. However, if the pierced empty-path route also contained another empty-path named outlet sibling (e.g. tertiary alongside secondary), split still moved secondary's segments into children[PRIMARY_OUTLET] and caused matching to fail.

Skipping split when !matchedOnOutlet fixes matching when multiple named outlets exist under an empty-path route and allows removing the outlet / isSelfEvaluating workaround from split.

Related to #67708

`split` is designed to split remaining primary outlet segments alongside
empty-path named outlets (`createChildrenForEmptyPaths` wraps `slicedSegments`
in `res[PRIMARY_OUTLET]`). When piercing an empty-path route to look for a
named outlet among its descendants (`!matchedOnOutlet`), `remainingSegments`
belong to that named outlet rather than `PRIMARY_OUTLET`.

Previously, `split` was called even when `!matchedOnOutlet`, which required
the `isSelfEvaluating` workaround in angular#67708 to ignore an empty-path route for
the same outlet being evaluated. However, if the pierced empty-path route also
contained another empty-path named outlet sibling (e.g. `tertiary` alongside
`secondary`), `split` still moved `secondary`'s segments into
`children[PRIMARY_OUTLET]` and caused matching to fail.

Skipping `split` when `!matchedOnOutlet` fixes matching when multiple named
outlets exist under an empty-path route and allows removing the `outlet` /
`isSelfEvaluating` workaround from `split`.

Related to angular#67708
@ngbot ngbot Bot added this to the Backlog milestone Oct 1, 2026
@atscott atscott added the requires: TGP This PR requires a passing TGP before merging is allowed label Oct 1, 2026
@atscott
atscott requested a review from JeanMeche October 1, 2026 16:16
@atscott
atscott marked this pull request as ready for review October 1, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: router requires: TGP This PR requires a passing TGP before merging is allowed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant