File tree 3 files changed +12
-6
lines changed
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ export { tree, pages }
21
21
export { default as GlobalError } from 'VAR_MODULE_GLOBAL_ERROR' with { 'turbopack-transition' : 'next-server-utility' }
22
22
23
23
// These are injected by the loader afterwards.
24
- declare const __next_app_require__ : any
25
- declare const __next_app_load_chunk__ : any
24
+ declare const __next_app_require__ : ( id : string | number ) => unknown
25
+ declare const __next_app_load_chunk__ : ( id : string | number ) => Promise < unknown >
26
26
27
27
// INJECT:__next_app_require__
28
28
// INJECT:__next_app_load_chunk__
Original file line number Diff line number Diff line change @@ -1117,7 +1117,9 @@ async function renderToHTMLOrFlightImpl(
1117
1117
// to treat chunk loading with similar semantics as cache reads to avoid
1118
1118
// async loading chunks from causing a prerender to abort too early.
1119
1119
// @ts -ignore
1120
- globalThis . __next_chunk_load__ = ( ...args : Array < any > ) => {
1120
+ globalThis . __next_chunk_load__ = (
1121
+ ...args : Parameters < typeof instrumented . loadChunk >
1122
+ ) => {
1121
1123
const loadingChunk = instrumented . loadChunk ( ...args )
1122
1124
trackChunkLoading ( loadingChunk )
1123
1125
return loadingChunk
Original file line number Diff line number Diff line change
1
+ import type { AppPageModule } from './route-modules/app-page/module'
2
+
1
3
// Combined load times for loading client components
2
4
let clientComponentLoadStart = 0
3
5
let clientComponentLoadTimes = 0
4
6
let clientComponentLoadCount = 0
5
7
6
- export function wrapClientComponentLoader ( ComponentMod : any ) {
8
+ export function wrapClientComponentLoader (
9
+ ComponentMod : AppPageModule
10
+ ) : AppPageModule [ '__next_app__' ] {
7
11
if ( ! ( 'performance' in globalThis ) ) {
8
12
return ComponentMod . __next_app__
9
13
}
10
14
11
15
return {
12
- require : ( ...args : any [ ] ) => {
16
+ require : ( ...args ) => {
13
17
const startTime = performance . now ( )
14
18
15
19
if ( clientComponentLoadStart === 0 ) {
@@ -23,7 +27,7 @@ export function wrapClientComponentLoader(ComponentMod: any) {
23
27
clientComponentLoadTimes += performance . now ( ) - startTime
24
28
}
25
29
} ,
26
- loadChunk : ( ...args : any [ ] ) => {
30
+ loadChunk : ( ...args ) => {
27
31
const startTime = performance . now ( )
28
32
try {
29
33
return ComponentMod . __next_app__ . loadChunk ( ...args )
You can’t perform that action at this time.
0 commit comments