Home / File/ SuspenseTreeContext.js — react Source File

SuspenseTreeContext.js — react Source File

Architecture documentation for SuspenseTreeContext.js, a javascript file in the react codebase. 5 imports, 5 dependents.

File javascript BabelCompiler Validation 5 imports 5 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  9526441b_1b8b_0410_c862_2232f8e4ba65["SuspenseTreeContext.js"]
  bba85af0_a356_d0c5_4d12_914508b89593["store.js"]
  9526441b_1b8b_0410_c862_2232f8e4ba65 --> bba85af0_a356_d0c5_4d12_914508b89593
  913bb343_55ea_f1b8_08f5_b75cb0a92b76["context.js"]
  9526441b_1b8b_0410_c862_2232f8e4ba65 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  9526441b_1b8b_0410_c862_2232f8e4ba65 --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  aec7978f_0a19_ba93_de9e_ac8cf5ddc74b["types"]
  9526441b_1b8b_0410_c862_2232f8e4ba65 --> aec7978f_0a19_ba93_de9e_ac8cf5ddc74b
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  9526441b_1b8b_0410_c862_2232f8e4ba65 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  e2c52a93_982e_407f_9fee_e89aa134ae9d["DevTools.js"]
  e2c52a93_982e_407f_9fee_e89aa134ae9d --> 9526441b_1b8b_0410_c862_2232f8e4ba65
  0adf488f_cc01_d00c_692a_56c1f4de537f["SuspenseBreadcrumbs.js"]
  0adf488f_cc01_d00c_692a_56c1f4de537f --> 9526441b_1b8b_0410_c862_2232f8e4ba65
  cf8221e2_1aa3_8c65_096d_d49b44597f09["SuspenseRects.js"]
  cf8221e2_1aa3_8c65_096d_d49b44597f09 --> 9526441b_1b8b_0410_c862_2232f8e4ba65
  3249b7c1_ae10_2672_10ce_a66fd0ee6f60["SuspenseTab.js"]
  3249b7c1_ae10_2672_10ce_a66fd0ee6f60 --> 9526441b_1b8b_0410_c862_2232f8e4ba65
  09a08def_3d86_aab5_1719_24f5fdd9d175["SuspenseTimeline.js"]
  09a08def_3d86_aab5_1719_24f5fdd9d175 --> 9526441b_1b8b_0410_c862_2232f8e4ba65
  style 9526441b_1b8b_0410_c862_2232f8e4ba65 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */
import type {ReactContext} from 'shared/ReactTypes';
import type {
  SuspenseNode,
  SuspenseTimelineStep,
} from 'react-devtools-shared/src/frontend/types';
import type Store from '../../store';

import * as React from 'react';
import {
  createContext,
  startTransition,
  useContext,
  useEffect,
  useMemo,
  useReducer,
} from 'react';
import {StoreContext} from '../context';

export type SuspenseTreeState = {
  lineage: $ReadOnlyArray<SuspenseNode['id']> | null,
  roots: $ReadOnlyArray<SuspenseNode['id']>,
  selectedSuspenseID: SuspenseNode['id'] | null,
  timeline: $ReadOnlyArray<SuspenseTimelineStep>,
  timelineIndex: number | -1,
  hoveredTimelineIndex: number | -1,
  uniqueSuspendersOnly: boolean,
  playing: boolean,
  autoSelect: boolean,
  autoScroll: {id: number}, // Ref that's set to 0 after scrolling once.
};

type ACTION_SUSPENSE_TREE_MUTATION = {
  type: 'HANDLE_SUSPENSE_TREE_MUTATION',
  payload: [Map<SuspenseNode['id'], SuspenseNode['id']>],
};
type ACTION_SET_SUSPENSE_LINEAGE = {
  type: 'SET_SUSPENSE_LINEAGE',
  payload: SuspenseNode['id'],
};
type ACTION_SELECT_SUSPENSE_BY_ID = {
  type: 'SELECT_SUSPENSE_BY_ID',
  payload: SuspenseNode['id'],
};
type ACTION_SET_SUSPENSE_TIMELINE = {
  type: 'SET_SUSPENSE_TIMELINE',
  payload: [
    $ReadOnlyArray<SuspenseTimelineStep>,
    // The next Suspense ID to select in the timeline
    SuspenseNode['id'] | null,
    // Whether this timeline includes only unique suspenders
    boolean,
  ],
// ... (430 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does SuspenseTreeContext.js do?
SuspenseTreeContext.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in SuspenseTreeContext.js?
SuspenseTreeContext.js defines 1 function(s): SuspenseTreeDispatch.
What does SuspenseTreeContext.js depend on?
SuspenseTreeContext.js imports 5 module(s): ReactTypes, context.js, react, store.js, types.
What files import SuspenseTreeContext.js?
SuspenseTreeContext.js is imported by 5 file(s): DevTools.js, SuspenseBreadcrumbs.js, SuspenseRects.js, SuspenseTab.js, SuspenseTimeline.js.
Where is SuspenseTreeContext.js in the architecture?
SuspenseTreeContext.js is located at packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTreeContext.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/devtools/views/SuspenseTab).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free