Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage authored and lubieowoce committed Oct 9, 2024
1 parent 80433a5 commit 3e8efe3
Show file tree
Hide file tree
Showing 45 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const browserNonTranspileModules = [
const precompileRegex = /[\\/]next[\\/]dist[\\/]compiled[\\/]/

const asyncStoragesRegex =
/next[\\/]dist[\\/](esm[\\/])?(client[\\/]components|server[\\/]app-render|)[\\/](work-async-storage|action-async-storage|work-unit-async-storage)/
/next[\\/]dist[\\/](esm[\\/])?server[\\/]app-render[\\/](work-async-storage|action-async-storage|work-unit-async-storage)/

// Support for NODE_PATH
const nodePathList = (process.env.NODE_PATH || '')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'
import { workAsyncStorage } from './work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'

export function bailoutToClientRendering(reason: string): void | never {
const workStore = workAsyncStorage.getStore()
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/client/components/client-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function ClientPageRoot({
}) {
if (typeof window === 'undefined') {
const { workAsyncStorage } =
require('./work-async-storage.external') as typeof import('./work-async-storage.external')
require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')

let clientSearchParams: Promise<ParsedUrlQuery>
let clientParams: Promise<Params>
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/client/components/client-segment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function ClientSegmentRoot({
}) {
if (typeof window === 'undefined') {
const { workAsyncStorage } =
require('./work-async-storage.external') as typeof import('./work-async-storage.external')
require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')

let clientParams: Promise<Params>
// We are going to instrument the searchParams prop with tracking for the
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/client/components/error-boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { type JSX } from 'react'
import { useUntrackedPathname } from './navigation-untracked'
import { isNextRouterError } from './is-next-router-error'
import { handleHardNavError } from './nav-failure-handler'
import { workAsyncStorage } from './work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'

const styles = {
error: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function hasFallbackRouteParams() {
if (typeof window === 'undefined') {
// AsyncLocalStorage should not be included in the client bundle.
const { workAsyncStorage } =
require('./work-async-storage.external') as typeof import('./work-async-storage.external')
require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')

const workStore = workAsyncStorage.getStore()
if (!workStore) return false
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/client/components/redirect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { actionAsyncStorage } from './action-async-storage.external'
import { actionAsyncStorage } from '../../server/app-render/action-async-storage.external'
import { RedirectStatusCode } from './redirect-status-code'

const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/export/routes/app-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-cs
import { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'
import { NEXT_IS_PRERENDER_HEADER } from '../../client/components/app-router-headers'
import type { FetchMetrics } from '../../server/base-http'
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import type { FallbackRouteParams } from '../../server/request/fallback-params'

export const enum ExportedAppPageFiles {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/lib/metadata/metadata-context.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AppRenderContext } from '../../server/app-render/app-render'
import type { MetadataContext } from './types/resolvers'
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import { trackFallbackParamAccessed } from '../../server/app-render/dynamic-rendering'

export function createMetadataContext(
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/lib/metadata/metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import type {
} from './types/metadata-interface'
import { isNotFoundError } from '../../client/components/not-found'
import type { MetadataContext } from './types/resolvers'
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'

// Use a promise to share the status of the metadata resolving,
// returning two components `MetadataTree` and `MetadataOutlet`
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/lib/metadata/resolve-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { getTracer } from '../../server/lib/trace/tracer'
import { ResolveMetadataSpan } from '../../server/lib/trace/constants'
import { PAGE_SEGMENT_KEY } from '../../shared/lib/segment'
import * as Log from '../../build/output/log'
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import type {
Params,
CreateServerParamsForMetadata,
Expand Down
6 changes: 3 additions & 3 deletions packages/next/src/server/after/after-context.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { DetachedPromise } from '../../lib/detached-promise'
import { AsyncLocalStorage } from 'async_hooks'

import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import type { AfterContext } from './after-context'

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

Expand All @@ -21,7 +21,7 @@ describe('AfterContext', () => {
globalThis.AsyncLocalStorage = AsyncLocalStorage

const WASMod = await import(
'../../client/components/work-async-storage.external'
'../../server/app-render/work-async-storage.external'
)
workAsyncStorage = WASMod.workAsyncStorage

Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/server/after/after-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { RequestLifecycleOpts } from '../base-server'
import type { AfterCallback, AfterTask } from './after'
import { InvariantError } from '../../shared/lib/invariant-error'
import { isThenable } from '../../shared/lib/is-thenable'
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import { withExecuteRevalidates } from './revalidation-utils'
import { bindSnapshot } from '../../client/components/async-local-storage'
import { bindSnapshot } from '../../server/app-render/async-local-storage'

export type AfterContextOpts = {
waitUntil: RequestLifecycleOpts['waitUntil'] | undefined
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/after/after.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import { workUnitAsyncStorage } from '../../server/app-render/work-unit-async-storage.external'
import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'

Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/after/revalidation-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'

/** Run a callback, and execute any *new* revalidations added during its runtime. */
export async function withExecuteRevalidates<T>(
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/app-render/action-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
type RedirectType,
} from '../../client/components/redirect'
import RenderResult from '../render-result'
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import { FlightRenderResult } from './flight-render-result'
import {
filterReqHeaders,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/app-render/app-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
FlightData,
InitialRSCPayload,
} from './types'
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import type { RequestStore } from '../../server/app-render/work-unit-async-storage.external'
import type { NextParsedUrlQuery } from '../request-meta'
import type { LoaderTree } from '../lib/app-dir-module'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSnapshot } from '../../client/components/async-local-storage'
import { createSnapshot } from '../../server/app-render/async-local-storage'

export const runInCleanSnapshot: <R, TArgs extends any[]>(
fn: (...args: TArgs) => R,
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/server/app-render/dynamic-rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* read that data outside the cache and pass it in as an argument to the cached function.
*/

import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import type { WorkUnitStore } from '../../server/app-render/work-unit-async-storage.external'

// Once postpone is in stable we should switch to importing the postpone export directly
Expand All @@ -33,7 +33,7 @@ import {
type PrerenderStoreLegacy,
type PrerenderStoreModern,
} from './work-unit-async-storage.external'
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import { makeHangingPromise } from '../dynamic-rendering-utils'
import {
METADATA_BOUNDARY_NAME,
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/server/app-render/entry-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export { prerender } from 'react-server-dom-webpack/static.edge'

import LayoutRouter from '../../client/components/layout-router'
import RenderFromTemplateContext from '../../client/components/render-from-template-context'
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import { workUnitAsyncStorage } from './work-unit-async-storage.external'
import { actionAsyncStorage } from '../../client/components/action-async-storage.external'
import { actionAsyncStorage } from '../../server/app-render/action-async-storage.external'
import { ClientPageRoot } from '../../client/components/client-page'
import { ClientSegmentRoot } from '../../client/components/client-segment'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AsyncLocalStorage } from 'async_hooks'
import type { IncrementalCache } from '../../server/lib/incremental-cache'
import type { DynamicServerError } from './hooks-server-context'
import type { DynamicServerError } from '../../client/components/hooks-server-context'
import type { FetchMetrics } from '../../server/base-http'
import type { Revalidate } from '../../server/lib/revalidate'
import type { FallbackRouteParams } from '../../server/request/fallback-params'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createAsyncLocalStorage } from '../../client/components/async-local-storage'
import { createAsyncLocalStorage } from './async-local-storage'
import type { WorkUnitAsyncStorage } from './work-unit-async-storage.external'

export const workUnitAsyncStorage: WorkUnitAsyncStorage =
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/async-storage/cache-scope.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createAsyncLocalStorage } from '../../client/components/async-local-storage'
import { createAsyncLocalStorage } from '../../server/app-render/async-local-storage'

export interface CacheScopeStore {
cache?: Map<string, any>
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/async-storage/with-work-store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WithStore } from './with-store'
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import type { AsyncLocalStorage } from 'async_hooks'
import type { IncrementalCache } from '../lib/incremental-cache'
import type { RenderOpts } from '../app-render/types'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/lib/patch-fetch.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AsyncLocalStorage } from 'node:async_hooks'
import type { WorkUnitStore } from '../../server/app-render/work-unit-async-storage.external'
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import type { IncrementalCache } from './incremental-cache'
import { createPatchedFetcher } from './patch-fetch'

Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/lib/patch-fetch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
WorkAsyncStorage,
WorkStore,
} from '../../client/components/work-async-storage.external'
} from '../../server/app-render/work-async-storage.external'

import { AppRenderSpan, NextNodeServerSpan } from './trace/constants'
import { getTracer, SpanKind } from './trace/tracer'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../app-render/work-async-storage.external'
import { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'
import { abortOnSynchronousDynamicDataAccess } from '../app-render/dynamic-rendering'

Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/request/connection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'
import {
postponeWithTracking,
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/server/request/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
RequestCookiesAdapter,
} from '../../server/web/spec-extension/adapters/request-cookies'
import { RequestCookies } from '../../server/web/spec-extension/cookies'
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import {
workUnitAsyncStorage,
type PrerenderStoreModern,
Expand All @@ -16,7 +16,7 @@ import {
trackDynamicDataInDynamicRender,
} from '../../server/app-render/dynamic-rendering'
import { getExpectedRequestStore } from '../../server/app-render/work-unit-async-storage.external'
import { actionAsyncStorage } from '../../client/components/action-async-storage.external'
import { actionAsyncStorage } from '../../server/app-render/action-async-storage.external'
import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'
import { makeResolvedReactPromise } from './utils'
import { makeHangingPromise } from '../dynamic-rendering-utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/request/draft-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getExpectedRequestStore } from '../../server/app-render/work-unit-async

import type { DraftModeProvider } from '../../server/async-storage/draft-mode-provider'

import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'
import { trackDynamicDataAccessed } from '../app-render/dynamic-rendering'
import { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-loger'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/request/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
HeadersAdapter,
type ReadonlyHeaders,
} from '../../server/web/spec-extension/adapters/headers'
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import { getExpectedRequestStore } from '../app-render/work-unit-async-storage.external'
import {
workUnitAsyncStorage,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/request/params.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import type { FallbackRouteParams } from './fallback-params'

import { ReflectAdapter } from '../web/spec-extension/adapters/reflect'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/request/search-params.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WorkStore } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'

import { ReflectAdapter } from '../web/spec-extension/adapters/reflect'
import {
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/server/route-modules/app-route/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { DynamicServerError } from '../../../client/components/hooks-server-cont
import {
workAsyncStorage,
type WorkStore,
} from '../../../client/components/work-async-storage.external'
} from '../../../server/app-render/work-async-storage.external'
import {
workUnitAsyncStorage,
type WorkUnitStore,
Expand All @@ -49,7 +49,7 @@ import {
import {
actionAsyncStorage,
type ActionStore,
} from '../../../client/components/action-async-storage.external'
} from '../../../server/app-render/action-async-storage.external'
import * as sharedModules from './shared-modules'
import { getIsServerAction } from '../../lib/server-action-request-meta'
import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies'
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/server/use-cache/use-cache-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
createTemporaryReferenceSet as createClientTemporaryReferenceSet,
} from 'react-server-dom-webpack/client.edge'

import type { WorkStore } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import type { UseCacheStore } from '../app-render/work-unit-async-storage.external'
import { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'
import { runInCleanSnapshot } from '../app-render/clean-async-snapshot.external'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/web/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
withWorkStore,
type WorkStoreContext,
} from '../async-storage/with-work-store'
import { workAsyncStorage } from '../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../server/app-render/work-async-storage.external'
import { NEXT_ROUTER_PREFETCH_HEADER } from '../../client/components/app-router-headers'
import { getTracer } from '../lib/trace/tracer'
import type { TextMapGetter } from 'next/dist/compiled/@opentelemetry/api'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { RequestCookies } from '../cookies'

import { ResponseCookies } from '../cookies'
import { ReflectAdapter } from './reflect'
import { workAsyncStorage } from '../../../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../../../server/app-render/work-async-storage.external'

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/web/spec-extension/revalidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
NEXT_CACHE_IMPLICIT_TAG_ID,
NEXT_CACHE_SOFT_TAG_MAX_LENGTH,
} from '../../../lib/constants'
import { workAsyncStorage } from '../../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../../server/app-render/work-async-storage.external'
import { workUnitAsyncStorage } from '../../../server/app-render/work-unit-async-storage.external'

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
validateRevalidate,
validateTags,
} from '../../lib/patch-fetch'
import { workAsyncStorage } from '../../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../../server/app-render/work-async-storage.external'
import { workUnitAsyncStorage } from '../../app-render/work-unit-async-storage.external'
import {
CachedRouteKind,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { workAsyncStorage } from '../../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../../server/app-render/work-async-storage.external'
import { workUnitAsyncStorage } from '../../../server/app-render/work-unit-async-storage.external'
import { markCurrentScopeAsDynamic } from '../../app-render/dynamic-rendering'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { preload } from 'react-dom'

import { workAsyncStorage } from '../../../client/components/work-async-storage.external'
import { workAsyncStorage } from '../../../server/app-render/work-async-storage.external'
import { encodeURIPath } from '../encode-uri-path'

export function PreloadChunks({
Expand Down

0 comments on commit 3e8efe3

Please sign in to comment.