@@ -409,6 +409,7 @@ export interface StaticHandler {
409
409
requestContext ?: unknown ;
410
410
skipLoaders ?: boolean ;
411
411
skipLoaderErrorBubbling ?: boolean ;
412
+ unstable_dataStrategy ?: DataStrategyFunction ;
412
413
}
413
414
) : Promise < StaticHandlerContext | Response > ;
414
415
queryRoute (
@@ -2927,7 +2928,6 @@ export interface CreateStaticHandlerOptions {
2927
2928
* @deprecated Use `mapRouteProperties` instead
2928
2929
*/
2929
2930
detectErrorBoundary ?: DetectErrorBoundaryFunction ;
2930
- unstable_dataStrategy ?: DataStrategyFunction ;
2931
2931
mapRouteProperties ?: MapRoutePropertiesFunction ;
2932
2932
future ?: Partial < StaticHandlerFutureConfig > ;
2933
2933
}
@@ -2943,7 +2943,6 @@ export function createStaticHandler(
2943
2943
2944
2944
let manifest : RouteManifest = { } ;
2945
2945
let basename = ( opts ? opts . basename : null ) || "/" ;
2946
- let dataStrategyImpl = opts ?. unstable_dataStrategy || defaultDataStrategy ;
2947
2946
let mapRouteProperties : MapRoutePropertiesFunction ;
2948
2947
if ( opts ?. mapRouteProperties ) {
2949
2948
mapRouteProperties = opts . mapRouteProperties ;
@@ -3007,11 +3006,13 @@ export function createStaticHandler(
3007
3006
requestContext,
3008
3007
skipLoaderErrorBubbling,
3009
3008
skipLoaders,
3009
+ unstable_dataStrategy,
3010
3010
} : {
3011
3011
loadRouteIds ?: string [ ] ;
3012
3012
requestContext ?: unknown ;
3013
3013
skipLoaderErrorBubbling ?: boolean ;
3014
3014
skipLoaders ?: boolean ;
3015
+ unstable_dataStrategy ?: DataStrategyFunction ;
3015
3016
} = { }
3016
3017
) : Promise < StaticHandlerContext | Response > {
3017
3018
let url = new URL ( request . url ) ;
@@ -3063,6 +3064,7 @@ export function createStaticHandler(
3063
3064
location ,
3064
3065
matches ,
3065
3066
requestContext ,
3067
+ unstable_dataStrategy || null ,
3066
3068
loadRouteIds || null ,
3067
3069
skipLoaderErrorBubbling === true ,
3068
3070
skipLoaders === true ,
@@ -3143,6 +3145,7 @@ export function createStaticHandler(
3143
3145
matches ,
3144
3146
requestContext ,
3145
3147
null ,
3148
+ null ,
3146
3149
false ,
3147
3150
false ,
3148
3151
match
@@ -3181,6 +3184,7 @@ export function createStaticHandler(
3181
3184
location : Location ,
3182
3185
matches : AgnosticDataRouteMatch [ ] ,
3183
3186
requestContext : unknown ,
3187
+ unstable_dataStrategy : DataStrategyFunction | null ,
3184
3188
loadRouteIds : string [ ] | null ,
3185
3189
skipLoaderErrorBubbling : boolean ,
3186
3190
skipLoaders : boolean ,
@@ -3198,6 +3202,7 @@ export function createStaticHandler(
3198
3202
matches ,
3199
3203
routeMatch || getTargetMatch ( matches , location ) ,
3200
3204
requestContext ,
3205
+ unstable_dataStrategy ,
3201
3206
loadRouteIds ,
3202
3207
skipLoaderErrorBubbling ,
3203
3208
skipLoaders ,
@@ -3210,6 +3215,7 @@ export function createStaticHandler(
3210
3215
request ,
3211
3216
matches ,
3212
3217
requestContext ,
3218
+ unstable_dataStrategy ,
3213
3219
loadRouteIds ,
3214
3220
skipLoaderErrorBubbling ,
3215
3221
routeMatch
@@ -3245,6 +3251,7 @@ export function createStaticHandler(
3245
3251
matches : AgnosticDataRouteMatch [ ] ,
3246
3252
actionMatch : AgnosticDataRouteMatch ,
3247
3253
requestContext : unknown ,
3254
+ unstable_dataStrategy : DataStrategyFunction | null ,
3248
3255
loadRouteIds : string [ ] | null ,
3249
3256
skipLoaderErrorBubbling : boolean ,
3250
3257
skipLoaders : boolean ,
@@ -3272,7 +3279,8 @@ export function createStaticHandler(
3272
3279
[ actionMatch ] ,
3273
3280
matches ,
3274
3281
isRouteRequest ,
3275
- requestContext
3282
+ requestContext ,
3283
+ unstable_dataStrategy
3276
3284
) ;
3277
3285
result = results [ 0 ] ;
3278
3286
@@ -3367,6 +3375,7 @@ export function createStaticHandler(
3367
3375
loaderRequest ,
3368
3376
matches ,
3369
3377
requestContext ,
3378
+ unstable_dataStrategy ,
3370
3379
loadRouteIds ,
3371
3380
skipLoaderErrorBubbling ,
3372
3381
null ,
@@ -3405,6 +3414,7 @@ export function createStaticHandler(
3405
3414
loaderRequest ,
3406
3415
matches ,
3407
3416
requestContext ,
3417
+ unstable_dataStrategy ,
3408
3418
loadRouteIds ,
3409
3419
skipLoaderErrorBubbling ,
3410
3420
null
@@ -3427,6 +3437,7 @@ export function createStaticHandler(
3427
3437
request : Request ,
3428
3438
matches : AgnosticDataRouteMatch [ ] ,
3429
3439
requestContext : unknown ,
3440
+ unstable_dataStrategy : DataStrategyFunction | null ,
3430
3441
loadRouteIds : string [ ] | null ,
3431
3442
skipLoaderErrorBubbling : boolean ,
3432
3443
routeMatch : AgnosticDataRouteMatch | null ,
@@ -3495,7 +3506,8 @@ export function createStaticHandler(
3495
3506
matchesToLoad ,
3496
3507
matches ,
3497
3508
isRouteRequest ,
3498
- requestContext
3509
+ requestContext ,
3510
+ unstable_dataStrategy
3499
3511
) ;
3500
3512
3501
3513
if ( request . signal . aborted ) {
@@ -3541,10 +3553,11 @@ export function createStaticHandler(
3541
3553
matchesToLoad : AgnosticDataRouteMatch [ ] ,
3542
3554
matches : AgnosticDataRouteMatch [ ] ,
3543
3555
isRouteRequest : boolean ,
3544
- requestContext : unknown
3556
+ requestContext : unknown ,
3557
+ unstable_dataStrategy : DataStrategyFunction | null
3545
3558
) : Promise < DataResult [ ] > {
3546
3559
let results = await callDataStrategyImpl (
3547
- dataStrategyImpl ,
3560
+ unstable_dataStrategy || defaultDataStrategy ,
3548
3561
type ,
3549
3562
request ,
3550
3563
matchesToLoad ,
0 commit comments