Skip to content

Commit 96fc439

Browse files
committed
remove unnecessary "../server" in the server directory
1 parent 3e8efe3 commit 96fc439

29 files changed

+62
-65
lines changed

packages/next/src/server/after/after-context.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { DetachedPromise } from '../../lib/detached-promise'
22
import { AsyncLocalStorage } from 'async_hooks'
33

4-
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
4+
import type { WorkStore } from '../app-render/work-async-storage.external'
55
import type { AfterContext } from './after-context'
66

77
describe('AfterContext', () => {
88
// 'async-local-storage.ts' needs `AsyncLocalStorage` on `globalThis` at import time,
99
// so we have to do some contortions here to set it up before running anything else
10-
type WASMod =
11-
typeof import('../../server/app-render/work-async-storage.external')
10+
type WASMod = typeof import('../app-render/work-async-storage.external')
1211
type AfterMod = typeof import('./after')
1312
type AfterContextMod = typeof import('./after-context')
1413

@@ -20,9 +19,7 @@ describe('AfterContext', () => {
2019
// @ts-expect-error
2120
globalThis.AsyncLocalStorage = AsyncLocalStorage
2221

23-
const WASMod = await import(
24-
'../../server/app-render/work-async-storage.external'
25-
)
22+
const WASMod = await import('../app-render/work-async-storage.external')
2623
workAsyncStorage = WASMod.workAsyncStorage
2724

2825
const AfterContextMod = await import('./after-context')

packages/next/src/server/after/after-context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import type { RequestLifecycleOpts } from '../base-server'
33
import type { AfterCallback, AfterTask } from './after'
44
import { InvariantError } from '../../shared/lib/invariant-error'
55
import { isThenable } from '../../shared/lib/is-thenable'
6-
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
6+
import { workAsyncStorage } from '../app-render/work-async-storage.external'
77
import { withExecuteRevalidates } from './revalidation-utils'
8-
import { bindSnapshot } from '../../server/app-render/async-local-storage'
8+
import { bindSnapshot } from '../app-render/async-local-storage'
99

1010
export type AfterContextOpts = {
1111
waitUntil: RequestLifecycleOpts['waitUntil'] | undefined

packages/next/src/server/after/after.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
2-
import { workUnitAsyncStorage } from '../../server/app-render/work-unit-async-storage.external'
1+
import { workAsyncStorage } from '../app-render/work-async-storage.external'
2+
import { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'
33
import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'
44

55
import { markCurrentScopeAsDynamic } from '../app-render/dynamic-rendering'

packages/next/src/server/after/revalidation-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
1+
import type { WorkStore } from '../app-render/work-async-storage.external'
22

33
/** Run a callback, and execute any *new* revalidations added during its runtime. */
44
export async function withExecuteRevalidates<T>(

packages/next/src/server/app-render/action-handler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'
22
import type { SizeLimit } from '../../types'
3-
import type { RequestStore } from '../../server/app-render/work-unit-async-storage.external'
3+
import type { RequestStore } from '../app-render/work-unit-async-storage.external'
44
import type { AppRenderContext, GenerateFlight } from './app-render'
5-
import type { AppPageModule } from '../../server/route-modules/app-page/module'
5+
import type { AppPageModule } from '../route-modules/app-page/module'
66
import type { BaseNextRequest, BaseNextResponse } from '../base-http'
77

88
import {
@@ -19,7 +19,7 @@ import {
1919
type RedirectType,
2020
} from '../../client/components/redirect'
2121
import RenderResult from '../render-result'
22-
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
22+
import type { WorkStore } from '../app-render/work-async-storage.external'
2323
import { FlightRenderResult } from './flight-render-result'
2424
import {
2525
filterReqHeaders,

packages/next/src/server/app-render/app-render.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import type {
1111
FlightData,
1212
InitialRSCPayload,
1313
} from './types'
14-
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
15-
import type { RequestStore } from '../../server/app-render/work-unit-async-storage.external'
14+
import type { WorkStore } from '../app-render/work-async-storage.external'
15+
import type { RequestStore } from '../app-render/work-unit-async-storage.external'
1616
import type { NextParsedUrlQuery } from '../request-meta'
1717
import type { LoaderTree } from '../lib/app-dir-module'
1818
import type { AppPageModule } from '../route-modules/app-page/module'

packages/next/src/server/app-render/clean-async-snapshot-instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createSnapshot } from '../../server/app-render/async-local-storage'
1+
import { createSnapshot } from '../app-render/async-local-storage'
22

33
export const runInCleanSnapshot: <R, TArgs extends any[]>(
44
fn: (...args: TArgs) => R,

packages/next/src/server/app-render/dynamic-rendering.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
* read that data outside the cache and pass it in as an argument to the cached function.
2121
*/
2222

23-
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
24-
import type { WorkUnitStore } from '../../server/app-render/work-unit-async-storage.external'
23+
import type { WorkStore } from '../app-render/work-async-storage.external'
24+
import type { WorkUnitStore } from '../app-render/work-unit-async-storage.external'
2525

2626
// Once postpone is in stable we should switch to importing the postpone export directly
2727
import React from 'react'
@@ -33,7 +33,7 @@ import {
3333
type PrerenderStoreLegacy,
3434
type PrerenderStoreModern,
3535
} from './work-unit-async-storage.external'
36-
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
36+
import { workAsyncStorage } from '../app-render/work-async-storage.external'
3737
import { makeHangingPromise } from '../dynamic-rendering-utils'
3838
import {
3939
METADATA_BOUNDARY_NAME,

packages/next/src/server/app-render/entry-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export { prerender } from 'react-server-dom-webpack/static.edge'
1111

1212
import LayoutRouter from '../../client/components/layout-router'
1313
import RenderFromTemplateContext from '../../client/components/render-from-template-context'
14-
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
14+
import { workAsyncStorage } from '../app-render/work-async-storage.external'
1515
import { workUnitAsyncStorage } from './work-unit-async-storage.external'
16-
import { actionAsyncStorage } from '../../server/app-render/action-async-storage.external'
16+
import { actionAsyncStorage } from '../app-render/action-async-storage.external'
1717
import { ClientPageRoot } from '../../client/components/client-page'
1818
import { ClientSegmentRoot } from '../../client/components/client-segment'
1919
import {

packages/next/src/server/app-render/work-async-storage.external.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { AsyncLocalStorage } from 'async_hooks'
2-
import type { IncrementalCache } from '../../server/lib/incremental-cache'
2+
import type { IncrementalCache } from '../lib/incremental-cache'
33
import type { DynamicServerError } from '../../client/components/hooks-server-context'
4-
import type { FetchMetrics } from '../../server/base-http'
5-
import type { Revalidate } from '../../server/lib/revalidate'
6-
import type { FallbackRouteParams } from '../../server/request/fallback-params'
4+
import type { FetchMetrics } from '../base-http'
5+
import type { Revalidate } from '../lib/revalidate'
6+
import type { FallbackRouteParams } from '../request/fallback-params'
77
import type { DeepReadonly } from '../../shared/lib/deep-readonly'
88
import type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'
9-
import type { AfterContext } from '../../server/after/after-context'
9+
import type { AfterContext } from '../after/after-context'
1010

1111
// Share the instance module in the next-shared layer
1212
import { workAsyncStorage } from './work-async-storage-instance' with { 'turbopack-transition': 'next-shared' }

0 commit comments

Comments
 (0)