Skip to content

Commit d4ff236

Browse files
authored
Reuse RenderWorker type (#53782)
Found that this type was duplicated. This just reuses the existing definition.
1 parent 89be8c4 commit d4ff236

File tree

1 file changed

+3
-8
lines changed
  • packages/next/src/server/lib/server-ipc

1 file changed

+3
-8
lines changed

packages/next/src/server/lib/server-ipc/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import crypto from 'crypto'
77
import isError from '../../../lib/is-error'
88
import { genRenderExecArgv } from '../worker-utils'
99
import { deserializeErr } from './request-utils'
10+
import { RenderWorker } from '../router-server'
1011

1112
// we can't use process.send as jest-worker relies on
1213
// it already and can cause unexpected message errors
@@ -87,7 +88,7 @@ export const createWorker = async (
8788
isNodeDebugging: boolean | 'brk' | undefined,
8889
type: 'pages' | 'app',
8990
nextConfig: NextConfigComplete
90-
) => {
91+
): Promise<RenderWorker> => {
9192
const { initialEnv } = require('@next/env') as typeof import('@next/env')
9293
const useServerActions = !!nextConfig.experimental.serverActions
9394
const { Worker } =
@@ -133,13 +134,7 @@ export const createWorker = async (
133134
'clearModuleContext',
134135
'propagateServerField',
135136
],
136-
}) as any as InstanceType<typeof Worker> & {
137-
initialize: typeof import('../render-server').initialize
138-
deleteCache: typeof import('../render-server').deleteCache
139-
deleteAppClientCache: typeof import('../render-server').deleteAppClientCache
140-
clearModuleContext: typeof import('../render-server').clearModuleContext
141-
propagateServerField: typeof import('../render-server').propagateServerField
142-
}
137+
}) as any as RenderWorker
143138

144139
worker.getStderr().pipe(process.stderr)
145140
worker.getStdout().pipe(process.stdout)

0 commit comments

Comments
 (0)