@@ -36,6 +36,11 @@ export type OpaqueFallbackRouteParams = {
3636 * the route should be considered dynamic.
3737 */
3838 readonly parallel : number
39+
40+ /**
41+ * The total number of fallback route params.
42+ */
43+ readonly total : number
3944 }
4045
4146 /**
@@ -83,14 +88,15 @@ export function createOpaqueFallbackRouteParams(
8388 // be also be unique.
8489 const uniqueID = Math . random ( ) . toString ( 16 ) . slice ( 2 )
8590
86- const sizes = { route : 0 , parallel : 0 }
91+ const sizes = { route : 0 , parallel : 0 , total : 0 }
8792 const keys = new Map < string , string > ( )
8893
8994 for ( const { paramName, isParallelRouteParam } of fallbackRouteParams ) {
9095 // We need to track the sizes of the fallback route params to determine if
9196 // the render should be halted during static generation.
9297 if ( isParallelRouteParam ) sizes . parallel ++
9398 else sizes . route ++
99+ sizes . total ++
94100
95101 // Generate a unique key for the fallback route param, if this key is found
96102 // in the static output, it represents a bug in cache components.
@@ -102,10 +108,7 @@ export function createOpaqueFallbackRouteParams(
102108 has : keys . has . bind ( keys ) ,
103109 get : keys . get . bind ( keys ) ,
104110 * [ Symbol . iterator ] ( ) : IterableIterator < [ string , string ] > {
105- for ( const { paramName, isParallelRouteParam } of fallbackRouteParams ) {
106- // We only want to include the route segments, not the parallel route
107- // segments.
108- if ( isParallelRouteParam ) continue
111+ for ( const { paramName } of fallbackRouteParams ) {
109112 yield [ paramName , keys . get ( paramName ) ! ]
110113 }
111114 } ,
0 commit comments