Skip to content

Commit 0a42be9

Browse files
authored
Represent "virtual" segments like route groups (#82422)
Small update to #82383. Instead of using a special symbol to represent the "virtual" segments that get inserted into the loader tree for parallel routes, we can represent them like route groups, since they serve the same purpose. That will allow us to remove a special case in the param parsing logic, since we have to skip groups regardless; both will be skipped by the same check.
1 parent 5c9d855 commit 0a42be9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/next-core/src/app_structure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ async fn directory_tree_to_loader_tree_internal(
10541054
let current_level_is_parallel_route = is_parallel_route(&directory_name);
10551055

10561056
if current_level_is_parallel_route {
1057-
tree.segment = rcstr!("__virtual_segment__");
1057+
tree.segment = rcstr!("(slot)");
10581058
}
10591059

10601060
if let Some(page) = (app_path == for_app_path || app_path.is_catchall())

packages/next/src/build/webpack/loaders/next-app-loader/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ async function createTreeCodeFromPath(
397397
// should instead be the corresponding segment keys (ie `__PAGE__`) or the `children` parallel route.
398398
parallelSegmentKey =
399399
parallelSegmentKey === PARALLEL_VIRTUAL_SEGMENT
400-
? '__virtual_segment__'
400+
? '(slot)'
401401
: parallelSegmentKey === PAGE_SEGMENT
402402
? PAGE_SEGMENT_KEY
403403
: parallelSegmentKey

0 commit comments

Comments
 (0)