GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix module ID deduplication (#20406) · react/react@1b5ca99

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-server/src
    • ReactFlightServer.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-server/src/ReactFlightServer.js‎

Copy file name to clipboardExpand all lines: packages/react-server/src/ReactFlightServer.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@ export function resolveModelToJSON(
432432
if (isModuleReference(value)) {
433433
const moduleReference: ModuleReference<any> = (value: any);
434434
const moduleKey: ModuleKey = getModuleKey(moduleReference);
435-
const existingId = request.writtenModules.get(moduleKey);
435+
const writtenModules = request.writtenModules;
436+
const existingId = writtenModules.get(moduleKey);
436437
if (existingId !== undefined) {
437438
return serializeByValueID(existingId);
438439
}
@@ -444,6 +445,7 @@ export function resolveModelToJSON(
444445
request.pendingChunks++;
445446
const moduleId = request.nextChunkId++;
446447
emitModuleChunk(request, moduleId, moduleMetaData);
448+
writtenModules.set(moduleKey, moduleId);
447449
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
448450
// If we're encoding the "type" of an element, we can refer
449451
// to that by a lazy reference instead of directly since React

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.