@@ -53,6 +53,7 @@ import {
53
53
NEXT_URL ,
54
54
RSC_HEADER ,
55
55
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER ,
56
+ NEXT_HMR_REFRESH_HASH_COOKIE ,
56
57
} from '../../client/components/app-router-headers'
57
58
import {
58
59
createTrackedMetadataContext ,
@@ -725,6 +726,7 @@ async function warmupDevRender(
725
726
stale : INFINITE_CACHE ,
726
727
tags : [ ] ,
727
728
prerenderResumeDataCache,
729
+ hmrRefreshHash : req . cookies [ NEXT_HMR_REFRESH_HASH_COOKIE ] ,
728
730
}
729
731
730
732
const rscPayload = await workUnitAsyncStorage . run (
@@ -2221,6 +2223,10 @@ async function spawnDynamicValidationInDev(
2221
2223
ctx . getDynamicParamFromSegment
2222
2224
)
2223
2225
2226
+ const hmrRefreshHash = requestStore . cookies . get (
2227
+ NEXT_HMR_REFRESH_HASH_COOKIE
2228
+ ) ?. value
2229
+
2224
2230
// Prerender controller represents the lifetime of the prerender.
2225
2231
// It will be aborted when a Task is complete or a synchronously aborting
2226
2232
// API is called. Notably during cache-filling renders this does not actually
@@ -2248,6 +2254,7 @@ async function spawnDynamicValidationInDev(
2248
2254
stale : INFINITE_CACHE ,
2249
2255
tags : [ ] ,
2250
2256
prerenderResumeDataCache,
2257
+ hmrRefreshHash,
2251
2258
}
2252
2259
2253
2260
const initialClientController = new AbortController ( )
@@ -2265,6 +2272,7 @@ async function spawnDynamicValidationInDev(
2265
2272
stale : INFINITE_CACHE ,
2266
2273
tags : [ ] ,
2267
2274
prerenderResumeDataCache,
2275
+ hmrRefreshHash,
2268
2276
}
2269
2277
2270
2278
// We're not going to use the result of this render because the only time it could be used
@@ -2412,6 +2420,7 @@ async function spawnDynamicValidationInDev(
2412
2420
stale : INFINITE_CACHE ,
2413
2421
tags : [ ] ,
2414
2422
prerenderResumeDataCache,
2423
+ hmrRefreshHash,
2415
2424
}
2416
2425
2417
2426
const finalClientController = new AbortController ( )
@@ -2433,6 +2442,7 @@ async function spawnDynamicValidationInDev(
2433
2442
stale : INFINITE_CACHE ,
2434
2443
tags : [ ] ,
2435
2444
prerenderResumeDataCache,
2445
+ hmrRefreshHash,
2436
2446
}
2437
2447
2438
2448
const finalServerPayload = await workUnitAsyncStorage . run (
@@ -2759,6 +2769,7 @@ async function prerenderToStream(
2759
2769
stale : INFINITE_CACHE ,
2760
2770
tags : [ ...implicitTags . tags ] ,
2761
2771
prerenderResumeDataCache,
2772
+ hmrRefreshHash : undefined ,
2762
2773
} )
2763
2774
2764
2775
// We're not going to use the result of this render because the only time it could be used
@@ -2853,6 +2864,7 @@ async function prerenderToStream(
2853
2864
stale : INFINITE_CACHE ,
2854
2865
tags : [ ...implicitTags . tags ] ,
2855
2866
prerenderResumeDataCache,
2867
+ hmrRefreshHash : undefined ,
2856
2868
}
2857
2869
2858
2870
const prerender = require ( 'react-dom/static.edge' )
@@ -2939,6 +2951,7 @@ async function prerenderToStream(
2939
2951
stale : INFINITE_CACHE ,
2940
2952
tags : [ ...implicitTags . tags ] ,
2941
2953
prerenderResumeDataCache,
2954
+ hmrRefreshHash : undefined ,
2942
2955
} )
2943
2956
2944
2957
const finalAttemptRSCPayload = await workUnitAsyncStorage . run (
@@ -3008,6 +3021,7 @@ async function prerenderToStream(
3008
3021
stale : INFINITE_CACHE ,
3009
3022
tags : [ ...implicitTags . tags ] ,
3010
3023
prerenderResumeDataCache,
3024
+ hmrRefreshHash : undefined ,
3011
3025
}
3012
3026
3013
3027
let clientIsDynamic = false
@@ -3242,6 +3256,7 @@ async function prerenderToStream(
3242
3256
stale : INFINITE_CACHE ,
3243
3257
tags : [ ...implicitTags . tags ] ,
3244
3258
prerenderResumeDataCache,
3259
+ hmrRefreshHash : undefined ,
3245
3260
} )
3246
3261
3247
3262
const initialClientController = new AbortController ( )
@@ -3259,6 +3274,7 @@ async function prerenderToStream(
3259
3274
stale : INFINITE_CACHE ,
3260
3275
tags : [ ...implicitTags . tags ] ,
3261
3276
prerenderResumeDataCache,
3277
+ hmrRefreshHash : undefined ,
3262
3278
} )
3263
3279
3264
3280
// We're not going to use the result of this render because the only time it could be used
@@ -3412,6 +3428,7 @@ async function prerenderToStream(
3412
3428
stale : INFINITE_CACHE ,
3413
3429
tags : [ ...implicitTags . tags ] ,
3414
3430
prerenderResumeDataCache,
3431
+ hmrRefreshHash : undefined ,
3415
3432
} )
3416
3433
3417
3434
let clientIsDynamic = false
@@ -3436,6 +3453,7 @@ async function prerenderToStream(
3436
3453
stale : INFINITE_CACHE ,
3437
3454
tags : [ ...implicitTags . tags ] ,
3438
3455
prerenderResumeDataCache,
3456
+ hmrRefreshHash : undefined ,
3439
3457
} )
3440
3458
3441
3459
const finalServerPayload = await workUnitAsyncStorage . run (
0 commit comments