Skip to content

Commit 16d3f8e

Browse files
committed
Remove prefix from dataStrategy runClientMiddleware
1 parent d127020 commit 16d3f8e

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export function getTurboStreamSingleFetchDataStrategy(
197197
ssr,
198198
basename,
199199
);
200-
return async (args) => args.unstable_runClientMiddleware(dataStrategy);
200+
return async (args) => args.runClientMiddleware(dataStrategy);
201201
}
202202

203203
export function getSingleFetchDataStrategyImpl(

packages/react-router/lib/router/router.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5458,7 +5458,7 @@ function runServerMiddlewarePipeline(
54585458
function runClientMiddlewarePipeline(
54595459
args: Omit<
54605460
DataStrategyFunctionArgs<RouterContextProvider>,
5461-
"fetcherKey" | "unstable_runClientMiddleware"
5461+
"fetcherKey" | "runClientMiddleware"
54625462
>,
54635463
handler: () => Promise<Record<string, DataStrategyResult>>,
54645464
): Promise<Record<string, DataStrategyResult>> {
@@ -5784,10 +5784,10 @@ async function callDataStrategyImpl(
57845784
context: scopedContext,
57855785
matches,
57865786
};
5787-
let unstable_runClientMiddleware = isStaticHandler
5787+
let runClientMiddleware = isStaticHandler
57885788
? () => {
57895789
throw new Error(
5790-
"You cannot call `unstable_runClientMiddleware()` from a static handler " +
5790+
"You cannot call `runClientMiddleware()` from a static handler " +
57915791
"`dataStrategy`. Middleware is run outside of `dataStrategy` during " +
57925792
"SSR in order to bubble up the Response. You can enable middleware " +
57935793
"via the `respond` API in `query`/`queryRoute`",
@@ -5800,10 +5800,10 @@ async function callDataStrategyImpl(
58005800
return cb({
58015801
...typedDataStrategyArgs,
58025802
fetcherKey,
5803-
unstable_runClientMiddleware: () => {
5803+
runClientMiddleware: () => {
58045804
throw new Error(
5805-
"Cannot call `unstable_runClientMiddleware()` from within an " +
5806-
"`unstable_runClientMiddleware` handler",
5805+
"Cannot call `runClientMiddleware()` from within an " +
5806+
"`runClientMiddleware` handler",
58075807
);
58085808
},
58095809
});
@@ -5813,7 +5813,7 @@ async function callDataStrategyImpl(
58135813
let results = await dataStrategyImpl({
58145814
...dataStrategyArgs,
58155815
fetcherKey,
5816-
unstable_runClientMiddleware,
5816+
runClientMiddleware,
58175817
});
58185818

58195819
// Wait for all routes to load here but swallow the error since we want

packages/react-router/lib/router/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ export interface DataStrategyFunctionArgs<Context = DefaultContext>
488488
* Matches for this route extended with Data strategy APIs
489489
*/
490490
matches: DataStrategyMatch[];
491-
unstable_runClientMiddleware: (
491+
runClientMiddleware: (
492492
cb: DataStrategyFunction<Context>,
493493
) => Promise<Record<string, DataStrategyResult>>;
494494
/**

packages/react-router/lib/rsc/browser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ export function getRSCSingleFetchDataStrategy(
464464
},
465465
);
466466
return async (args) =>
467-
args.unstable_runClientMiddleware(async () => {
467+
args.runClientMiddleware(async () => {
468468
// Before we run the dataStrategy, create a place to stick rendered routes
469469
// from the payload so we can patch them into the router after all loaders
470470
// have completed. Need to do this since we may have multiple fetch

0 commit comments

Comments
 (0)