refactor(router): add support for non-blocking router resources - #70211
Draft
atscott wants to merge 2 commits into
Draft
refactor(router): add support for non-blocking router resources #70211atscott wants to merge 2 commits into
atscott wants to merge 2 commits into
Conversation
atscott
force-pushed
the
resourcestack1
branch
4 times, most recently
from
August 14, 2026 20:05
f1a4e5f to
45c2c1f
Compare
… feature Activated Route Injector feature was developed for resources. This moves the internal naming (files and vars) to reflect this now that we have landed the core bits of plumbing and are ready to implement router resources.
atscott
force-pushed
the
resourcestack1
branch
2 times, most recently
from
August 14, 2026 21:23
7a8b3ff to
11d3f43
Compare
Introduces support for route-level resources via the `resources` property on route definitions, enabled with `withRouterResources()`. Router resources provide a reactive, signal-based alternative to resolvers, allowing routes to declare resources tied to route parameters and route lifecycle: - The `resources` function executes during navigation transitions within an injection context scoped to the route (`_localInjector`). - It receives a `ResourceContext` containing signals for `params`, `queryParams`, `fragment`, and `data`, alongside the static `snapshot`. - For newly created routes, `resources` runs once and attaches to `ActivatedRoute.resources`. For reused routes, parameter signals update reactively to trigger new data fetches while keeping resource references stable. - Wrapped resources (`routerResource`) provide transactional stability: snapshots are frozen during active navigations to prevent UI jitter, unfreezing on `NavigationEnd`. - On cancelled navigations or errors, rollback recovery retains the frozen snapshot until reverted signals settle, avoiding flashes of loading state. Manual reloads are rejected while frozen. - Local injectors are automatically cleaned up if navigations are cancelled or rolled back. Note that this commit only implements non-blocking resources (marked with `nonBlocking()`), deferring blocking resource resolution to future work to keep the initial changeset smaller and less complex.
atscott
force-pushed
the
resourcestack1
branch
from
August 14, 2026 22:09
11d3f43 to
7308452
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces support for route-level resources via the
resourcesproperty on route definitions, enabled withwithRouterResources().Router resources provide a reactive, signal-based alternative to resolvers, allowing routes to declare resources tied to route parameters and route lifecycle:
resourcesfunction executes during navigation transitions within an injection context scoped to the route (_localInjector).ResourceContextcontaining signals forparams,queryParams,fragment, anddata, alongside the staticsnapshot.resourcesruns once and attaches toActivatedRoute.resources. For reused routes, parameter signals update reactively to trigger new data fetches while keeping resource references stable.routerResource) provide transactional stability: snapshots are frozen during active navigations to prevent UI jitter, unfreezing onNavigationEnd.Note that this commit only implements non-blocking resources (marked with
nonBlocking()), deferring blocking resource resolution to future work to keep the initial changeset smaller and less complex.