Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix page url for edge routes in app dir (#40361)
For edge routes in app dir, we passed the page name as url so that the url will be incorrect: * a non-dynamic route `/dashboard` will become `/dashboard/page` * a dynamic route `/dynamic/[id]` with url `/dyanmic/123` will still hit `/dynamic/page/[id]/page` This PR uses normalized `params.page` with interoplated as correct pathname for the page.
- Loading branch information
Showing
5 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
test/e2e/app-dir/rsc-basic/app/edge/dynamic/[id]/page.server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function page() { | ||
return 'dynamic route [id] page' | ||
} | ||
|
||
export const config = { | ||
runtime: 'experimental-edge', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function page() { | ||
return 'dynamic route index page' | ||
} | ||
|
||
export const config = { | ||
runtime: 'experimental-edge', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters