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
34a40fd9
Unverified
Commit
34a40fd9
authored
Oct 19, 2025
by
Tim Neutkens
Committed by
GitHub
Oct 19, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Development: Implement request time for Pages Router (#85012)
## What? Implemented #84906 for Pages Router.
parent
b02583b7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
pages-api.ts
packages/next/src/build/templates/pages-api.ts
+4
-0
pages-handler.ts
...ages/next/src/server/route-modules/pages/pages-handler.ts
+7
-0
No files found.
packages/next/src/build/templates/pages-api.ts
View file @
34a40fd9
...
@@ -13,6 +13,7 @@ import * as userland from 'VAR_USERLAND'
...
@@ -13,6 +13,7 @@ import * as userland from 'VAR_USERLAND'
import
{
getTracer
,
SpanKind
}
from
'../../server/lib/trace/tracer'
import
{
getTracer
,
SpanKind
}
from
'../../server/lib/trace/tracer'
import
{
BaseServerSpan
}
from
'../../server/lib/trace/constants'
import
{
BaseServerSpan
}
from
'../../server/lib/trace/constants'
import
type
{
InstrumentationOnRequestError
}
from
'../../server/instrumentation/types'
import
type
{
InstrumentationOnRequestError
}
from
'../../server/instrumentation/types'
import
{
addRequestMeta
}
from
'../../server/request-meta'
// Re-export the handler (should be the default export).
// Re-export the handler (should be the default export).
export
default
hoist
(
userland
,
'default'
)
export
default
hoist
(
userland
,
'default'
)
...
@@ -42,6 +43,9 @@ export async function handler(
...
@@ -42,6 +43,9 @@ export async function handler(
waitUntil
?:
(
prom
:
Promise
<
void
>
)
=>
void
waitUntil
?:
(
prom
:
Promise
<
void
>
)
=>
void
}
}
):
Promise
<
void
>
{
):
Promise
<
void
>
{
if
(
routeModule
.
isDev
)
{
addRequestMeta
(
req
,
'devRequestTimingInternalsEnd'
,
process
.
hrtime
.
bigint
())
}
let
srcPage
=
'VAR_DEFINITION_PAGE'
let
srcPage
=
'VAR_DEFINITION_PAGE'
// turbopack doesn't normalize `/index` in the page name
// turbopack doesn't normalize `/index` in the page name
...
...
packages/next/src/server/route-modules/pages/pages-handler.ts
View file @
34a40fd9
...
@@ -69,6 +69,13 @@ export const getHandler = ({
...
@@ -69,6 +69,13 @@ export const getHandler = ({
waitUntil
:
(
prom
:
Promise
<
void
>
)
=>
void
waitUntil
:
(
prom
:
Promise
<
void
>
)
=>
void
}
}
):
Promise
<
void
>
{
):
Promise
<
void
>
{
if
(
routeModule
.
isDev
)
{
addRequestMeta
(
req
,
'devRequestTimingInternalsEnd'
,
process
.
hrtime
.
bigint
()
)
}
let
srcPage
=
originalSrcPage
let
srcPage
=
originalSrcPage
// turbopack doesn't normalize `/index` in the page name
// turbopack doesn't normalize `/index` in the page name
// so we need to to process dynamic routes properly
// so we need to to process dynamic routes properly
...
...
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