# Extension points — facebook/react

> Canonical page: https://codevetter.com/unpack/react/extension-points

# Extension points — facebook/react

Scanned commit 59aff3e18cb5b3a336c280bbfa57ec37999511b9 (2026-09-18). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The repo's main extension mechanism is the host-config pattern: write a `ReactFiberConfig.<renderer>.js`, register the renderer in `scripts/shared/inlinedHostConfigs.js` and add a fork rule, and you get a new React renderer sharing the reconciler unchanged. Bundles are similarly table-driven — add an entry to `scripts/rollup/bundles.js` and a version to `ReactVersions.js` and the build/publish pipeline picks it up. Inside the compiler, the pass list in `Pipeline.ts` / `pipeline.rs` is the ordered registry, `HIR/Globals.ts` is where hook aliasing signatures are declared, and `Environment.ts` is where feature flags live. For tooling, the ESLint plugin merges rules from a `allRules` map, the MCP servers register tools with `server.tool(name, description, schema, handler)`, and Jest behaviour is extended via `@gate` flags declared in `TestFlags.js`.
- New renderers plug in through the host-config shim: implement the interface, then register in `scripts/shared/inlinedHostConfigs.js` with a `shortName` and `entryPoints`, and add a substitution branch in `scripts/rollup/forks.js` for `./packages/react-reconciler/src/ReactFiberConfig.js`. — [scripts/shared/inlinedHostConfigs.js#L11-L700](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/shared/inlinedHostConfigs.js#L11-L700) [scripts/rollup/forks.js#L235-L268](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/rollup/forks.js#L235-L268) [packages/react-reconciler/src/ReactFiberConfig.js#L10-L22](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/react-reconciler/src/ReactFiberConfig.js#L10-L22)
- `packages/react-noop-renderer` is the reference implementation of that extension point — a full renderer with `persistent.js`, `server.js`, `flight-client.js`, `flight-server.js` and `flight-modules.js` variants, used as the testbed for reconciler features. — [packages/react-noop-renderer/index.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/react-noop-renderer/index.js) [packages/react-noop-renderer/persistent.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/react-noop-renderer/persistent.js) [packages/react-noop-renderer/flight-server.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/react-noop-renderer/flight-server.js)
- New publishable packages plug into `ReactVersions.js`: the header states 'Packages will not be published unless they are added here', with `stablePackages` for versioned output and `experimentalPackages` for sha-only builds. — [ReactVersions.js#L1-L58](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/ReactVersions.js#L1-L58)
- New build outputs plug into the `bundles.js` table via `bundleTypes` and `moduleTypes` (`ISOMORPHIC`, `RENDERER`, …); `scripts/rollup/build.js#shouldSkipBundle` then decides per bundle×type whether to emit. — [scripts/rollup/bundles.js#L10-L60](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/rollup/bundles.js#L10-L60) [scripts/rollup/build.js#L552-L560](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/rollup/build.js#L552-L560)
- `scripts/rollup/forks.js` is itself an extension registry — a map from module path to a substitution function, currently covering `ReactSharedInternals`, `ReactDOMSharedInternals`, `ReactFeatureFlags`, `SchedulerFeatureFlags`, `DefaultPrepareStackTrace`, `ReactFiberConfig`, `ReactServerStreamConfig`, `ReactFizzConfig`, `ReactFlightServerConfig`, `ReactFlightClientConfig`, `EventListener`, `useSyncExternalStore` and `isServerEnvironment`. — [scripts/rollup/forks.js#L55-L470](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/rollup/forks.js#L55-L470)
- New runtime behaviour is introduced behind a flag in `packages/shared/ReactFeatureFlags.js`, mirrored into every fork under `packages/shared/forks/`, and surfaced to tests automatically as a `@gate` name by `TestFlags.js` (which requires `shared/ReactFeatureFlags` on demand). — [packages/shared/ReactFeatureFlags.js#L26-L124](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/shared/ReactFeatureFlags.js#L26-L124) [packages/shared/forks/ReactFeatureFlags.www.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/shared/forks/ReactFeatureFlags.www.js) [scripts/jest/TestFlags.js#L34-L60](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/jest/TestFlags.js#L34-L60)
- The reconciler exposes a stable seam for schedulers: `ReactFiberRootScheduler.js#scheduleCallback` wraps `Scheduler_scheduleCallback(priorityLevel, callback)`, and the Scheduler itself is forked into `SchedulerMock`, `SchedulerNative`, `SchedulerPostTask` variants. — [packages/react-reconciler/src/ReactFiberRootScheduler.js#L626-L645](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/react-reconciler/src/ReactFiberRootScheduler.js#L626-L645) [packages/scheduler/src/forks/SchedulerMock.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/scheduler/src/forks/SchedulerMock.js) [packages/scheduler/src/forks/SchedulerPostTask.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/scheduler/src/forks/SchedulerPostTask.js)
- New compiler passes are inserted by editing the ordered pass list in `Entrypoint/Pipeline.ts` (and its Rust twin `entrypoint/pipeline.rs`); `compiler/CLAUDE.md` mandates reading `docs/passes/` for the pass being changed first. — [compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts#L119-L540](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts#L119-L540) [compiler/crates/react_compiler/src/entrypoint/pipeline.rs#L37-L640](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/crates/react_compiler/src/entrypoint/pipeline.rs#L37-L640) [compiler/CLAUDE.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/CLAUDE.md)
- Hook semantics are extensible through aliasing signatures registered in `src/HIR/Globals.ts` via `addHook(DEFAULT_SHAPES, {positionalParams, restParam, returnType, calleeEffect, hookKind, returnValueKind, aliasing: {receiver, params, rest, returns, temporaries, effects}}, id)` — missing an `aliasing` block silently falls back to `DefaultNonmutatingHook`. — [compiler/CLAUDE.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/CLAUDE.md) [compiler/packages/babel-plugin-react-compiler/src/HIR/Globals.ts](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/packages/babel-plugin-react-compiler/src/HIR/Globals.ts)
- Compiler feature flags are configured in `src/HIR/Environment.ts` and can be overridden per test fixture by a first-line comment pragma (e.g. `// enableJsxOutlining @enableNameAnonymousFunctions:false`). — [compiler/CLAUDE.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/CLAUDE.md) [compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts)
- The Rust crates are the extension surface for the port: eleven single-responsibility crates (`react_compiler_lowering`, `_ssa`, `_typeinference`, `_inference`, `_optimization`, `_reactive_scopes`, `_validation`, `_hir`, `_ast`, `_diagnostics`, `_utils`) wired through `Cargo.toml` workspace dependencies. — [compiler/Cargo.toml#L1-L26](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/Cargo.toml#L1-L26) [compiler/crates/react_compiler/src/lib.rs#L1-L11](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/crates/react_compiler/src/lib.rs#L1-L11)
- The ESLint plugin composes its rule table from two hand-written rules plus a spread of `allRules` from `shared/ReactCompiler`, and derives `recommended`/`recommendedLatest` presets by mapping compiler severities through `mapErrorSeverityToESlint` — new compiler diagnostics become lint rules without touching `index.ts`. — [packages/eslint-plugin-react-hooks/src/index.ts#L9-L80](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/eslint-plugin-react-hooks/src/index.ts#L9-L80)
- MCP tools are registered declaratively: `server.tool(name, description, zodSchema, handler)` in `react-mcp-server/src/index.ts`, with tool implementations kept in `src/tools/` (`runtimePerf`, `componentTree`). — [compiler/packages/react-mcp-server/src/index.ts#L33-L70](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/packages/react-mcp-server/src/index.ts#L33-L70) [compiler/packages/react-mcp-server/src/tools/runtimePerf.ts](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/packages/react-mcp-server/src/tools/runtimePerf.ts)
- Agent-facing workflows are extensible through `.claude/skills/*/SKILL.md` — currently `verify`, `test`, `fix`, `flow`, `flags`, `feature-flags` and `extract-errors`, each a self-contained markdown procedure with frontmatter. — [.claude/skills/verify/SKILL.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.claude/skills/verify/SKILL.md) [.claude/skills/feature-flags/SKILL.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.claude/skills/feature-flags/SKILL.md) [.claude/instructions.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.claude/instructions.md)
- Error messages are extended through `scripts/error-codes/codes.json`: new prod error strings are auto-assigned the next integer code by `extract-errors.js`, so adding a user-visible `throw` means running `yarn extract-errors` and committing the JSON delta. — [scripts/error-codes/extract-errors.js#L1-L60](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/error-codes/extract-errors.js#L1-L60) [.claude/skills/extract-errors/SKILL.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.claude/skills/extract-errors/SKILL.md)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
