devtools.js — react Source File
Architecture documentation for devtools.js, a javascript file in the react codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR d29b9def_f527_5cd3_81f2_47f19e0fe569["devtools.js"] ac587885_e294_a1e9_b13f_5e7b920fdb42["react"] d29b9def_f527_5cd3_81f2_47f19e0fe569 --> ac587885_e294_a1e9_b13f_5e7b920fdb42 8792c1c1_dca5_f137_73ea_c0e268fdbb22["client"] d29b9def_f527_5cd3_81f2_47f19e0fe569 --> 8792c1c1_dca5_f137_73ea_c0e268fdbb22 4da2a32d_4587_3ba6_333e_3caaa253af7d["backend"] d29b9def_f527_5cd3_81f2_47f19e0fe569 --> 4da2a32d_4587_3ba6_333e_3caaa253af7d d6b6d891_63bc_716b_0fbb_d68ca93df1a6["frontend"] d29b9def_f527_5cd3_81f2_47f19e0fe569 --> d6b6d891_63bc_716b_0fbb_d68ca93df1a6 style d29b9def_f527_5cd3_81f2_47f19e0fe569 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.
*
* @noflow
*/
import * as React from 'react';
import * as ReactDOMClient from 'react-dom/client';
import {
activate as activateBackend,
initialize as initializeBackend,
} from 'react-devtools-inline/backend';
import {initialize as createDevTools} from 'react-devtools-inline/frontend';
// This is a pretty gross hack to make the runtime loaded named-hooks-code work.
// TODO (Webpack 5) Hoepfully we can remove this once we upgrade to Webpack 5.
__webpack_public_path__ = '/dist/'; // eslint-disable-line no-undef
// TODO (Webpack 5) Hopefully we can remove this prop after the Webpack 5 migration.
function hookNamesModuleLoaderFunction() {
return import('react-devtools-inline/hookNames');
}
function inject(contentDocument, sourcePath, callback) {
const script = contentDocument.createElement('script');
script.onload = callback;
script.src = sourcePath;
((contentDocument.body: any): HTMLBodyElement).appendChild(script);
}
function init(appIframe, devtoolsContainer, appSource) {
const {contentDocument, contentWindow} = appIframe;
initializeBackend(contentWindow);
const DevTools = createDevTools(contentWindow);
inject(contentDocument, appSource, () => {
ReactDOMClient.createRoot(devtoolsContainer).render(
<DevTools
hookNamesModuleLoaderFunction={hookNamesModuleLoaderFunction}
showTabBar={true}
/>,
);
});
activateBackend(contentWindow);
}
const iframe = document.getElementById('iframe');
const devtoolsContainer = document.getElementById('devtools');
init(iframe, devtoolsContainer, 'dist/e2e-app.js');
// ReactDOM Test Selector APIs used by Playwright e2e tests
window.parent.REACT_DOM_DEVTOOLS = ReactDOMClient;
Domain
Subdomains
Dependencies
- backend
- client
- frontend
- react
Source
Frequently Asked Questions
What does devtools.js do?
devtools.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 devtools.js?
devtools.js defines 3 function(s): hookNamesModuleLoaderFunction, init, inject.
What does devtools.js depend on?
devtools.js imports 4 module(s): backend, client, frontend, react.
Where is devtools.js in the architecture?
devtools.js is located at packages/react-devtools-shell/src/e2e/devtools.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shell/src/e2e).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free