refactor(router): make setupAndRunResources consistently asynchronous #71500

Closed
atscott opened 5:15pm on October 20, 2026 wanted to merge 20 Ξ” into angular/angular main from
router-resources-async
Diff Delta:
20
About 1200 Diff Delta/hour
Classified as:  General

atscott's Description of Work

Previously, setupAndRunResources could return synchronously (via return; resulting in undefined to switchTap) when newlyCreatedRoutes or targetRouterState was missing or when abortSignal.aborted was true, whereas normal navigations returned a Promise and ran asynchronously.

This change marks the switchTap callback in setupAndRunResources as async and awaits Promise.all(resourceSetupPromises) and Promise.all(blockingResourcePromises). This ensures switchTap consistently receives a Promise across all transition states, preventing accidental mixed synchronous/asynchronous execution within the route resources feature.

1 total changed file
Loading changes...
That’s the last hunk
No additional context awaits in the abyss below