Home / File/ constants.js — react Source File

constants.js — react Source File

Architecture documentation for constants.js, a javascript file in the react codebase. 0 imports, 16 dependents.

File javascript BabelCompiler 16 dependents

Entity Profile

Dependency Diagram

graph LR
  bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f["constants.js"]
  65802b54_1b70_c424_1a67_236a67c06eb1["PerformanceLoggingUtils.js"]
  65802b54_1b70_c424_1a67_236a67c06eb1 --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  e3778820_57ff_7221_e2fb_64072d11afcc["agent.js"]
  e3778820_57ff_7221_e2fb_64072d11afcc --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  7dc1582f_e5c4_6fb0_e998_bd2982c8c801["renderer.js"]
  7dc1582f_e5c4_6fb0_e998_bd2982c8c801 --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  27444ff2_8253_76db_da6c_4967b0d20cee["renderer.js"]
  27444ff2_8253_76db_da6c_4967b0d20cee --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  0304bbc8_f110_6643_71c6_d26bddc58fde["types.js"]
  0304bbc8_f110_6643_71c6_d26bddc58fde --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  bba85af0_a356_d0c5_4d12_914508b89593["store.js"]
  bba85af0_a356_d0c5_4d12_914508b89593 --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  4c0d725a_27bd_a723_3599_a3e75bea5bd3["InspectedElement.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  72d570aa_3875_3688_0200_4617e04d04ed["InspectedElementSuspendedBy.js"]
  72d570aa_3875_3688_0200_4617e04d04ed --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  e2c52a93_982e_407f_9fee_e89aa134ae9d["DevTools.js"]
  e2c52a93_982e_407f_9fee_e89aa134ae9d --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  d31d8c6c_50ef_6d6a_4682_cdf66edc0ca0["CodeEditorByDefault.js"]
  d31d8c6c_50ef_6d6a_4682_cdf66edc0ca0 --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  3360bd40_244b_03ad_208a_10c8b4341347["CodeEditorOptions.js"]
  3360bd40_244b_03ad_208a_10c8b4341347 --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  ba1321bc_42b8_c6c2_e944_8928bf07c59a["GeneralSettings.js"]
  ba1321bc_42b8_c6c2_e944_8928bf07c59a --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  92c8d128_26b7_05c1_1f27_a9a5ab236fc6["useEditorURL.js"]
  92c8d128_26b7_05c1_1f27_a9a5ab236fc6 --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  4d6a124e_fdc4_9da9_8ac7_85f75cd106fe["useOpenResource.js"]
  4d6a124e_fdc4_9da9_8ac7_85f75cd106fe --> bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f
  style bcb71f5e_1ecf_5620_9a9e_55d6ab61dd1f 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
 */

export const CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi';
export const INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc';
export const LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf';

// Flip this flag to true to enable verbose console debug logging.
export const __DEBUG__ = false;

// Flip this flag to true to enable performance.mark() and performance.measure() timings.
export const __PERFORMANCE_PROFILE__ = false;

export const TREE_OPERATION_ADD = 1;
export const TREE_OPERATION_REMOVE = 2;
export const TREE_OPERATION_REORDER_CHILDREN = 3;
export const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4;
export const TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5;
// Removed `TREE_OPERATION_REMOVE_ROOT`
export const TREE_OPERATION_SET_SUBTREE_MODE = 7;
export const SUSPENSE_TREE_OPERATION_ADD = 8;
export const SUSPENSE_TREE_OPERATION_REMOVE = 9;
export const SUSPENSE_TREE_OPERATION_REORDER_CHILDREN = 10;
export const SUSPENSE_TREE_OPERATION_RESIZE = 11;
export const SUSPENSE_TREE_OPERATION_SUSPENDERS = 12;
export const TREE_OPERATION_APPLIED_ACTIVITY_SLICE_CHANGE = 13;

export const PROFILING_FLAG_BASIC_SUPPORT /*.             */ = 0b001;
export const PROFILING_FLAG_TIMELINE_SUPPORT /*           */ = 0b010;
export const PROFILING_FLAG_PERFORMANCE_TRACKS_SUPPORT /* */ = 0b100;

export const UNKNOWN_SUSPENDERS_NONE: UnknownSuspendersReason = 0; // If we had at least one debugInfo, then that might have been the reason.
export const UNKNOWN_SUSPENDERS_REASON_PRODUCTION: UnknownSuspendersReason = 1; // We're running in prod. That might be why we had unknown suspenders.
export const UNKNOWN_SUSPENDERS_REASON_OLD_VERSION: UnknownSuspendersReason = 2; // We're running an old version of React that doesn't have full coverage. That might be the reason.
export const UNKNOWN_SUSPENDERS_REASON_THROWN_PROMISE: UnknownSuspendersReason = 3; // If we're in dev, didn't detect and debug info and still suspended (other than CSS/image) the only reason is thrown promise.

export opaque type UnknownSuspendersReason = 0 | 1 | 2 | 3;

export const LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab';
export const LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY =
  'React::DevTools::componentFilters';
export const SESSION_STORAGE_LAST_SELECTION_KEY =
  'React::DevTools::lastSelection';
export const LOCAL_STORAGE_OPEN_IN_EDITOR_URL =
  'React::DevTools::openInEditorUrl';
export const LOCAL_STORAGE_OPEN_IN_EDITOR_URL_PRESET =
  'React::DevTools::openInEditorUrlPreset';
export const LOCAL_STORAGE_ALWAYS_OPEN_IN_EDITOR =
  'React::DevTools::alwaysOpenInEditor';
export const LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY =
  'React::DevTools::parseHookNames';
export const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY =
  'React::DevTools::recordChangeDescriptions';
export const SESSION_STORAGE_RECORD_TIMELINE_KEY =
  'React::DevTools::recordTimeline';
export const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY =
  'React::DevTools::reloadAndProfile';
export const LOCAL_STORAGE_BROWSER_THEME = 'React::DevTools::theme';
export const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY =
  'React::DevTools::traceUpdatesEnabled';
export const LOCAL_STORAGE_SUPPORTS_PROFILING_KEY =
  'React::DevTools::supportsProfiling';

export const PROFILER_EXPORT_VERSION = 5;

export const FIREFOX_CONSOLE_DIMMING_COLOR = 'color: rgba(124, 124, 124, 0.75)';
export const ANSI_STYLE_DIMMING_TEMPLATE = '\x1b[2;38;2;124;124;124m%s\x1b[0m';
export const ANSI_STYLE_DIMMING_TEMPLATE_WITH_COMPONENT_STACK =
  '\x1b[2;38;2;124;124;124m%s %o\x1b[0m';

Domain

Frequently Asked Questions

What does constants.js do?
constants.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What files import constants.js?
constants.js is imported by 16 file(s): CodeEditorByDefault.js, CodeEditorOptions.js, DevTools.js, GeneralSettings.js, InspectedElement.js, InspectedElementSuspendedBy.js, PerformanceLoggingUtils.js, agent.js, and 8 more.
Where is constants.js in the architecture?
constants.js is located at packages/react-devtools-shared/src/constants.js (domain: BabelCompiler, directory: packages/react-devtools-shared/src).

Analyze Your Own Codebase

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

Try Supermodel Free