Skip to content

Commit

Permalink
Fix bad modRequest in flight entry manifest (#68888)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
huozhi authored and ztanner committed Aug 26, 2024
1 parent 9ecf2e8 commit 575385e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,11 @@ export class FlightClientEntryPlugin {
const isCSS = isCSSMod(mod)

const modPath: string = mod.resourceResolveData?.path || ''
const modQuery = mod.resourceResolveData?.query || ''
// 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
// the server compiler and client compiler have different resolve configs.
let modRequest: string | undefined =
modPath + mod.resourceResolveData?.query
let modRequest: string = modPath + modQuery

// Context modules don't have a resource path, we use the identifier instead.
if (mod.constructor.name === 'ContextModule') {
Expand Down

0 comments on commit 575385e

Please sign in to comment.