Unverified Commit 1f68a0a1 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

fix(turbopack): avoid runtime shortcut collision

Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent 5bcc1121
...@@ -31,7 +31,7 @@ declare var CHUNK_LOAD_RETRY_MAX_JITTER_MS: number ...@@ -31,7 +31,7 @@ declare var CHUNK_LOAD_RETRY_MAX_JITTER_MS: number
declare const SUPPORT_COMPONENT_CHUNKS: boolean declare const SUPPORT_COMPONENT_CHUNKS: boolean
interface TurbopackBrowserBaseContext<M> extends TurbopackBaseContext<M> { interface TurbopackBrowserBaseContext<M> extends TurbopackBaseContext<M> {
S: ResolvePathFromModule p: ResolvePathFromModule
} }
const browserContextPrototype = const browserContextPrototype =
...@@ -454,7 +454,7 @@ function resolvePathFromModule( ...@@ -454,7 +454,7 @@ function resolvePathFromModule(
.exports as Exports .exports as Exports
return exported?.default ?? exported return exported?.default ?? exported
} }
browserContextPrototype.S = resolvePathFromModule browserContextPrototype.p = resolvePathFromModule
/** /**
* no-op for browser * no-op for browser
......
...@@ -12,7 +12,7 @@ createModuleWithDirectionFlag = true ...@@ -12,7 +12,7 @@ createModuleWithDirectionFlag = true
interface TurbopackNodeBuildContext interface TurbopackNodeBuildContext
extends TurbopackBaseContext<ModuleWithDirection> { extends TurbopackBaseContext<ModuleWithDirection> {
S: ResolvePathFromModule p: ResolvePathFromModule
x: ExternalRequire x: ExternalRequire
y: ExternalImport y: ExternalImport
C: typeof clearChunkCache C: typeof clearChunkCache
...@@ -24,7 +24,7 @@ const nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext ...@@ -24,7 +24,7 @@ const nodeContextPrototype = Context.prototype as TurbopackNodeBuildContext
nodeContextPrototype.q = exportUrl nodeContextPrototype.q = exportUrl
nodeContextPrototype.c = moduleCache nodeContextPrototype.c = moduleCache
nodeContextPrototype.S = resolvePathFromModule nodeContextPrototype.p = resolvePathFromModule
nodeContextPrototype.C = clearChunkCache nodeContextPrototype.C = clearChunkCache
function instantiateModule( function instantiateModule(
......
...@@ -18,7 +18,7 @@ if (!globalThis.__turbopack_runtime_modules__) { ...@@ -18,7 +18,7 @@ if (!globalThis.__turbopack_runtime_modules__) {
runtimeModules = globalThis.__turbopack_runtime_modules__ runtimeModules = globalThis.__turbopack_runtime_modules__
interface TurbopackNodeDevBuildContext extends TurbopackBaseContext<HotModule> { interface TurbopackNodeDevBuildContext extends TurbopackBaseContext<HotModule> {
S: ResolvePathFromModule p: ResolvePathFromModule
x: ExternalRequire x: ExternalRequire
y: ExternalImport y: ExternalImport
C: typeof clearChunkCache C: typeof clearChunkCache
...@@ -29,7 +29,7 @@ const nodeDevContextPrototype = ...@@ -29,7 +29,7 @@ const nodeDevContextPrototype =
nodeDevContextPrototype.q = exportUrl nodeDevContextPrototype.q = exportUrl
nodeDevContextPrototype.c = moduleCache nodeDevContextPrototype.c = moduleCache
nodeDevContextPrototype.S = resolvePathFromModule nodeDevContextPrototype.p = resolvePathFromModule
nodeDevContextPrototype.C = clearChunkCache nodeDevContextPrototype.C = clearChunkCache
markDevModulesLoaded = true markDevModulesLoaded = true
......
...@@ -176,7 +176,7 @@ interface TurbopackBaseContext<M> { ...@@ -176,7 +176,7 @@ interface TurbopackBaseContext<M> {
c: ModuleCache<M> c: ModuleCache<M>
M: ModuleFactories M: ModuleFactories
R: ModuleFederationRuntimeState R: ModuleFederationRuntimeState
S: ResolvePathFromModule p: ResolvePathFromModule
l: LoadChunk l: LoadChunk
L: LoadChunkByUrl L: LoadChunkByUrl
h: GetChunkRelativeURL h: GetChunkRelativeURL
......
...@@ -85,7 +85,7 @@ pub const TURBOPACK_DYNAMIC: &TurbopackRuntimeFunctionShortcut = make_shortcut!( ...@@ -85,7 +85,7 @@ pub const TURBOPACK_DYNAMIC: &TurbopackRuntimeFunctionShortcut = make_shortcut!(
pub const TURBOPACK_RESOLVE_ABSOLUTE_PATH: &TurbopackRuntimeFunctionShortcut = make_shortcut!("P"); pub const TURBOPACK_RESOLVE_ABSOLUTE_PATH: &TurbopackRuntimeFunctionShortcut = make_shortcut!("P");
pub const TURBOPACK_RESOLVE_FILE_URL: &TurbopackRuntimeFunctionShortcut = make_shortcut!("F"); pub const TURBOPACK_RESOLVE_FILE_URL: &TurbopackRuntimeFunctionShortcut = make_shortcut!("F");
pub const TURBOPACK_RELATIVE_URL: &TurbopackRuntimeFunctionShortcut = make_shortcut!("U"); pub const TURBOPACK_RELATIVE_URL: &TurbopackRuntimeFunctionShortcut = make_shortcut!("U");
pub const TURBOPACK_RESOLVE_MODULE_ID_PATH: &TurbopackRuntimeFunctionShortcut = make_shortcut!("S"); pub const TURBOPACK_RESOLVE_MODULE_ID_PATH: &TurbopackRuntimeFunctionShortcut = make_shortcut!("p");
pub const TURBOPACK_ASYNC_MODULE: &TurbopackRuntimeFunctionShortcut = make_shortcut!("a"); pub const TURBOPACK_ASYNC_MODULE: &TurbopackRuntimeFunctionShortcut = make_shortcut!("a");
pub const TURBOPACK_EXTERNAL_REQUIRE: &TurbopackRuntimeFunctionShortcut = make_shortcut!("x"); pub const TURBOPACK_EXTERNAL_REQUIRE: &TurbopackRuntimeFunctionShortcut = make_shortcut!("x");
pub const TURBOPACK_EXTERNAL_IMPORT: &TurbopackRuntimeFunctionShortcut = make_shortcut!("y"); pub const TURBOPACK_EXTERNAL_IMPORT: &TurbopackRuntimeFunctionShortcut = make_shortcut!("y");
......
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