Home / File/ standalone.js — react Source File

standalone.js — react Source File

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

Entity Profile

Dependency Diagram

graph LR
  1125c601_01c3_8f9b_92e0_8a980bac4511["standalone.js"]
  39f6c195_7b6b_6f87_7437_5d782daf3565["editor.js"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> 39f6c195_7b6b_6f87_7437_5d782daf3565
  d352faa0_4c41_77cb_45d0_6c9536117f37["doesFilePathExist"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> d352faa0_4c41_77cb_45d0_6c9536117f37
  e8507b55_91a3_8bd9_66bd_762108bb46c6["launchEditor"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> e8507b55_91a3_8bd9_66bd_762108bb46c6
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  4d0c4ccc_5970_e7f9_458f_15f0290099b1["react-dom"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> 4d0c4ccc_5970_e7f9_458f_15f0290099b1
  8792c1c1_dca5_f137_73ea_c0e268fdbb22["client"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> 8792c1c1_dca5_f137_73ea_c0e268fdbb22
  4077b620_5c59_61c2_0910_273f565da757["bridge"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> 4077b620_5c59_61c2_0910_273f565da757
  baf70b0e_4867_b3ed_962a_e5c9ae820fef["store"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> baf70b0e_4867_b3ed_962a_e5c9ae820fef
  627bb742_21aa_b4fd_fe2d_4a963a1f9278["utils"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> 627bb742_21aa_b4fd_fe2d_4a963a1f9278
  9e310196_fe62_4232_d7ba_4b87fa1be973["registerDevToolsEventLogger"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> 9e310196_fe62_4232_d7ba_4b87fa1be973
  d97c8392_f70d_f27e_0482_2b8223a307a9["ws"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> d97c8392_f70d_f27e_0482_2b8223a307a9
  b402a0fc_00db_e86d_b1ea_ad4f8e9faaca["path"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> b402a0fc_00db_e86d_b1ea_ad4f8e9faaca
  324b23d8_44c6_f20a_4338_46cccc56566e["fs"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> 324b23d8_44c6_f20a_4338_46cccc56566e
  ce034302_61e9_5cdc_95e6_1e120df583e4["DevTools"]
  1125c601_01c3_8f9b_92e0_8a980bac4511 --> ce034302_61e9_5cdc_95e6_1e120df583e4
  style 1125c601_01c3_8f9b_92e0_8a980bac4511 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 {createElement} from 'react';
import {flushSync} from 'react-dom';
import {createRoot} from 'react-dom/client';
import Bridge from 'react-devtools-shared/src/bridge';
import Store from 'react-devtools-shared/src/devtools/store';
import {getSavedComponentFilters} from 'react-devtools-shared/src/utils';
import {registerDevToolsEventLogger} from 'react-devtools-shared/src/registerDevToolsEventLogger';
import {Server} from 'ws';
import {join} from 'path';
import {readFileSync} from 'fs';
import DevTools from 'react-devtools-shared/src/devtools/views/DevTools';
import {doesFilePathExist, launchEditor} from './editor';
import {
  __DEBUG__,
  LOCAL_STORAGE_DEFAULT_TAB_KEY,
} from 'react-devtools-shared/src/constants';
import {localStorageSetItem} from 'react-devtools-shared/src/storage';

import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
import type {ReactFunctionLocation, ReactCallSite} from 'shared/ReactTypes';

export type StatusTypes = 'server-connected' | 'devtools-connected' | 'error';
export type StatusListener = (message: string, status: StatusTypes) => void;
export type OnDisconnectedCallback = () => void;

let node: HTMLElement = ((null: any): HTMLElement);
let nodeWaitingToConnectHTML: string = '';
let projectRoots: Array<string> = [];
let statusListener: StatusListener = (
  message: string,
  status?: StatusTypes,
) => {};
let disconnectedCallback: OnDisconnectedCallback = () => {};

// TODO (Webpack 5) Hopefully we can remove this prop after the Webpack 5 migration.
function hookNamesModuleLoaderFunction() {
  return import(
    /* webpackChunkName: 'parseHookNames' */ 'react-devtools-shared/src/hooks/parseHookNames'
  );
}

function setContentDOMNode(value: HTMLElement): typeof DevtoolsUI {
  node = value;

  // Save so we can restore the exact waiting message between sessions.
  nodeWaitingToConnectHTML = node.innerHTML;

  return DevtoolsUI;
}

function setProjectRoots(value: Array<string>) {
// ... (350 more lines)

Domain

Dependencies

Frequently Asked Questions

What does standalone.js do?
standalone.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does standalone.js depend on?
standalone.js imports 17 module(s): DevTools, ReactTypes, bridge, client, constants, doesFilePathExist, editor.js, fs, and 9 more.
Where is standalone.js in the architecture?
standalone.js is located at packages/react-devtools-core/src/standalone.js (domain: BabelCompiler, directory: packages/react-devtools-core/src).

Analyze Your Own Codebase

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

Try Supermodel Free