File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
next-devtools/dev-overlay/components/overview Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import {
11
11
import { Tooltip } from '../../../components/tooltip'
12
12
import { useRef , useState } from 'react'
13
13
import {
14
- BOUNDARY_PREFIX ,
15
14
BUILTIN_PREFIX ,
15
+ getBoundaryOriginFileType ,
16
16
isBoundaryFile ,
17
17
normalizeBoundaryFilename ,
18
18
} from '../../../../server/app-render/segment-explorer-path'
@@ -147,7 +147,7 @@ function PageSegmentTreeLayerPresentation({
147
147
const childNode = node . children [ childKey ]
148
148
if ( ! childNode || ! childNode . value ) return
149
149
if ( isBoundaryFile ( childNode . value . type ) ) {
150
- const boundaryType = childNode . value . type . replace ( BOUNDARY_PREFIX , '' )
150
+ const boundaryType = getBoundaryOriginFileType ( childNode . value . type )
151
151
152
152
if ( boundaryType in boundaries ) {
153
153
boundaries [ boundaryType as keyof typeof boundaries ] =
Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ import type {
26
26
UseCachePageComponentProps ,
27
27
} from '../use-cache/use-cache-wrapper'
28
28
import { DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'
29
- import { getConventionPathByType } from './segment-explorer-path'
29
+ import {
30
+ BOUNDARY_PREFIX ,
31
+ getConventionPathByType ,
32
+ } from './segment-explorer-path'
30
33
31
34
/**
32
35
* Use the provided loader tree to create the React Component tree.
@@ -567,19 +570,19 @@ async function createComponentTreeInternal({
567
570
< >
568
571
{ notFoundFilePath && (
569
572
< SegmentViewNode
570
- type = { 'boundary: not-found' }
573
+ type = { ` ${ BOUNDARY_PREFIX } not-found` }
571
574
pagePath = { notFoundFilePath + fileNameSuffix }
572
575
/>
573
576
) }
574
577
{ loadingFilePath && (
575
578
< SegmentViewNode
576
- type = { 'boundary: loading' }
579
+ type = { ` ${ BOUNDARY_PREFIX } loading` }
577
580
pagePath = { loadingFilePath + fileNameSuffix }
578
581
/>
579
582
) }
580
583
{ errorFilePath && (
581
584
< SegmentViewNode
582
- type = { 'boundary: error' }
585
+ type = { ` ${ BOUNDARY_PREFIX } error` }
583
586
pagePath = { errorFilePath + fileNameSuffix }
584
587
/>
585
588
) }
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ export function isBoundaryFile(fileType: string) {
42
42
return fileType . startsWith ( BOUNDARY_PREFIX )
43
43
}
44
44
45
+ export function getBoundaryOriginFileType ( fileType : string ) {
46
+ return fileType . replace ( BOUNDARY_PREFIX , '' )
47
+ }
48
+
45
49
export function getConventionPathByType (
46
50
tree : LoaderTree ,
47
51
dir : string ,
You can’t perform that action at this time.
0 commit comments