Home / File/ wrappers.js — react Source File

wrappers.js — react Source File

Architecture documentation for wrappers.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

'use strict';

const {bundleTypes, moduleTypes} = require('./bundles');

const {
  NODE_ES2015,
  ESM_DEV,
  ESM_PROD,
  NODE_DEV,
  NODE_PROD,
  NODE_PROFILING,
  BUN_DEV,
  BUN_PROD,
  FB_WWW_DEV,
  FB_WWW_PROD,
  FB_WWW_PROFILING,
  RN_OSS_DEV,
  RN_OSS_PROD,
  RN_OSS_PROFILING,
  RN_FB_DEV,
  RN_FB_PROD,
  RN_FB_PROFILING,
  BROWSER_SCRIPT,
  CJS_DTS,
  ESM_DTS,
} = bundleTypes;

const {RECONCILER} = moduleTypes;

const USE_STRICT_HEADER_REGEX = /'use strict';\n+/;

function wrapWithRegisterInternalModule(source) {
  return `\
'use strict';
if (
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
    'function'
) {
  __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
${source}
if (
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
    'function'
) {
  __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
}
`;
}

const license = ` * 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.`;

const topLevelDefinitionWrappers = {
  /***************** NODE_ES2015 *****************/
  [NODE_ES2015](source, globalName, filename, moduleType) {
// ... (531 more lines)

Domain

Subdomains

Functions

Frequently Asked Questions

What does wrappers.js do?
wrappers.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Optimization subdomain.
What functions are defined in wrappers.js?
wrappers.js defines 47 function(s): licenseHeaderWrappers.BUN_DEV, licenseHeaderWrappers.BUN_PROD, licenseHeaderWrappers.CJS_DTS, licenseHeaderWrappers.ESM_DEV, licenseHeaderWrappers.ESM_DTS, licenseHeaderWrappers.ESM_PROD, licenseHeaderWrappers.FB_WWW_DEV, licenseHeaderWrappers.FB_WWW_PROD, licenseHeaderWrappers.FB_WWW_PROFILING, licenseHeaderWrappers.NODE_DEV, and 37 more.
Where is wrappers.js in the architecture?
wrappers.js is located at scripts/rollup/wrappers.js (domain: BabelCompiler, subdomain: Optimization, directory: scripts/rollup).

Analyze Your Own Codebase

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

Try Supermodel Free