Skip to content

Commit

Permalink
remove usage of "@vercel/request-context"
Browse files Browse the repository at this point in the history
  • Loading branch information
lubieowoce committed Nov 27, 2024
1 parent 7af6e07 commit 78951ae
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/next/src/server/after/builtin-request-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ export function getBuiltinRequestContext():
| BuiltinRequestContextValue
| undefined {
const _globalThis = globalThis as GlobalThisWithRequestContext
const ctx =
_globalThis[NEXT_REQUEST_CONTEXT_SYMBOL] ??
_globalThis[VERCEL_REQUEST_CONTEXT_SYMBOL]
const ctx = _globalThis[NEXT_REQUEST_CONTEXT_SYMBOL]
return ctx?.get()
}

/** This should be considered unstable until `unstable_after` is stablized. */
const NEXT_REQUEST_CONTEXT_SYMBOL = Symbol.for('@next/request-context')

// TODO(after): this is a temporary workaround.
// Remove this when vercel builder is updated to provide '@next/request-context'.
const VERCEL_REQUEST_CONTEXT_SYMBOL = Symbol.for('@vercel/request-context')

type GlobalThisWithRequestContext = typeof globalThis & {
[NEXT_REQUEST_CONTEXT_SYMBOL]?: BuiltinRequestContext
/** @deprecated */
[VERCEL_REQUEST_CONTEXT_SYMBOL]?: BuiltinRequestContext
}

/** A request context provided by the platform.
Expand Down

0 comments on commit 78951ae

Please sign in to comment.