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
c8db3497
Commit
c8db3497
authored
Mar 29, 2026
by
Luke Sandberg
Committed by
Luke Sandberg
Mar 31, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify types even more
parent
52602936
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
36 deletions
+6
-36
app-page.ts
packages/next/src/build/templates/app-page.ts
+1
-3
index.ts
...s/next/src/build/webpack/loaders/next-app-loader/index.ts
+1
-1
app-render.tsx
packages/next/src/server/app-render/app-render.tsx
+1
-10
track-module-loading.external.ts
...pp-render/module-loading/track-module-loading.external.ts
+1
-2
track-module-loading.instance.ts
...pp-render/module-loading/track-module-loading.instance.ts
+0
-8
client-component-renderer-logger.ts
packages/next/src/server/client-component-renderer-logger.ts
+2
-12
No files found.
packages/next/src/build/templates/app-page.ts
View file @
c8db3497
...
...
@@ -98,9 +98,7 @@ declare const tree: LoaderTree
// These are injected by the loader afterwards.
declare
const
__next_app_require__
:
(
id
:
string
|
number
)
=>
unknown
declare
const
__next_app_load_chunk__
:
(
id
:
string
|
number
)
=>
Promise
<
unknown
>
|
void
declare
const
__next_app_load_chunk__
:
(
id
:
string
|
number
)
=>
void
// We inject the tree and pages here so that we can use them in the route
// module.
...
...
packages/next/src/build/webpack/loaders/next-app-loader/index.ts
View file @
c8db3497
...
...
@@ -1103,7 +1103,7 @@ const nextAppLoader: AppLoader = async function nextAppLoader() {
tree: treeCodeResult.treeCode,
__next_app_require__: '__webpack_require__',
// all modules are in the entry chunk, so we never actually need to load chunks in webpack
__next_app_load_chunk__: '() =>
Promise.resolve()
',
__next_app_load_chunk__: '() =>
undefined
',
}
)
...
...
packages/next/src/server/app-render/app-render.tsx
View file @
c8db3497
...
...
@@ -227,7 +227,6 @@ import { createServerInsertedMetadata } from './metadata-insertion/create-server
import
{
getPreviouslyRevalidatedTags
}
from
'../server-utils'
import
{
executeRevalidates
}
from
'../revalidation-utils'
import
{
trackPendingChunkLoad
,
trackPendingImport
,
trackPendingModules
,
}
from
'./module-loading/track-module-loading.external'
...
...
@@ -2195,15 +2194,7 @@ function installGlobalModuleLoadingHandlers(
}
// @ts-expect-error
globalThis
.
__next_chunk_load__
=
(
id
:
Parameters
<
typeof
instrumented
.
loadChunk
>
[
0
]
)
=>
{
const
result
=
instrumented
.
loadChunk
(
id
)
if
(
shouldTrackModuleLoading
())
{
trackPendingChunkLoad
(
result
)
}
return
result
}
globalThis
.
__next_chunk_load__
=
instrumented
.
loadChunk
}
async
function
renderToHTMLOrFlightImpl
(
...
...
packages/next/src/server/app-render/module-loading/track-module-loading.external.ts
View file @
c8db3497
...
...
@@ -3,9 +3,8 @@
// and helpers used in transformed page code (which register pending imports)
import
{
trackPendingChunkLoad
,
trackPendingImport
,
trackPendingModules
,
}
from
'./track-module-loading.instance'
with
{
'turbopack-transition'
:
'next-shared'
}
export
{
trackPending
ChunkLoad
,
trackPending
Import
,
trackPendingModules
}
export
{
trackPendingImport
,
trackPendingModules
}
packages/next/src/server/app-render/module-loading/track-module-loading.instance.ts
View file @
c8db3497
...
...
@@ -13,14 +13,6 @@ function getModuleLoadingSignal() {
return
_moduleLoadingSignal
}
export
function
trackPendingChunkLoad
(
promiseOrVoid
:
Promise
<
unknown
>
|
void
)
{
// On Node.js with Turbopack, chunk loading is synchronous and returns void.
// Only track when we have an actual promise.
if
(
!
promiseOrVoid
)
return
const
moduleLoadingSignal
=
getModuleLoadingSignal
()
moduleLoadingSignal
.
trackRead
(
promiseOrVoid
)
}
export
function
trackPendingImport
(
exportsOrPromise
:
unknown
)
{
const
moduleLoadingSignal
=
getModuleLoadingSignal
()
...
...
packages/next/src/server/client-component-renderer-logger.ts
View file @
c8db3497
...
...
@@ -29,18 +29,8 @@ export function wrapClientComponentLoader(
},
loadChunk
:
(
id
)
=>
{
const
startTime
=
performance
.
now
()
const
result
=
ComponentMod
.
__next_app__
.
loadChunk
(
id
)
if
(
result
)
{
// Avoid wrapping `loadChunk`'s result in an extra promise in case something like React depends on its identity.
// We only need to know when it's settled.
result
.
finally
(()
=>
{
clientComponentLoadTimes
+=
performance
.
now
()
-
startTime
})
}
else
{
// Synchronous chunk load (e.g. Node.js Turbopack runtime)
clientComponentLoadTimes
+=
performance
.
now
()
-
startTime
}
return
result
ComponentMod
.
__next_app__
.
loadChunk
(
id
)
clientComponentLoadTimes
+=
performance
.
now
()
-
startTime
},
}
}
...
...
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