Skip to content

feat(router): add containsTree as public API - #70148

Open
brysonbw wants to merge 1 commit into
angular:mainfrom
brysonbw:feat-public-contains-tree-method-53129
Open

feat(router): add containsTree as public API#70148
brysonbw wants to merge 1 commit into
angular:mainfrom
brysonbw:feat-public-contains-tree-method-53129

Conversation

@brysonbw

Copy link
Copy Markdown
Contributor

Export containsTree from @angular/router to enable direct UrlTree subset matching.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

  • containsTree() was not included in public API for comparing URLs

Issue Number: #53129

What is the new behavior?

  • Re-exports containsTree() from @angular/router to allow developers to perform direct UrlTree subset matching

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove
pullapprove Bot requested a review from atscott August 11, 2026 09:54
@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: router labels Aug 11, 2026
@ngbot ngbot Bot added this to the Backlog milestone Aug 11, 2026

@atscott atscott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I guess I don't see any reason we can't do this. It's effectively public API already through isActive. That said, I wonder if it would be better to pull down the default patch options here rather than combining them above in isActive. Otherwise you would be required to define them fully when calling this function, which was a pain before.

@brysonbw
brysonbw force-pushed the feat-public-contains-tree-method-53129 branch from a150669 to 403bc43 Compare August 13, 2026 09:05
@brysonbw

Copy link
Copy Markdown
Contributor Author

Hmmm, I guess I don't see any reason we can't do this. It's effectively public API already through isActive. That said, I wonder if it would be better to pull down the default patch options here rather than combining them above in isActive. Otherwise you would be required to define them fully when calling this function, which was a pain before.

Thanks for the feedback. Pushed changes making options optional and setting default fallback options

@brysonbw
brysonbw requested a review from atscott August 13, 2026 11:21
Comment thread packages/router/src/url_tree.ts Outdated
@brysonbw
brysonbw requested a review from atscott August 14, 2026 00:28
Comment thread packages/router/src/url_tree.ts Outdated
@brysonbw
brysonbw requested a review from atscott August 14, 2026 11:56
Comment thread packages/router/test/url_tree.spec.ts
Export containsTree from @angular/router to enable direct UrlTree subset matching.
@atscott
atscott force-pushed the feat-public-contains-tree-method-53129 branch from 4560f36 to c7628c8 Compare August 14, 2026 16:13
@pullapprove
pullapprove Bot requested review from atscott and kirjs August 14, 2026 16:13

@atscott atscott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-apii

@pullapprove
pullapprove Bot requested a review from atscott August 14, 2026 16:14

@atscott atscott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api

@pullapprove
pullapprove Bot requested a review from atscott August 14, 2026 16:15
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Aug 14, 2026
@thePunderWoman thePunderWoman added the target: minor This PR is targeted for the next minor release label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: router detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants