Home / Function/ getBuildInfo() — react Function Reference

getBuildInfo() — react Function Reference

Architecture documentation for the getBuildInfo() function in utils.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ec6c56c1_6dd5_95fc_9524_0690c804875e["getBuildInfo()"]
  9ef9efb0_edfe_575a_20d0_9f1277d0f69a["utils.js"]
  ec6c56c1_6dd5_95fc_9524_0690c804875e -->|defined in| 9ef9efb0_edfe_575a_20d0_9f1277d0f69a
  ad7cba5c_e3ec_b9df_3284_24c97e78c8dc["execRead()"]
  ec6c56c1_6dd5_95fc_9524_0690c804875e -->|calls| ad7cba5c_e3ec_b9df_3284_24c97e78c8dc
  29398a88_1aec_ee92_158b_70f085c7af23["getChecksumForCurrentRevision()"]
  ec6c56c1_6dd5_95fc_9524_0690c804875e -->|calls| 29398a88_1aec_ee92_158b_70f085c7af23
  7544724e_8d88_e5d2_5b3d_21fbff49031c["getDateStringForCommit()"]
  ec6c56c1_6dd5_95fc_9524_0690c804875e -->|calls| 7544724e_8d88_e5d2_5b3d_21fbff49031c
  48d03b2a_6a28_7bde_c90f_16235ba5b6e0["updateVersionsForNext()"]
  ec6c56c1_6dd5_95fc_9524_0690c804875e -->|calls| 48d03b2a_6a28_7bde_c90f_16235ba5b6e0
  style ec6c56c1_6dd5_95fc_9524_0690c804875e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/release/utils.js lines 60–87

const getBuildInfo = async () => {
  const cwd = join(__dirname, '..', '..');

  const isExperimental = process.env.RELEASE_CHANNEL === 'experimental';

  const branch = await execRead('git branch | grep \\* | cut -d " " -f2', {
    cwd,
  });
  const commit = await execRead('git show -s --no-show-signature --format=%h', {
    cwd,
  });
  const checksum = await getChecksumForCurrentRevision(cwd);
  const dateString = await getDateStringForCommit(commit);
  const version = isExperimental
    ? `0.0.0-experimental-${commit}-${dateString}`
    : `0.0.0-${commit}-${dateString}`;

  // React version is stored explicitly, separately for DevTools support.
  // See updateVersionsForNext() below for more info.
  const packageJSON = await readJson(
    join(cwd, 'packages', 'react', 'package.json')
  );
  const reactVersion = isExperimental
    ? `${packageJSON.version}-experimental-${commit}-${dateString}`
    : `${packageJSON.version}-${commit}-${dateString}`;

  return {branch, checksum, commit, reactVersion, version};
};

Domain

Subdomains

Frequently Asked Questions

What does getBuildInfo() do?
getBuildInfo() is a function in the react codebase, defined in scripts/release/utils.js.
Where is getBuildInfo() defined?
getBuildInfo() is defined in scripts/release/utils.js at line 60.
What does getBuildInfo() call?
getBuildInfo() calls 4 function(s): execRead, getChecksumForCurrentRevision, getDateStringForCommit, updateVersionsForNext.

Analyze Your Own Codebase

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

Try Supermodel Free