mirror of
https://github.com/angular/angular.git
synced 2026-11-22 22:55:25 -05:00
refactor(router): remove data from ResourceContext (g3-only)
Gate ResourceContext.data and its initialization in setupAndRunResources behind 3p-only markers so that google3 stops exposing resolved data on ctx.data() ahead of parallelizing route resolvers and route resources.
(cherry picked from commit 1e6afa4cb8)
This commit is contained in:
committed by
Alon Mishne
parent
d536c91325
commit
4e927d81d5
@@ -59,12 +59,15 @@ export interface ResourceContext {
|
||||
* @developerPreview 22.2
|
||||
*/
|
||||
fragment: Signal<string | null>;
|
||||
// TODO(v23): Remove data from ResourceContext (or restrict to static data) in 3p.
|
||||
// 3p-only-start
|
||||
/**
|
||||
* Data provided in the route configuration.
|
||||
*
|
||||
* @developerPreview 22.2
|
||||
*/
|
||||
data: Signal<Record<string, any>>;
|
||||
// 3p-only-end
|
||||
/**
|
||||
* Resources inherited from ancestor routes, keyed by name.
|
||||
*
|
||||
|
||||
@@ -179,7 +179,8 @@ async function setupNewRouterResources(
|
||||
params: route.paramsSignal,
|
||||
queryParams: route.queryParamsSignal,
|
||||
fragment: route.fragmentSignal,
|
||||
data: route.dataSignal,
|
||||
// TODO(v23): Remove data from ResourceContext (or restrict to static data) in 3p.
|
||||
data: route.dataSignal, // 3p-only
|
||||
resources: route.parent?._resourceContextSignal ?? signal<ResourceResult>({}).asReadonly(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user