Skip to content

Commit a5c98a5

Browse files
committed
Rename Agnostic -> Decoded
1 parent 573f1a1 commit a5c98a5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/react-router/lib/dom/ssr/single-fetch.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export type SingleFetchRedirectResult = {
3232
};
3333

3434
// Shared/serializable type used by both turbo-stream and RSC implementations
35-
type AgnosticSingleFetchResults =
35+
type DecodedSingleFetchResults =
3636
| { routes: { [key: string]: SingleFetchResult } }
3737
| { redirect: SingleFetchRedirectResult };
3838

@@ -333,7 +333,7 @@ async function singleFetchLoaderNavigationStrategy(
333333
let routeDfds = matches.map(() => createDeferred<void>());
334334

335335
// Deferred we'll use for the singleular call to the server
336-
let singleFetchDfd = createDeferred<AgnosticSingleFetchResults>();
336+
let singleFetchDfd = createDeferred<DecodedSingleFetchResults>();
337337

338338
// Base URL and RequestInit for calls to the server
339339
let url = stripIndexParam(singleFetchUrl(request.url, basename));
@@ -534,7 +534,7 @@ async function fetchAndDecode(
534534
url: URL,
535535
init: RequestInit,
536536
routeId?: string
537-
): Promise<{ status: number; data: AgnosticSingleFetchResults }> {
537+
): Promise<{ status: number; data: DecodedSingleFetchResults }> {
538538
let res = await fetch(url, init);
539539

540540
// If this 404'd without hitting the running server (most likely in a
@@ -563,7 +563,7 @@ async function fetchAndDecode(
563563

564564
try {
565565
let decoded = await decodeViaTurboStream(res.body, window);
566-
let data: AgnosticSingleFetchResults;
566+
let data: DecodedSingleFetchResults;
567567
if (!init.method || init.method === "GET") {
568568
let typed = decoded.value as SingleFetchResults;
569569
if (SingleFetchRedirectSymbol in typed) {
@@ -648,7 +648,7 @@ export function decodeViaTurboStream(
648648
}
649649

650650
function unwrapSingleFetchResult(
651-
result: AgnosticSingleFetchResults,
651+
result: DecodedSingleFetchResults,
652652
routeId: string
653653
) {
654654
if ("redirect" in result) {

packages/react-router/lib/server-runtime/single-fetch.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
stripBasename,
1515
} from "../router/utils";
1616
import type {
17-
SingleFetchRedirectResult,
17+
AgnosticSingleFetchRedirectResult,
1818
SingleFetchResult,
1919
SingleFetchResults,
2020
} from "../dom/ssr/single-fetch";
@@ -308,7 +308,7 @@ export function getSingleFetchRedirect(
308308
status: number,
309309
headers: Headers,
310310
basename: string | undefined
311-
): SingleFetchRedirectResult {
311+
): AgnosticSingleFetchRedirectResult {
312312
let redirect = headers.get("Location")!;
313313

314314
if (basename) {

0 commit comments

Comments
 (0)