facebook/react
On the client, input enters through DOM events (delegated at the root by `listenToAllSupportedEvents`) or imperative `root.render`, both of which funnel into `scheduleUpdateOnFiber(root, fiber, lane)`. State lives on the Fiber tree hanging off `FiberRoot`; the `lane` bitmask on `ReactFiberLane.js` is the priority currency that decides whether work is flushed synchronously, in a microtask, or via a Scheduler task. Output boundaries are the host config (`ReactFiberConfig`, substituted per renderer) and, for SSR/RSC, the stream `Destination` in Fizz/Flight. Cross-module state is deliberately routed through a single mutable singleton, `ReactSharedInternals` (`.H` = current hooks dispatcher, `.T` = current transition, `.A` = async dispatcher), which is itself a forked module so client and server get different instances.
- All client updates converge on `scheduleUpdateOnFiber`, which marks the root (`markRootUpdated(root, lane)`), merges interleaved/render-phase lanes, and calls `ensureRootIsScheduled(root)`; sync updates on legacy roots additionally trigger `flushSyncWorkOnLegacyRootsOnly()` immediately.
- `ensureRootIsScheduled` does not schedule work directly — it appends the root to an intrusive linked list (`firstScheduledRoot`/`lastScheduledRoot` via `root.next`), sets `mightHavePendingSyncWork = true`, and defers to a microtask that runs `processRootScheduleInMicrotask` → `scheduleTaskForRootDuringMicrotask`.
- Priority is encoded as a 31-bit lane bitmask (`TotalLanes = 31`) with named lanes `SyncLane`, `InputContinuousLane`, `DefaultLane`, transition lanes, retry lanes, `IdleLane`, `OffscreenLane` and `DeferredLane`; `requestUpdateLane(fiber)` picks the lane for each update.
- `performWorkOnRoot` decides between `renderRootConcurrent` and `renderRootSync` from `shouldTimeSlice`, which is false for blocking lanes, expired lanes, or `forceSync` — but forced true when `checkIfRootIsPrerendering(root, lanes)` so prerendering never blocks the main thread.
- External-store consistency is re-validated after a concurrent render: if `isRenderConsistentWithExternalStores(finishedWork)` fails, `performWorkOnRoot` discards the result and re-runs `renderRootSync(root, lanes, false)` to block further mutation.
- Hook state is read and written through a swappable dispatcher on the shared-internals singleton: `renderWithHooks` assigns `ReactSharedInternals.H` to `HooksDispatcherOnMount` or `HooksDispatcherOnUpdate` (DEV variants included) and resets it to `ContextOnlyDispatcher` when the component finishes.
- `root.render(children)` writes nothing directly — it calls `updateContainer(children, root, null, null)`, which becomes an update object on the host-root fiber's update queue via `createUpdate(lane)` + `enqueueUpdate(rootFiber, update, lane)`.
- DOM events are the other input boundary and are delegated once per root: `createRoot` and `hydrateRoot` each call `listenToAllSupportedEvents(container)` from `react-dom-bindings/src/events/DOMPluginEventSystem`, so per-node listeners are not attached.
- On the server, Fizz's data flow is request-scoped: `createRequest(...)` builds a `Request`, `startWork(request)` renders tasks (`retryTask`, `renderNode`, `renderNodeDestructive`), and `startFlowing(request, destination)` drains completed segments through `flushCompletedQueues` into the stream.
- Server-Action input crosses a trust boundary as untyped `FormData`: `decodeAction` copies every non-`$ACTION_` field into a fresh `FormData`, decodes bound args by replaying them through `createResponse`/`getRoot` in `decodeBoundActionMetaData`, and binds the result — so client-supplied bytes drive `resolveServerReference(bundlerConfig, id)`.
- `decodeBoundActionMetaData` accepts an `arraySizeLimit` parameter threaded into `createResponse`, indicating the Flight reply parser has an explicit bound on attacker-controlled array sizes.
- DevTools data flows over a batched message bus: `Bridge` wraps a `Wall`, queues events and flushes them on a `BATCH_DURATION` timer, sending typed `BackendEvents` (`overrideProps`, `overrideHookState`, `overrideState`, `overrideContext`) from frontend to backend.
- The renderer registers itself with the page-global `__REACT_DEVTOOLS_GLOBAL_HOOK__` (installed by `installHook(target)` with `Object.defineProperty`, and explicitly documented as a de-facto public API) via `renderers.set(id, renderer)` — that global is the whole runtime↔DevTools data channel.
- In the Rust compiler, data flows as JSON across the FFI boundary: Babel serialises the AST + scope info + options, `compile()` deserialises with `serde_json::Deserializer::disable_recursion_limit()` to survive deeply nested ASTs, and returns a JSON `CompileResult`.
- The Rust HIR replaces JS shared-object references with arena indices: `identifiers`/`scopes`/`functions`/`types` vectors on `Environment`, addressed by `Copy` newtype IDs (`IdentifierId`, `ScopeId`, `FunctionId`, `TypeId`), with `HirFunction` deliberately not owning `env`.