Unverified Commit 6481c920 authored by Shu Ding's avatar Shu Ding Committed by GitHub

Refactor app-render to decouple type definitions (#47128

This changes make sure that the `app-render` module isn't being imported
by too many unnecessary places, as we'll later move the renderer into a
worker.
parent b590ec39
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { createPortal } from 'react-dom' import { createPortal } from 'react-dom'
import type { FlightRouterState } from '../../server/app-render' import type { FlightRouterState } from '../../server/app-render/types'
const ANNOUNCER_TYPE = 'next-route-announcer' const ANNOUNCER_TYPE = 'next-route-announcer'
const ANNOUNCER_ID = '__next-route-announcer__' const ANNOUNCER_ID = '__next-route-announcer__'
......
...@@ -12,7 +12,10 @@ import type { ...@@ -12,7 +12,10 @@ import type {
CacheNode, CacheNode,
AppRouterInstance, AppRouterInstance,
} from '../../shared/lib/app-router-context' } from '../../shared/lib/app-router-context'
import type { FlightRouterState, FlightData } from '../../server/app-render' import type {
FlightRouterState,
FlightData,
} from '../../server/app-render/types'
import type { ErrorComponent } from './error-boundary' import type { ErrorComponent } from './error-boundary'
import { reducer } from './router-reducer/router-reducer' import { reducer } from './router-reducer/router-reducer'
import { import {
......
...@@ -8,7 +8,7 @@ import type { ...@@ -8,7 +8,7 @@ import type {
FlightRouterState, FlightRouterState,
FlightSegmentPath, FlightSegmentPath,
ChildProp, ChildProp,
} from '../../server/app-render' } from '../../server/app-render/types'
import type { ErrorComponent } from './error-boundary' import type { ErrorComponent } from './error-boundary'
import { FocusAndScrollRef } from './router-reducer/router-reducer-types' import { FocusAndScrollRef } from './router-reducer/router-reducer-types'
......
import type { Segment } from '../../server/app-render' import type { Segment } from '../../server/app-render/types'
export const matchSegment = ( export const matchSegment = (
existingSegment: Segment, existingSegment: Segment,
......
// useLayoutSegments() // Only the segments for the current place. ['children', 'dashboard', 'children', 'integrations'] -> /dashboard/integrations (/dashboard/layout.js would get ['children', 'dashboard', 'children', 'integrations']) // useLayoutSegments() // Only the segments for the current place. ['children', 'dashboard', 'children', 'integrations'] -> /dashboard/integrations (/dashboard/layout.js would get ['children', 'dashboard', 'children', 'integrations'])
import { useContext, useMemo } from 'react' import { useContext, useMemo } from 'react'
import type { FlightRouterState } from '../../server/app-render' import type { FlightRouterState } from '../../server/app-render/types'
import { import {
AppRouterContext, AppRouterContext,
LayoutRouterContext, LayoutRouterContext,
......
import type { AsyncLocalStorage } from 'async_hooks' import type { AsyncLocalStorage } from 'async_hooks'
import { PreviewData } from '../../../types' import { PreviewData } from '../../../types'
import type { import type { ReadonlyHeaders } from '../../server/app-render/readonly-headers'
ReadonlyHeaders, import type { ReadonlyRequestCookies } from '../../server/app-render/readonly-request-cookies'
ReadonlyRequestCookies,
} from '../../server/app-render'
import { createAsyncLocalStorage } from './async-local-storage' import { createAsyncLocalStorage } from './async-local-storage'
export interface RequestStore { export interface RequestStore {
......
import React from 'react' import React from 'react'
import type { FlightData, FlightRouterState } from '../../../server/app-render' import type {
FlightData,
FlightRouterState,
} from '../../../server/app-render/types'
import { applyRouterStatePatchToTree } from './apply-router-state-patch-to-tree' import { applyRouterStatePatchToTree } from './apply-router-state-patch-to-tree'
const getInitialRouterStateTree = (): FlightRouterState => [ const getInitialRouterStateTree = (): FlightRouterState => [
......
import type { import type {
FlightRouterState, FlightRouterState,
FlightSegmentPath, FlightSegmentPath,
} from '../../../server/app-render' } from '../../../server/app-render/types'
import { matchSegment } from '../match-segments' import { matchSegment } from '../match-segments'
/** /**
......
import React from 'react' import React from 'react'
import { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context' import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context'
import { createInitialRouterState } from './create-initial-router-state' import { createInitialRouterState } from './create-initial-router-state'
......
import type { ReactNode } from 'react' import type { ReactNode } from 'react'
import type { CacheNode } from '../../../shared/lib/app-router-context' import type { CacheNode } from '../../../shared/lib/app-router-context'
import type { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
import { CacheStates } from '../../../shared/lib/app-router-context' import { CacheStates } from '../../../shared/lib/app-router-context'
import { createHrefFromUrl } from './create-href-from-url' import { createHrefFromUrl } from './create-href-from-url'
......
import { createOptimisticTree } from './create-optimistic-tree' import { createOptimisticTree } from './create-optimistic-tree'
import type { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
const getInitialRouterStateTree = (): FlightRouterState => [ const getInitialRouterStateTree = (): FlightRouterState => [
'', '',
......
import type { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
import { matchSegment } from '../match-segments' import { matchSegment } from '../match-segments'
/** /**
......
'use client' 'use client'
import { createFromFetch } from 'next/dist/compiled/react-server-dom-webpack/client' import { createFromFetch } from 'next/dist/compiled/react-server-dom-webpack/client'
import type { FlightRouterState, FlightData } from '../../../server/app-render' import type {
FlightRouterState,
FlightData,
} from '../../../server/app-render/types'
import { import {
NEXT_ROUTER_PREFETCH, NEXT_ROUTER_PREFETCH,
NEXT_ROUTER_STATE_TREE, NEXT_ROUTER_STATE_TREE,
......
import React from 'react' import React from 'react'
import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data'
import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context'
import { FlightData } from '../../../server/app-render' import type { FlightData } from '../../../server/app-render/types'
const getFlightData = (): FlightData => { const getFlightData = (): FlightData => {
return [ return [
......
import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context' import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context'
import type { FlightDataPath } from '../../../server/app-render' import type { FlightDataPath } from '../../../server/app-render/types'
import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state' import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state'
import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'
......
import React from 'react' import React from 'react'
import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'
import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context'
import { FlightData } from '../../../server/app-render' import type { FlightData } from '../../../server/app-render/types'
const getFlightData = (): FlightData => { const getFlightData = (): FlightData => {
return [ return [
......
import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context' import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context'
import type { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
export function fillLazyItemsTillLeafWithHead( export function fillLazyItemsTillLeafWithHead(
newCache: CacheNode, newCache: CacheNode,
......
import React from 'react' import React from 'react'
import type { FlightData } from '../../../server/app-render' import type { FlightData } from '../../../server/app-render/types'
import { invalidateCacheBelowFlightSegmentPath } from './invalidate-cache-below-flight-segmentpath' import { invalidateCacheBelowFlightSegmentPath } from './invalidate-cache-below-flight-segmentpath'
import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context'
import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data'
......
import type { CacheNode } from '../../../shared/lib/app-router-context' import type { CacheNode } from '../../../shared/lib/app-router-context'
import type { FlightSegmentPath } from '../../../server/app-render' import type { FlightSegmentPath } from '../../../server/app-render/types'
/** /**
* Fill cache up to the end of the flightSegmentPath, invalidating anything below it. * Fill cache up to the end of the flightSegmentPath, invalidating anything below it.
......
import React from 'react' import React from 'react'
import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state' import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state'
import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context'
import { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
describe('invalidateCacheByRouterState', () => { describe('invalidateCacheByRouterState', () => {
it('should invalidate the cache by router state', () => { it('should invalidate the cache by router state', () => {
......
import type { CacheNode } from '../../../shared/lib/app-router-context' import type { CacheNode } from '../../../shared/lib/app-router-context'
import type { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
/** /**
* Invalidate cache one level down from the router state. * Invalidate cache one level down from the router state.
......
import type { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
import { isNavigatingToNewRootLayout } from './is-navigating-to-new-root-layout' import { isNavigatingToNewRootLayout } from './is-navigating-to-new-root-layout'
describe('shouldHardNavigate', () => { describe('shouldHardNavigate', () => {
......
import type { FlightRouterState } from '../../../server/app-render' import type { FlightRouterState } from '../../../server/app-render/types'
export function isNavigatingToNewRootLayout( export function isNavigatingToNewRootLayout(
currentTree: FlightRouterState, currentTree: FlightRouterState,
......
import React from 'react' import React from 'react'
import { FlightRouterState } from '../../../../server/app-render' import type { FlightRouterState } from '../../../../server/app-render/types'
import { import {
CacheNode, CacheNode,
CacheStates, CacheStates,
......
import type { FlightRouterState } from '../../../../server/app-render' import type { FlightRouterState } from '../../../../server/app-render/types'
import type { ChildSegmentMap } from '../../../../shared/lib/app-router-context' import type { ChildSegmentMap } from '../../../../shared/lib/app-router-context'
export function findHeadInCache( export function findHeadInCache(
......
import React from 'react' import React from 'react'
import type { fetchServerResponse as fetchServerResponseType } from '../fetch-server-response' import type { fetchServerResponse as fetchServerResponseType } from '../fetch-server-response'
import type { FlightData } from '../../../../server/app-render' import type { FlightData } from '../../../../server/app-render/types'
const flightData: FlightData = [ const flightData: FlightData = [
[ [
'children', 'children',
...@@ -68,7 +68,7 @@ jest.mock('../fetch-server-response', () => { ...@@ -68,7 +68,7 @@ jest.mock('../fetch-server-response', () => {
}, },
} }
}) })
import { FlightRouterState } from '../../../../server/app-render' import { FlightRouterState } from '../../../../server/app-render/types'
import { import {
CacheNode, CacheNode,
CacheStates, CacheStates,
......
...@@ -5,7 +5,7 @@ import { ...@@ -5,7 +5,7 @@ import {
import type { import type {
FlightDataPath, FlightDataPath,
FlightSegmentPath, FlightSegmentPath,
} from '../../../../server/app-render' } from '../../../../server/app-render/types'
import { fetchServerResponse } from '../fetch-server-response' import { fetchServerResponse } from '../fetch-server-response'
import { createRecordFromThenable } from '../create-record-from-thenable' import { createRecordFromThenable } from '../create-record-from-thenable'
import { readRecordValue } from '../read-record-value' import { readRecordValue } from '../read-record-value'
......
import React from 'react' import React from 'react'
import type { fetchServerResponse as fetchServerResponseType } from '../fetch-server-response' import type { fetchServerResponse as fetchServerResponseType } from '../fetch-server-response'
import type { FlightData } from '../../../../server/app-render' import type { FlightData } from '../../../../server/app-render/types'
jest.mock('../fetch-server-response', () => { jest.mock('../fetch-server-response', () => {
const flightData: FlightData = [ const flightData: FlightData = [
[ [
...@@ -32,7 +32,7 @@ jest.mock('../fetch-server-response', () => { ...@@ -32,7 +32,7 @@ jest.mock('../fetch-server-response', () => {
}, },
} }
}) })
import { FlightRouterState } from '../../../../server/app-render' import { FlightRouterState } from '../../../../server/app-render/types'
import { import {
CacheNode, CacheNode,
CacheStates, CacheStates,
......
import React from 'react' import React from 'react'
import type { fetchServerResponse } from '../fetch-server-response' import type { fetchServerResponse } from '../fetch-server-response'
import type { FlightData } from '../../../../server/app-render' import type { FlightData } from '../../../../server/app-render/types'
jest.mock('../fetch-server-response', () => { jest.mock('../fetch-server-response', () => {
const flightData: FlightData = [ const flightData: FlightData = [
[ [
...@@ -39,7 +39,7 @@ jest.mock('../fetch-server-response', () => { ...@@ -39,7 +39,7 @@ jest.mock('../fetch-server-response', () => {
}, },
} }
}) })
import { FlightRouterState } from '../../../../server/app-render' import { FlightRouterState } from '../../../../server/app-render/types'
import { import {
CacheNode, CacheNode,
CacheStates, CacheStates,
......
import React from 'react' import React from 'react'
import { FlightRouterState } from '../../../../server/app-render' import type { FlightRouterState } from '../../../../server/app-render/types'
import { import {
CacheNode, CacheNode,
CacheStates, CacheStates,
......
...@@ -3,7 +3,7 @@ import type { fetchServerResponse as fetchServerResponseType } from '../fetch-se ...@@ -3,7 +3,7 @@ import type { fetchServerResponse as fetchServerResponseType } from '../fetch-se
import type { import type {
FlightData, FlightData,
FlightRouterState, FlightRouterState,
} from '../../../../server/app-render' } from '../../../../server/app-render/types'
jest.mock('../fetch-server-response', () => { jest.mock('../fetch-server-response', () => {
const flightData: FlightData = [ const flightData: FlightData = [
[ [
......
import type { CacheNode } from '../../../shared/lib/app-router-context' import type { CacheNode } from '../../../shared/lib/app-router-context'
import type { FlightRouterState, FlightData } from '../../../server/app-render' import type {
FlightRouterState,
FlightData,
} from '../../../server/app-render/types'
import { fetchServerResponse } from './fetch-server-response' import { fetchServerResponse } from './fetch-server-response'
export const ACTION_REFRESH = 'refresh' export const ACTION_REFRESH = 'refresh'
......
import React from 'react' import React from 'react'
import type { FlightData, FlightRouterState } from '../../../server/app-render' import type {
FlightData,
FlightRouterState,
} from '../../../server/app-render/types'
import { shouldHardNavigate } from './should-hard-navigate' import { shouldHardNavigate } from './should-hard-navigate'
describe('shouldHardNavigate', () => { describe('shouldHardNavigate', () => {
......
...@@ -2,7 +2,7 @@ import type { ...@@ -2,7 +2,7 @@ import type {
FlightRouterState, FlightRouterState,
FlightDataPath, FlightDataPath,
Segment, Segment,
} from '../../../server/app-render' } from '../../../server/app-render/types'
import { matchSegment } from '../match-segments' import { matchSegment } from '../match-segments'
// TODO-APP: flightSegmentPath will be empty in case of static response, needs to be handled. // TODO-APP: flightSegmentPath will be empty in case of static response, needs to be handled.
......
import type { IncomingHttpHeaders } from 'http'
const INTERNAL_HEADERS_INSTANCE = Symbol('internal for headers readonly')
function readonlyHeadersError() {
return new Error('ReadonlyHeaders cannot be modified')
}
export class ReadonlyHeaders {
[INTERNAL_HEADERS_INSTANCE]: Headers
entries: Headers['entries']
forEach: Headers['forEach']
get: Headers['get']
has: Headers['has']
keys: Headers['keys']
values: Headers['values']
constructor(headers: IncomingHttpHeaders) {
// Since `new Headers` uses `this.append()` to fill the headers object ReadonlyHeaders can't extend from Headers directly as it would throw.
const headersInstance = new Headers(headers as any)
this[INTERNAL_HEADERS_INSTANCE] = headersInstance
this.entries = headersInstance.entries.bind(headersInstance)
this.forEach = headersInstance.forEach.bind(headersInstance)
this.get = headersInstance.get.bind(headersInstance)
this.has = headersInstance.has.bind(headersInstance)
this.keys = headersInstance.keys.bind(headersInstance)
this.values = headersInstance.values.bind(headersInstance)
}
[Symbol.iterator]() {
return this[INTERNAL_HEADERS_INSTANCE][Symbol.iterator]()
}
append() {
throw readonlyHeadersError()
}
delete() {
throw readonlyHeadersError()
}
set() {
throw readonlyHeadersError()
}
}
import { RequestCookies } from '../web/spec-extension/cookies'
const INTERNAL_COOKIES_INSTANCE = Symbol('internal for cookies readonly')
class ReadonlyRequestCookiesError extends Error {
message =
'ReadonlyRequestCookies cannot be modified. Read more: https://nextjs.org/api-reference/cookies'
}
export class ReadonlyRequestCookies {
[INTERNAL_COOKIES_INSTANCE]: RequestCookies
get: RequestCookies['get']
getAll: RequestCookies['getAll']
has: RequestCookies['has']
constructor(request: {
headers: {
get(key: 'cookie'): string | null | undefined
}
}) {
// Since `new Headers` uses `this.append()` to fill the headers object ReadonlyHeaders can't extend from Headers directly as it would throw.
// Request overridden to not have to provide a fully request object.
const cookiesInstance = new RequestCookies(request.headers as Headers)
this[INTERNAL_COOKIES_INSTANCE] = cookiesInstance
this.get = cookiesInstance.get.bind(cookiesInstance)
this.getAll = cookiesInstance.getAll.bind(cookiesInstance)
this.has = cookiesInstance.has.bind(cookiesInstance)
}
[Symbol.iterator]() {
return (this[INTERNAL_COOKIES_INSTANCE] as any)[Symbol.iterator]()
}
clear() {
throw new ReadonlyRequestCookiesError()
}
delete() {
throw new ReadonlyRequestCookiesError()
}
set() {
throw new ReadonlyRequestCookiesError()
}
}
import type { LoadComponentsReturnType } from '../load-components'
import type { ServerRuntime } from '../../../types'
import type {
FlightCSSManifest,
FlightManifest,
} from '../../build/webpack/plugins/flight-manifest-plugin'
import type { NextFontManifest } from '../../build/webpack/plugins/next-font-manifest-plugin'
import zod from 'next/dist/compiled/zod'
export type DynamicParamTypes = 'catchall' | 'optional-catchall' | 'dynamic'
const dynamicParamTypesSchema = zod.enum(['c', 'oc', 'd'])
/**
* c = catchall
* oc = optional catchall
* d = dynamic
*/
export type DynamicParamTypesShort = zod.infer<typeof dynamicParamTypesSchema>
const segmentSchema = zod.union([
zod.string(),
zod.tuple([zod.string(), zod.string(), dynamicParamTypesSchema]),
])
/**
* Segment in the router state.
*/
export type Segment = zod.infer<typeof segmentSchema>
export const flightRouterStateSchema: zod.ZodType<FlightRouterState> = zod.lazy(
() => {
const parallelRoutesSchema = zod.record(flightRouterStateSchema)
const urlSchema = zod.string().nullable().optional()
const refreshSchema = zod.literal('refetch').nullable().optional()
const isRootLayoutSchema = zod.boolean().optional()
// Due to the lack of optional tuple types in Zod, we need to use union here.
// https://github.com/colinhacks/zod/issues/1465
return zod.union([
zod.tuple([
segmentSchema,
parallelRoutesSchema,
urlSchema,
refreshSchema,
isRootLayoutSchema,
]),
zod.tuple([
segmentSchema,
parallelRoutesSchema,
urlSchema,
refreshSchema,
]),
zod.tuple([segmentSchema, parallelRoutesSchema, urlSchema]),
zod.tuple([segmentSchema, parallelRoutesSchema]),
])
}
)
/**
* Router state
*/
export type FlightRouterState = [
segment: Segment,
parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },
url?: string | null,
refresh?: 'refetch' | null,
isRootLayout?: boolean
]
/**
* Individual Flight response path
*/
export type FlightSegmentPath =
// Uses `any` as repeating pattern can't be typed.
| any[]
// Looks somewhat like this
| [
segment: Segment,
parallelRouterKey: string,
segment: Segment,
parallelRouterKey: string,
segment: Segment,
parallelRouterKey: string
]
export type FlightDataPath =
// Uses `any` as repeating pattern can't be typed.
| any[]
// Looks somewhat like this
| [
// Holds full path to the segment.
...FlightSegmentPath[],
/* segment of the rendered slice: */ Segment,
/* treePatch */ FlightRouterState,
/* subTreeData: */ React.ReactNode | null, // Can be null during prefetch if there's no loading component
/* head */ React.ReactNode | null
]
/**
* The Flight response data
*/
export type FlightData = Array<FlightDataPath> | string
/**
* Property holding the current subTreeData.
*/
export type ChildProp = {
/**
* Null indicates that the tree is partial
*/
current: React.ReactNode | null
segment: Segment
}
export type RenderOptsPartial = {
err?: Error | null
dev?: boolean
serverComponentManifest?: FlightManifest
serverCSSManifest?: FlightCSSManifest
supportsDynamicHTML: boolean
runtime?: ServerRuntime
serverComponents?: boolean
assetPrefix?: string
nextFontManifest?: NextFontManifest
isBot?: boolean
incrementalCache?: import('../lib/incremental-cache').IncrementalCache
isRevalidate?: boolean
nextExport?: boolean
appDirDevErrorLogger?: (err: any) => Promise<void>
}
export type RenderOpts = LoadComponentsReturnType & RenderOptsPartial
...@@ -3,11 +3,9 @@ import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'http' ...@@ -3,11 +3,9 @@ import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'http'
import type { AsyncLocalStorage } from 'async_hooks' import type { AsyncLocalStorage } from 'async_hooks'
import type { PreviewData } from '../../../types' import type { PreviewData } from '../../../types'
import type { RequestStore } from '../../client/components/request-async-storage' import type { RequestStore } from '../../client/components/request-async-storage'
import { import type { RenderOpts } from '../app-render/types'
ReadonlyHeaders, import { ReadonlyHeaders } from '../app-render/readonly-headers'
ReadonlyRequestCookies, import { ReadonlyRequestCookies } from '../app-render/readonly-request-cookies'
type RenderOpts,
} from '../app-render'
import { AsyncStorageWrapper } from './async-storage-wrapper' import { AsyncStorageWrapper } from './async-storage-wrapper'
import type { tryGetPreviewData } from '../api-utils/node' import type { tryGetPreviewData } from '../api-utils/node'
import type { BaseNextRequest, BaseNextResponse } from '../base-http' import type { BaseNextRequest, BaseNextResponse } from '../base-http'
......
...@@ -2,7 +2,10 @@ import type ws from 'ws' ...@@ -2,7 +2,10 @@ import type ws from 'ws'
import origDebug from 'next/dist/compiled/debug' import origDebug from 'next/dist/compiled/debug'
import type { webpack } from 'next/dist/compiled/webpack/webpack' import type { webpack } from 'next/dist/compiled/webpack/webpack'
import type { NextConfigComplete } from '../config-shared' import type { NextConfigComplete } from '../config-shared'
import type { DynamicParamTypesShort, FlightRouterState } from '../app-render' import type {
DynamicParamTypesShort,
FlightRouterState,
} from '../app-render/types'
import { EventEmitter } from 'events' import { EventEmitter } from 'events'
import { findPageFile } from '../lib/find-page-file' import { findPageFile } from '../lib/find-page-file'
......
import type { FlightRouterState } from './app-render' import type { FlightRouterState } from './app-render/types'
import { nonNullable } from '../lib/non-nullable' import { nonNullable } from '../lib/non-nullable'
import { getTracer } from './lib/trace/tracer' import { getTracer } from './lib/trace/tracer'
import { AppRenderSpan } from './lib/trace/constants' import { AppRenderSpan } from './lib/trace/constants'
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
import { FocusAndScrollRef } from '../../client/components/router-reducer/router-reducer-types' import { FocusAndScrollRef } from '../../client/components/router-reducer/router-reducer-types'
import type { fetchServerResponse } from '../../client/components/router-reducer/fetch-server-response' import type { fetchServerResponse } from '../../client/components/router-reducer/fetch-server-response'
import type { FlightRouterState, FlightData } from '../../server/app-render' import type {
FlightRouterState,
FlightData,
} from '../../server/app-render/types'
import React from 'react' import React from 'react'
export type ChildSegmentMap = Map<string, CacheNode> export type ChildSegmentMap = Map<string, CacheNode>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment