MCPcopy Index your code
hub / github.com/react/react / logBlockingStart

Function logBlockingStart

packages/react-reconciler/src/ReactFiberPerformanceTrack.js:637–753  ·  view source on GitHub ↗
(
  updateTime: number,
  eventTime: number,
  eventType: null | string,
  eventIsRepeat: boolean,
  isSpawnedUpdate: boolean,
  isPingedUpdate: boolean,
  renderStartTime: number,
  lanes: Lanes,
  debugTask: null | ConsoleTask, // DEV-only
  updateMethodName: null | string,
  updateComponentName: null | string,
)

Source from the content-addressed store, hash-verified

635}
636
637export function logBlockingStart(
638 updateTime: number,
639 eventTime: number,
640 eventType: null | string,
641 eventIsRepeat: boolean,
642 isSpawnedUpdate: boolean,
643 isPingedUpdate: boolean,
644 renderStartTime: number,
645 lanes: Lanes,
646 debugTask: null | ConsoleTask, // DEV-only
647 updateMethodName: null | string,
648 updateComponentName: null | string,
649): void {
650 if (supportsUserTiming) {
651 currentTrack = 'Blocking';
652 // Clamp start times
653 if (updateTime > 0) {
654 if (updateTime > renderStartTime) {
655 updateTime = renderStartTime;
656 }
657 } else {
658 updateTime = renderStartTime;
659 }
660 if (eventTime > 0) {
661 if (eventTime > updateTime) {
662 eventTime = updateTime;
663 }
664 } else {
665 eventTime = updateTime;
666 }
667 // If a blocking update was spawned within render or an effect, that's considered a cascading render.
668 // If you have a second blocking update within the same event, that suggests multiple flushSync or
669 // setState in a microtask which is also considered a cascade.
670 if (eventType !== null && updateTime > eventTime) {
671 // Log the time from the event timeStamp until we called setState.
672 const color = eventIsRepeat ? 'secondary-light' : 'warning';
673 if (__DEV__ && debugTask) {
674 debugTask.run(
675 // $FlowFixMe[method-unbinding]
676 console.timeStamp.bind(
677 console,
678 eventIsRepeat ? 'Consecutive' : 'Event: ' + eventType,
679 eventTime,
680 updateTime,
681 currentTrack,
682 LANES_TRACK_GROUP,
683 color,
684 ),
685 );
686 } else {
687 console.timeStamp(
688 eventIsRepeat ? 'Consecutive' : 'Event: ' + eventType,
689 eventTime,
690 updateTime,
691 currentTrack,
692 LANES_TRACK_GROUP,
693 color,
694 );

Callers 1

prepareFreshStackFunction · 0.90

Calls 4

runMethod · 0.80
pushMethod · 0.65
measureMethod · 0.65

Tested by

no test coverage detected