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

Function logIOInfo

packages/react-client/src/ReactFlightPerformanceTrack.js:581–632  ·  packages/react-client/src/ReactFlightPerformanceTrack.js::logIOInfo
(
  ioInfo: ReactIOInfo,
  rootEnv: string,
  value: mixed,
)

Source from the content-addressed store, hash-verified

579}
580
581export function logIOInfo(
582 ioInfo: ReactIOInfo,
583 rootEnv: string,
584 value: mixed,
585): void {
586 const startTime = ioInfo.start;
587 const endTime = ioInfo.end;
588 if (supportsUserTiming && endTime >= 0) {
589 const description = getIODescription(value);
590 const entryName = getIOShortName(ioInfo, description, ioInfo.env, rootEnv);
591 const color = getIOColor(entryName);
592 const debugTask = ioInfo.debugTask;
593 if (__DEV__ && debugTask) {
594 const properties: Array<[string, string]> = [];
595 if (typeof value === class="st">'object' && value !== null) {
596 addObjectToProperties(value, properties, 0, class="st">'');
597 } else if (value !== undefined) {
598 addValueToProperties(class="st">'Resolved', value, properties, 0, class="st">'');
599 }
600 const tooltipText = getIOLongName(
601 ioInfo,
602 description,
603 ioInfo.env,
604 rootEnv,
605 );
606 debugTask.run(
607 class="cm">// $FlowFixMe[method-unbinding]
608 performance.measure.bind(performance, class="st">'\u200b' + entryName, {
609 start: startTime < 0 ? 0 : startTime,
610 end: endTime,
611 detail: {
612 devtools: {
613 color: color,
614 track: IO_TRACK,
615 properties,
616 tooltipText,
617 },
618 },
619 }),
620 );
621 } else {
622 console.timeStamp(
623 entryName,
624 startTime < 0 ? 0 : startTime,
625 endTime,
626 IO_TRACK,
627 undefined,
628 color,
629 );
630 }
631 }
632}

Callers 1

Calls 7

getIODescriptionFunction · 0.90
addObjectToPropertiesFunction · 0.90
addValueToPropertiesFunction · 0.90
getIOShortNameFunction · 0.85
getIOColorFunction · 0.85
getIOLongNameFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected