Commit 575385ef authored by Jiachi Liu's avatar Jiachi Liu Committed by Zack Tanner

Fix bad modRequest in flight entry manifest (#68888)

### What

While going through the logic of flight manifest, found the `modRequest`
sometimes accidentally become `"undefined"` string due to composing with
another potential undefined value. This caused extra traversal, fixing
this will improve a bit on the performance.
parent 9ecf2e84
...@@ -644,11 +644,11 @@ export class FlightClientEntryPlugin { ...@@ -644,11 +644,11 @@ export class FlightClientEntryPlugin {
const isCSS = isCSSMod(mod) const isCSS = isCSSMod(mod)
const modPath: string = mod.resourceResolveData?.path || '' const modPath: string = mod.resourceResolveData?.path || ''
const modQuery = mod.resourceResolveData?.query || ''
// We have to always use the resolved request here to make sure the // We have to always use the resolved request here to make sure the
// server and client are using the same module path (required by RSC), as // server and client are using the same module path (required by RSC), as
// the server compiler and client compiler have different resolve configs. // the server compiler and client compiler have different resolve configs.
let modRequest: string | undefined = let modRequest: string = modPath + modQuery
modPath + mod.resourceResolveData?.query
// Context modules don't have a resource path, we use the identifier instead. // Context modules don't have a resource path, we use the identifier instead.
if (mod.constructor.name === 'ContextModule') { if (mod.constructor.name === 'ContextModule') {
......
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