facebook/react
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`.
- `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.
- 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.
- 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/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`.
- 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).
- 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.
- 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.
- 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 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`).
- 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.
- 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`.
- 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`).
- 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.
- 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.