Home / File/ index.js — react Source File

index.js — react Source File

Architecture documentation for index.js, a javascript file in the react codebase. 8 imports, 1 dependents.

File javascript BabelCompiler Validation 8 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7["index.js"]
  637d6ae2_3589_aafb_1b83_9f14bbf636ac["Highlighter.js"]
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 --> 637d6ae2_3589_aafb_1b83_9f14bbf636ac
  588a0ccc_6953_a79c_0da7_498ef35e4d47["hideOverlay"]
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 --> 588a0ccc_6953_a79c_0da7_498ef35e4d47
  f1332dfb_38f6_9072_35cf_d53315e4c35c["showOverlay"]
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 --> f1332dfb_38f6_9072_35cf_d53315e4c35c
  0304bbc8_f110_6643_71c6_d26bddc58fde["types.js"]
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 --> 0304bbc8_f110_6643_71c6_d26bddc58fde
  7812cbae_0bd0_497c_0a05_31fe0a8d0fde["agent"]
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 --> 7812cbae_0bd0_497c_0a05_31fe0a8d0fde
  80162ac2_4fc9_259b_04e9_4acc940af136["utils"]
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 --> 80162ac2_4fc9_259b_04e9_4acc940af136
  40bf6909_04ae_bfb6_965f_14cfe98b94de["types"]
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 --> 40bf6909_04ae_bfb6_965f_14cfe98b94de
  4077b620_5c59_61c2_0910_273f565da757["bridge"]
  5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 --> 4077b620_5c59_61c2_0910_273f565da757
  e3778820_57ff_7221_e2fb_64072d11afcc["agent.js"]
  e3778820_57ff_7221_e2fb_64072d11afcc --> 5f7af8e4_c9b4_4304_fda4_1cd7083e24d7
  style 5f7af8e4_c9b4_4304_fda4_1cd7083e24d7 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 Agent from 'react-devtools-shared/src/backend/agent';
import {hideOverlay, showOverlay} from './Highlighter';
import {isReactNativeEnvironment} from 'react-devtools-shared/src/backend/utils';

import type {HostInstance} from 'react-devtools-shared/src/backend/types';
import type {BackendBridge} from 'react-devtools-shared/src/bridge';
import type {RendererInterface} from '../../types';

// This plug-in provides in-page highlighting of the selected element.
// It is used by the browser extension and the standalone DevTools shell (when connected to a browser).
// It is not currently the mechanism used to highlight React Native views.
// That is done by the React Native Inspector component.

let iframesListeningTo: Set<HTMLIFrameElement> = new Set();
let inspectOnlySuspenseNodes = false;

export default function setupHighlighter(
  bridge: BackendBridge,
  agent: Agent,
): void {
  bridge.addListener('clearHostInstanceHighlight', clearHostInstanceHighlight);
  bridge.addListener('highlightHostInstance', highlightHostInstance);
  bridge.addListener('highlightHostInstances', highlightHostInstances);
  bridge.addListener('scrollToHostInstance', scrollToHostInstance);
  bridge.addListener('shutdown', stopInspectingHost);
  bridge.addListener('startInspectingHost', startInspectingHost);
  bridge.addListener('stopInspectingHost', stopInspectingHost);
  bridge.addListener('scrollTo', scrollDocumentTo);
  bridge.addListener('requestScrollPosition', sendScroll);

  let applyingScroll = false;

  function scrollDocumentTo({
    left,
    top,
    right,
    bottom,
  }: {
    left: number,
    top: number,
    right: number,
    bottom: number,
  }) {
    if (isReactNativeEnvironment()) {
      // Not implemented.
      return;
    }

    if (
      left === Math.round(window.scrollX) &&
      top === Math.round(window.scrollY)
// ... (442 more lines)

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does index.js do?
index.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 index.js?
index.js defines 1 function(s): setupHighlighter.
What does index.js depend on?
index.js imports 8 module(s): Highlighter.js, agent, bridge, hideOverlay, showOverlay, types, types.js, utils.
What files import index.js?
index.js is imported by 1 file(s): agent.js.
Where is index.js in the architecture?
index.js is located at packages/react-devtools-shared/src/backend/views/Highlighter/index.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/backend/views/Highlighter).

Analyze Your Own Codebase

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

Try Supermodel Free