MCPcopy
hub / github.com/facebook/react / emitImportChunk

Function emitImportChunk

packages/react-server/src/ReactFlightServer.js:4188–4203  ·  view source on GitHub ↗
(
  request: Request,
  id: number,
  clientReferenceMetadata: ClientReferenceMetadata,
  debug: boolean,
)

Source from the content-addressed store, hash-verified

4186}
4187
4188function emitImportChunk(
4189 request: Request,
4190 id: number,
4191 clientReferenceMetadata: ClientReferenceMetadata,
4192 debug: boolean,
4193): void {
4194 // $FlowFixMe[incompatible-type] stringify can return null
4195 const json: string = stringify(clientReferenceMetadata);
4196 const row = serializeRowHeader('I', id) + json + '\n';
4197 const processedChunk = stringToChunk(row);
4198 if (__DEV__ && debug) {
4199 request.completedDebugChunks.push(processedChunk);
4200 } else {
4201 request.completedImportChunks.push(processedChunk);
4202 }
4203}
4204
4205function emitHintChunk<Code: HintCode>(
4206 request: Request,

Callers 2

serializeClientReferenceFunction · 0.85

Calls 4

stringToChunkFunction · 0.90
stringifyFunction · 0.85
serializeRowHeaderFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected