Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
5b708c72
Commit
5b708c72
authored
Feb 14, 2026
by
devjiwonchoi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix PageType
parent
4436f5ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
mod.rs
crates/next-core/src/next_app/mod.rs
+26
-2
No files found.
crates/next-core/src/next_app/mod.rs
View file @
5b708c72
...
...
@@ -249,9 +249,11 @@ impl AppPage {
if
let
Some
(
last
)
=
app_page
.
0
.last_mut
()
&&
let
PageSegment
::
Static
(
last_name
)
=
&*
last
{
if
last_name
.starts_with
(
"page."
)
{
// We normalize both file-style leaves (`page.tsx`/`route.ts`) and
// debug-build-path leaves (`page`/`route`) to the same PageType.
if
last_name
==
"page"
||
last_name
.starts_with
(
"page."
)
{
*
last
=
PageSegment
::
PageType
(
PageType
::
Page
);
}
else
if
last_name
.starts_with
(
"route
"
)
{
}
else
if
last_name
==
"route"
||
last_name
.starts_with
(
"route.
"
)
{
*
last
=
PageSegment
::
PageType
(
PageType
::
Route
);
}
// can also be metadata (and be neither Page nor Route)
...
...
@@ -558,6 +560,17 @@ mod test {
])
);
assert_eq!
(
AppPage
::
parse
(
"(group)/foo/@par/bar/page"
)
.unwrap
(),
AppPage
(
vec!
[
PageSegment
::
Group
(
"group"
.into
()),
PageSegment
::
Static
(
"foo"
.into
()),
PageSegment
::
Parallel
(
"par"
.into
()),
PageSegment
::
Static
(
"bar"
.into
()),
PageSegment
::
PageType
(
PageType
::
Page
),
])
);
assert_eq!
(
AppPage
::
parse
(
"(group)/foo/@par/bar/route.tsx"
)
.unwrap
(),
AppPage
(
vec!
[
...
...
@@ -569,6 +582,17 @@ mod test {
])
);
assert_eq!
(
AppPage
::
parse
(
"(group)/foo/@par/bar/route"
)
.unwrap
(),
AppPage
(
vec!
[
PageSegment
::
Group
(
"group"
.into
()),
PageSegment
::
Static
(
"foo"
.into
()),
PageSegment
::
Parallel
(
"par"
.into
()),
PageSegment
::
Static
(
"bar"
.into
()),
PageSegment
::
PageType
(
PageType
::
Route
),
])
);
assert_eq!
(
AppPage
::
parse
(
"foo/sitemap"
)
.unwrap
(),
AppPage
(
vec!
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment