@@ -17,7 +17,6 @@ import type { FetchMetric } from '../base-http'
17
17
import { createDedupeFetch } from './dedupe-fetch'
18
18
import {
19
19
getCacheSignal ,
20
- type RequestStore ,
21
20
type RevalidateStore ,
22
21
type WorkUnitAsyncStorage ,
23
22
} from '../app-render/work-unit-async-storage.external'
@@ -30,7 +29,6 @@ import {
30
29
} from '../response-cache'
31
30
import { cloneResponse } from './clone-response'
32
31
import type { IncrementalCache } from './incremental-cache'
33
- import { InvariantError } from '../../shared/lib/invariant-error'
34
32
35
33
const isEdgeRuntime = process . env . NEXT_RUNTIME === 'edge'
36
34
@@ -573,7 +571,7 @@ export function createPatchedFetcher(
573
571
cacheSignal = null
574
572
}
575
573
// TODO(restart-on-cache-miss): block dynamic when filling caches
576
- await dynamicInDevStagedRendering ( workUnitStore )
574
+ await getTimeoutBoundary ( )
577
575
}
578
576
break
579
577
case 'prerender-ppr' :
@@ -698,7 +696,7 @@ export function createPatchedFetcher(
698
696
cacheSignal = null
699
697
}
700
698
// TODO(restart-on-cache-miss): block dynamic when filling caches
701
- await dynamicInDevStagedRendering ( workUnitStore )
699
+ await getTimeoutBoundary ( )
702
700
}
703
701
break
704
702
case 'prerender-ppr' :
@@ -968,7 +966,7 @@ export function createPatchedFetcher(
968
966
process . env . NODE_ENV === 'development' &&
969
967
isStagedRenderingInDev
970
968
) {
971
- await dynamicInDevStagedRendering ( workUnitStore )
969
+ await getTimeoutBoundary ( )
972
970
}
973
971
break
974
972
case 'prerender-ppr' :
@@ -1089,7 +1087,7 @@ export function createPatchedFetcher(
1089
1087
cacheSignal = null
1090
1088
}
1091
1089
// TODO(restart-on-cache-miss): block dynamic when filling caches
1092
- await dynamicInDevStagedRendering ( workUnitStore )
1090
+ await getTimeoutBoundary ( )
1093
1091
}
1094
1092
break
1095
1093
case 'prerender-ppr' :
@@ -1134,7 +1132,7 @@ export function createPatchedFetcher(
1134
1132
isStagedRenderingInDev
1135
1133
) {
1136
1134
// TODO(restart-on-cache-miss): block dynamic when filling caches
1137
- await dynamicInDevStagedRendering ( workUnitStore )
1135
+ await getTimeoutBoundary ( )
1138
1136
}
1139
1137
break
1140
1138
case 'cache' :
@@ -1286,29 +1284,3 @@ function getTimeoutBoundary() {
1286
1284
}
1287
1285
return currentTimeoutBoundary
1288
1286
}
1289
-
1290
- async function dynamicInDevStagedRendering ( requestStore : RequestStore ) {
1291
- if (
1292
- process . env . NODE_ENV === 'development' &&
1293
- process . env . __NEXT_CACHE_COMPONENTS
1294
- ) {
1295
- if ( requestStore . cacheSignal ) {
1296
- // TODO(restart-on-cache-miss): block dynamic more effectively.
1297
- // Ideally, we'd hang here -- if the render acts as a warmup, there's no need to execute dynamic requests.
1298
- // But we can *only* hang if the render ends up being a warmup and gets discarded --
1299
- // if it's used as is, we have to resolve the fetch eventually.
1300
- // This coordination mechanism will be implemented in a follow-up,
1301
- // for now it's enough to delay.
1302
- await getTimeoutBoundary ( )
1303
- await getTimeoutBoundary ( )
1304
- } else {
1305
- // We don't have a cacheSignal, so this is the final (restarted) render.
1306
- // Don't block, but delay to prevent this from resolving in the static stage.
1307
- await getTimeoutBoundary ( )
1308
- }
1309
- } else {
1310
- throw new InvariantError (
1311
- 'dynamicInDevStagedRendering should only be used in development mode and when Cache Components is enabled.'
1312
- )
1313
- }
1314
- }
0 commit comments