The React release pipeline is a multi-stage system designed to ensure high stability for production users while allowing rapid iteration for experimental features. The process transitions from automated continuous integration (CI) on every pull request to automated prereleases and manual promotion for stable versions.
React uses a centralized versioning configuration in ReactVersions.js. This file acts as the single source of truth for all packages published to npm ReactVersions.js3-7
The repository supports three primary release channels:
| Channel | Format | Example |
|---|---|---|
| Latest | X.Y.Z | 19.3.0 |
| Canary | X.Y.Z-<label>-<sha>-<date> | 19.3.0-canary-a1c2d3e4-20240320 |
| Experimental | 0.0.0-experimental-<sha>-<date> | 0.0.0-experimental-241c4467e-20200129 |
Source: ReactVersions.js8-19 scripts/rollup/build-all-release-channels.js46-47
ReactVersion: The base semver for core packages ReactVersions.js21canaryChannelLabel: The label used for prereleases (e.g., "canary", "rc", "alpha") ReactVersions.js29rcNumber: Used when the label is "rc" to generate versions like 19.0.0-rc.0 ReactVersions.js31-33stablePackages: A map of package names to their specific semver versions ReactVersions.js35-51experimentalPackages: A list of packages that only exist in the experimental channel (e.g., react-markup) ReactVersions.js56Sources: ReactVersions.js1-65 scripts/rollup/build-all-release-channels.js11-17
The CI infrastructure is divided into runtime, compiler, and DevTools workflows to manage the monorepo's distinct subsystems.
The runtime_build_and_test.yml workflow is the primary gatekeeper for core React packages. It runs on every push to main and all pull requests .github/workflows/runtime_build_and_test.yml4-10
Core Stages:
actions/cache to centralize node_modules for the runtime and compiler, preventing race conditions .github/workflows/runtime_build_and_test.yml33-80inlinedHostConfigs.js via the flow-ci task .github/workflows/runtime_build_and_test.yml82-126yarn generate-inline-fizz-runtime and checking for git diffs .github/workflows/runtime_build_and_test.yml128-154DevTools utilizes a specialized regression suite that tests the current DevTools against multiple previous versions of React (e.g., 16.0, 17.0, 18.0) .github/workflows/devtools_regression_tests.yml113-121 This ensures that changes to the DevTools backend or frontend do not break compatibility with older Fiber trees. The workflow downloads base builds using download-experimental-build.js and runs tests via jest-cli.js with the --project devtools flag .github/workflows/devtools_regression_tests.yml47-140
The dangerfile.js provides automated feedback on Pull Requests, specifically focusing on bundle size regressions.
react-dom.production.js and facebook-www/ReactDOM-prod.modern.js dangerfile.js43-52CRITICAL_THRESHOLD) are highlighted as significant dangerfile.js41-222HEAD build against a BASE_DIR build using statSync and gzip-size to calculate differences dangerfile.js142-175Sources: .github/workflows/runtime_build_and_test.yml1-192 .github/workflows/devtools_regression_tests.yml1-195 dangerfile.js1-223
React releases follow a "Build Once, Publish Anywhere" philosophy where artifacts are built in CI and then consumed by release scripts.
The following diagram illustrates how code moves from a commit to an NPM publication.
Code to Artifact Pipeline
Sources: scripts/release/README.md20-36 scripts/release/shared-commands/download-build-artifacts.js67-118 scripts/release/publish-commands/publish-to-npm.js10-44
build-all-release-channels.js)This script orchestrates the Rollup build for both stable and experimental channels scripts/rollup/build-all-release-channels.js21-22
packages/shared/ReactVersion.js to ensure the build artifacts have unique identities scripts/rollup/build-all-release-channels.js46-54processStable(): Generates oss-stable (canary), oss-stable-semver (latest), and optionally oss-stable-rc artifacts scripts/rollup/build-all-release-channels.js179-190processExperimental(): Generates artifacts for the experimental channel scripts/rollup/build-all-release-channels.js120updatePlaceholderReactVersionInCompiledArtifacts scripts/rollup/build-all-release-channels.js209-213Stable releases are always promoted from existing "canary" builds. This ensures that the exact bits tested in the prerelease channel are what production users receive scripts/release/README.md48-50
Release Promotion Logic
Sources: scripts/release/utils.js207-214 scripts/release/shared-commands/download-build-artifacts.js215-221 scripts/release/publish-commands/publish-to-npm.js10-12
React maintains a specific pipeline for syncing builds to Meta's internal repositories (facebook-www and fbsource).
The runtime_commit_artifacts.yml workflow processes builds specifically for internal consumption:
@license and inserts internal @headers (e.g., @noformat, @nolint, @lightSyntaxTransform, @preventMunge, @oncall react_core) into files like eslint-plugin-react-hooks and react-refresh using sed .github/workflows/runtime_commit_artifacts.yml115-126facebook-www artifacts are moved to ./compiled/facebook-www and test utilities like ReactAllWarnings.js are relocated to specific internal test paths .github/workflows/runtime_commit_artifacts.yml127-135VERSION_CLASSIC and VERSION_MODERN to track what is currently deployed in Meta's infrastructure .github/workflows/runtime_commit_artifacts.yml82-91The repository uses Discord webhooks to notify core team members of new PRs affecting critical paths.
runtime_discord_notify.yml .github/workflows/runtime_discord_notify.yml6-10compiler/ directory and notifies via a dedicated webhook in compiler_discord_notify.yml .github/workflows/compiler_discord_notify.yml6-43Sources: .github/workflows/runtime_commit_artifacts.yml1-156 .github/workflows/runtime_discord_notify.yml1-52 .github/workflows/compiler_discord_notify.yml1-50
Refresh this wiki