@@ -76,11 +76,7 @@ import {
76
76
} from '../telemetry/events'
77
77
import { Telemetry } from '../telemetry/storage'
78
78
import { CompilerResult , runCompiler } from './compiler'
79
- import {
80
- createEntrypoints ,
81
- createPagesMapping ,
82
- getPageRuntime ,
83
- } from './entries'
79
+ import { createEntrypoints , createPagesMapping } from './entries'
84
80
import { generateBuildId } from './generate-build-id'
85
81
import { isWriteable } from './is-writeable'
86
82
import * as Log from './output/log'
@@ -157,10 +153,11 @@ export default async function build(
157
153
setGlobal ( 'phase' , PHASE_PRODUCTION_BUILD )
158
154
setGlobal ( 'distDir' , distDir )
159
155
160
- // We enable concurrent features (Fizz-related rendering architecture) when
161
- // using React 18 or experimental.
156
+ // Currently, when the runtime option is set (either `nodejs` or `edge`),
157
+ // we enable concurrent features (Fizz-related rendering architecture).
158
+ const runtime = config . experimental . runtime
162
159
const hasReactRoot = shouldUseReactRoot ( )
163
- const hasConcurrentFeatures = hasReactRoot
160
+ const hasConcurrentFeatures = ! ! runtime
164
161
165
162
const hasServerComponents =
166
163
hasReactRoot && ! ! config . experimental . serverComponents
@@ -625,7 +622,6 @@ export default async function build(
625
622
entrypoints : entrypoints . client ,
626
623
rewrites,
627
624
runWebpackSpan,
628
- hasReactRoot,
629
625
} ) ,
630
626
getBaseWebpackConfig ( dir , {
631
627
buildId,
@@ -637,7 +633,6 @@ export default async function build(
637
633
entrypoints : entrypoints . server ,
638
634
rewrites,
639
635
runWebpackSpan,
640
- hasReactRoot,
641
636
} ) ,
642
637
hasReactRoot
643
638
? getBaseWebpackConfig ( dir , {
@@ -651,7 +646,6 @@ export default async function build(
651
646
entrypoints : entrypoints . edgeServer ,
652
647
rewrites,
653
648
runWebpackSpan,
654
- hasReactRoot,
655
649
} )
656
650
: null ,
657
651
] )
@@ -960,22 +954,10 @@ export default async function build(
960
954
let ssgPageRoutes : string [ ] | null = null
961
955
let isMiddlewareRoute = ! ! page . match ( MIDDLEWARE_ROUTE )
962
956
963
- const pagePath = pagePaths . find ( ( _path ) =>
964
- _path . startsWith ( actualPage + '.' )
965
- )
966
- const pageRuntime =
967
- hasConcurrentFeatures && pagePath
968
- ? await getPageRuntime (
969
- join ( pagesDir , pagePath ) ,
970
- config . experimental . runtime
971
- )
972
- : null
973
-
974
957
if (
975
958
! isMiddlewareRoute &&
976
959
! isReservedPage ( page ) &&
977
- // We currently don't support staic optimization in the Edge runtime.
978
- pageRuntime !== 'edge'
960
+ ! hasConcurrentFeatures
979
961
) {
980
962
try {
981
963
let isPageStaticSpan =
@@ -1501,7 +1483,10 @@ export default async function build(
1501
1483
1502
1484
const combinedPages = [ ...staticPages , ...ssgPages ]
1503
1485
1504
- if ( combinedPages . length > 0 || useStatic404 || useDefaultStatic500 ) {
1486
+ if (
1487
+ ! hasConcurrentFeatures &&
1488
+ ( combinedPages . length > 0 || useStatic404 || useDefaultStatic500 )
1489
+ ) {
1505
1490
const staticGenerationSpan = nextBuildSpan . traceChild ( 'static-generation' )
1506
1491
await staticGenerationSpan . traceAsyncFn ( async ( ) => {
1507
1492
detectConflictingPaths (
0 commit comments