Skip to content

Conversation

AleksanderBodurri
Copy link
Member

@AleksanderBodurri AleksanderBodurri commented Aug 11, 2025

Addresses some cleanup items for the router tree:

  • No longer loads router ng global APIs as a side effect of importing the router. Rather this is now a runtime step that occurs when provideRouter is called.
  • No longer depends on router.navigateByUrl in Angular DevTools. There is now a dedicated global util for this
  • Find router instance logic no longer depends on token name
  • Prevents navigating to lazy or redirect routes (these don't have an associated component)
  • Feature detects the new debug APIs and disables router tree functionality if they are not present

@ngbot ngbot bot added this to the Backlog milestone Aug 11, 2025
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Aug 11, 2025
@AleksanderBodurri AleksanderBodurri force-pushed the router-tree-fixes branch 3 times, most recently from 7af49a9 to 0be47a7 Compare August 11, 2025 04:19
import {TestBed} from '@angular/core/testing';
import {Router, RouterModule} from '../index';
import {getLoadedRoutes} from '../src/router_devtools';
import {getLoadedRoutes, getRouterInstance, navigateByUrl} from '../src/router_devtools';
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider: Could we improve this by testing the published ng global rather than directly importing the symbols? What if we called provideRouter and then called ng.* and validated that result?

@AleksanderBodurri AleksanderBodurri force-pushed the router-tree-fixes branch 4 times, most recently from 92d9188 to fe2d6e1 Compare August 18, 2025 14:54
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

LGTM

@thePunderWoman
Copy link
Contributor

@AleksanderBodurri just a heads up that this PR is having all sorts of github / pullapprove issues. I can't remove Paul's review request or my own. Pullapprove is erroring. So for now just leave the PullApprove: disable label on there.

@AleksanderBodurri AleksanderBodurri force-pushed the router-tree-fixes branch 3 times, most recently from 9a0943d to f079e15 Compare August 25, 2025 06:20
@AleksanderBodurri AleksanderBodurri added the action: merge The PR is ready for merge by the caretaker label Aug 28, 2025
@AleksanderBodurri AleksanderBodurri removed the action: merge The PR is ready for merge by the caretaker label Aug 28, 2025
@AleksanderBodurri AleksanderBodurri force-pushed the router-tree-fixes branch 2 times, most recently from af16fca to f8ff794 Compare August 28, 2025 23:13
<div class="unsupported-version">
<p>
Router tree visualization is available for Angular applications using version 21 and greater.
Please upgrade your application to Angular version 21 or above to use this feature.
Copy link
Contributor

Choose a reason for hiding this comment

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

The stable launch for this might be decoupled from v21, this message is also a bit confusing right now given that v21 doesn't exist yet.

I'm thinking we could either:

  1. Say "latest 20.2.x release", so it's not too tied to a specific patch version.
  2. Use the earliest patch we know works right now, and then consider bumping it to v21 later as we get closer to that launch date.

@AleksanderBodurri AleksanderBodurri force-pushed the router-tree-fixes branch 4 times, most recently from 21f1ad6 to a7db19f Compare August 29, 2025 03:53
Addresses some cleanup items for the router tree:

- No longer loads router ng global APIs as a side effect of importing the router. Rather this is now a runtime step that occurs when provideRouter is called.
- No longer depends on router.navigateByUrl in Angular DevTools. There is now a dedicated global util for this
- Router instance logic no longer depends on token name
- Prevents navigating to lazy or redirect routes (these don't have an associated component)
@AleksanderBodurri AleksanderBodurri added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Aug 29, 2025
@mmalerba
Copy link
Contributor

@AleksanderBodurri does this actually need to go in patch? I ask because its a "feat" and also doesn't merge cleanly into the patch branch

@AleksanderBodurri AleksanderBodurri added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Aug 30, 2025
@AleksanderBodurri
Copy link
Member Author

@AleksanderBodurri does this actually need to go in patch? I ask because its a "feat" and also doesn't merge cleanly into the patch branch

I want to say not 100% necessary. It would be nice to get the framework changes into a patch version for 20.2.x but not strictly required. @dgp1130 any thoughts?

@AleksanderBodurri AleksanderBodurri added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews area: devtools detected: feature PR contains a feature commit PullApprove: disable target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants