Home / File/ index.js — react Source File

index.js — react Source File

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

File javascript BabelCompiler Entrypoint 12 imports 1 classes

Entity Profile

Dependency Diagram

graph LR
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143["index.js"]
  24e3d4b6_1add_1c9f_4291_be4ab860e8b9["hydration.css"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> 24e3d4b6_1add_1c9f_4291_be4ab860e8b9
  c789f524_d8a3_6787_39a9_b5039ca79e1b["VersionPicker.js"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> c789f524_d8a3_6787_39a9_b5039ca79e1b
  6cd1a601_8d64_0a5e_2d10_9e489626d92f["VersionPicker"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> 6cd1a601_8d64_0a5e_2d10_9e489626d92f
  56993aeb_9c39_9b09_6fd9_1454b27468e9["data.js"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> 56993aeb_9c39_9b09_6fd9_1454b27468e9
  58e434e3_34f3_a439_db07_90934d2ad3e4["Code.js"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> 58e434e3_34f3_a439_db07_90934d2ad3e4
  b9c1fd4b_ff65_7dd6_f605_73afc10be7d6["CodeEditor"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> b9c1fd4b_ff65_7dd6_f605_73afc10be7d6
  c2133f9c_0867_eb3d_a881_0e2e985dfbe0["CodeError"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> c2133f9c_0867_eb3d_a881_0e2e985dfbe0
  8a757abe_4632_1719_d26d_cff18cf1ce70["code-transformer.js"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> 8a757abe_4632_1719_d26d_cff18cf1ce70
  408352fe_3cef_9540_ccc6_3ca0c7966478["compile"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> 408352fe_3cef_9540_ccc6_3ca0c7966478
  dd026ac1_6193_60a0_f5c1_cc7da4d3c4af["react-loader.js"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> dd026ac1_6193_60a0_f5c1_cc7da4d3c4af
  1e03480c_7f31_6e6a_5dc9_22841e2105d8["reactPaths"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> 1e03480c_7f31_6e6a_5dc9_22841e2105d8
  9df2348e_1b86_653b_24c9_9e88a44a39af["query-string"]
  24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 --> 9df2348e_1b86_653b_24c9_9e88a44a39af
  style 24f91f3d_8b7d_3d1b_d51b_544e9e2c6143 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import './hydration.css';
import VersionPicker from '../../VersionPicker';
import {SAMPLE_CODE} from './data';
import {CodeEditor, CodeError} from './Code';
import {compile} from './code-transformer';
import {reactPaths} from '../../../react-loader';
import qs from 'query-string';

const React = window.React;
// The Hydration fixture can render at a different version than the parent
// app. This allows rendering for versions of React older than the DOM
// test fixtures can support.
const initialVersion = qs.parse(window.location.search).version || 'local';

class Hydration extends React.Component {
  state = {
    error: null,
    code: SAMPLE_CODE,
    hydrate: true,
    version: initialVersion,
  };

  ready = false;

  componentDidMount() {
    window.addEventListener('message', this.handleMessage);
  }

  componentWillUnmount() {
    window.removeEventListener('message', this.handleMessage);
  }

  handleMessage = event => {
    var data = JSON.parse(event.data);

    switch (data.type) {
      case 'ready':
        this.ready = true;
        this.injectCode();
        break;
      default:
        throw new Error(
          'Editor Error: Unrecognized message "' + data.type + '"'
        );
    }
  };

  injectCode = () => {
    try {
      this.send({
        type: 'code',
        payload: compile(this.state.code),
      });

      this.setState({error: null});
    } catch (error) {
      this.setState({error});
    }
  };

// ... (71 more lines)

Domain

Subdomains

Classes

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, Entrypoint subdomain.
What does index.js depend on?
index.js imports 12 module(s): Code.js, CodeEditor, CodeError, VersionPicker, VersionPicker.js, code-transformer.js, compile, data.js, and 4 more.
Where is index.js in the architecture?
index.js is located at fixtures/dom/src/components/fixtures/hydration/index.js (domain: BabelCompiler, subdomain: Entrypoint, directory: fixtures/dom/src/components/fixtures/hydration).

Analyze Your Own Codebase

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

Try Supermodel Free