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:
Andrew Scott
2026-11-14 00:31:22 +00:00
committed by Alon Mishne
parent d536c91325
commit 4e927d81d5
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -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(),
};