Home / File/ index.js — react Source File

index.js — react Source File

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

File javascript BabelCompiler 4 imports 4 dependents

Entity Profile

Dependency Diagram

graph LR
  9487a7c4_3e86_9e27_9d66_67935d8470b6["index.js"]
  b1d7b05c_3bff_9e67_383a_ec35b1716d9e["compare-versions"]
  9487a7c4_3e86_9e27_9d66_67935d8470b6 --> b1d7b05c_3bff_9e67_383a_ec35b1716d9e
  114016f3_a8fe_e14f_8022_69bffc846065["hydration"]
  9487a7c4_3e86_9e27_9d66_67935d8470b6 --> 114016f3_a8fe_e14f_8022_69bffc846065
  af78c51d_c7cb_3bf4_550f_f3fcc48f4f34["isArray"]
  9487a7c4_3e86_9e27_9d66_67935d8470b6 --> af78c51d_c7cb_3bf4_550f_f3fcc48f4f34
  aec7978f_0a19_ba93_de9e_ac8cf5ddc74b["types"]
  9487a7c4_3e86_9e27_9d66_67935d8470b6 --> aec7978f_0a19_ba93_de9e_ac8cf5ddc74b
  e3778820_57ff_7221_e2fb_64072d11afcc["agent.js"]
  e3778820_57ff_7221_e2fb_64072d11afcc --> 9487a7c4_3e86_9e27_9d66_67935d8470b6
  7dc1582f_e5c4_6fb0_e998_bd2982c8c801["renderer.js"]
  7dc1582f_e5c4_6fb0_e998_bd2982c8c801 --> 9487a7c4_3e86_9e27_9d66_67935d8470b6
  27444ff2_8253_76db_da6c_4967b0d20cee["renderer.js"]
  27444ff2_8253_76db_da6c_4967b0d20cee --> 9487a7c4_3e86_9e27_9d66_67935d8470b6
  0de29888_ca49_eb3c_33f7_ab4fff46de0b["utils.js"]
  0de29888_ca49_eb3c_33f7_ab4fff46de0b --> 9487a7c4_3e86_9e27_9d66_67935d8470b6
  style 9487a7c4_3e86_9e27_9d66_67935d8470b6 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 {compareVersions} from 'compare-versions';
import {dehydrate} from 'react-devtools-shared/src/hydration';
import isArray from 'shared/isArray';

import type {DehydratedData} from 'react-devtools-shared/src/frontend/types';

export {default as formatWithStyles} from './formatWithStyles';
export {default as formatConsoleArguments} from './formatConsoleArguments';

// TODO: update this to the first React version that has a corresponding DevTools backend
const FIRST_DEVTOOLS_BACKEND_LOCKSTEP_VER = '999.9.9';
export function hasAssignedBackend(version?: string): boolean {
  if (version == null || version === '') {
    return false;
  }
  return gte(version, FIRST_DEVTOOLS_BACKEND_LOCKSTEP_VER);
}

export function cleanForBridge(
  data: Object | null,
  isPathAllowed: (path: Array<string | number>) => boolean,
  path: Array<string | number> = [],
): DehydratedData | null {
  if (data !== null) {
    const cleanedPaths: Array<Array<string | number>> = [];
    const unserializablePaths: Array<Array<string | number>> = [];
    const cleanedData = dehydrate(
      data,
      cleanedPaths,
      unserializablePaths,
      path,
      isPathAllowed,
    );

    return {
      data: cleanedData,
      cleaned: cleanedPaths,
      unserializable: unserializablePaths,
    };
  } else {
    return null;
  }
}

export function copyWithDelete(
  obj: Object | Array<any>,
  path: Array<string | number>,
  index: number = 0,
): Object | Array<any> {
  const key = path[index];
// ... (206 more lines)

Domain

Dependencies

  • compare-versions
  • hydration
  • isArray
  • types

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.
What does index.js depend on?
index.js imports 4 module(s): compare-versions, hydration, isArray, types.
What files import index.js?
index.js is imported by 4 file(s): agent.js, renderer.js, renderer.js, utils.js.
Where is index.js in the architecture?
index.js is located at packages/react-devtools-shared/src/backend/utils/index.js (domain: BabelCompiler, directory: packages/react-devtools-shared/src/backend/utils).

Analyze Your Own Codebase

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

Try Supermodel Free