Home / File/ FastRefreshDevToolsIntegration-test.js — react Source File

FastRefreshDevToolsIntegration-test.js — react Source File

Architecture documentation for FastRefreshDevToolsIntegration-test.js, a javascript file in the react codebase. 1 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  35825149_7222_671b_4c04_d647edd2f55a["FastRefreshDevToolsIntegration-test.js"]
  7ea1760e_9c01_71c9_3ba5_32a9a10a0ce4["utils.js"]
  35825149_7222_671b_4c04_d647edd2f55a --> 7ea1760e_9c01_71c9_3ba5_32a9a10a0ce4
  style 35825149_7222_671b_4c04_d647edd2f55a 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 {getVersionedRenderImplementation} from './utils';

describe('Fast Refresh', () => {
  let React;
  let ReactFreshRuntime;
  let act;
  let babel;
  let exportsObj;
  let freshPlugin;
  let store;
  let withErrorsOrWarningsIgnored;

  beforeEach(() => {
    global.IS_REACT_ACT_ENVIRONMENT = true;

    exportsObj = undefined;

    babel = require('@babel/core');
    freshPlugin = require('react-refresh/babel');

    store = global.store;

    React = require('react');

    ReactFreshRuntime = require('react-refresh/runtime');
    ReactFreshRuntime.injectIntoGlobalHook(global);

    const utils = require('./utils');
    act = utils.act;
    withErrorsOrWarningsIgnored = utils.withErrorsOrWarningsIgnored;
  });

  const {render: renderImplementation, getContainer} =
    getVersionedRenderImplementation();

  function execute(source) {
    const compiled = babel.transform(source, {
      babelrc: false,
      presets: ['@babel/react'],
      plugins: [
        [freshPlugin, {skipEnvCheck: true}],
        '@babel/plugin-transform-modules-commonjs',
        '@babel/plugin-transform-destructuring',
      ].filter(Boolean),
    }).code;
    exportsObj = {};
    // eslint-disable-next-line no-new-func
    new Function(
      'global',
      'React',
      'exports',
// ... (280 more lines)

Domain

Dependencies

Frequently Asked Questions

What does FastRefreshDevToolsIntegration-test.js do?
FastRefreshDevToolsIntegration-test.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does FastRefreshDevToolsIntegration-test.js depend on?
FastRefreshDevToolsIntegration-test.js imports 1 module(s): utils.js.
Where is FastRefreshDevToolsIntegration-test.js in the architecture?
FastRefreshDevToolsIntegration-test.js is located at packages/react-devtools-shared/src/__tests__/FastRefreshDevToolsIntegration-test.js (domain: BabelCompiler, directory: packages/react-devtools-shared/src/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free