How poteto/react works
React is a JavaScript library for building declarative, component-based user interfaces, with support for server rendering and mobile through React Native. The primary workflow is to define components and state, render them into a host UI, and update the UI as data changes. This repository also contains the React Compiler and the React Server Components transport client. The graph combines README-documented product flows with a few source-index and excerpt-supported compiler/transport links; unsampled package internals are represented only where their subsystem is clear from the tree.
Main entry points: Pipeline.ts Compile pipeline · ReactDOMClientFB.js DOM renderer · server Server rendering · ReactFlightClient.js Flight client
Components 20
UI Runtime
- UI components
- React APIs
packages/react/src/ReactClient.js - DOM renderer
packages/react-dom/src/client/ReactDOMClientFB.js - Native renderer
packages/react-native-renderer/src/ReactFabricGlobalResponderHandler.js
Server Rendering
- Server rendering
packages/react-dom/src/server - Flight server adapters
packages/react-server-dom-webpack/src/server - Flight client
packages/react-client/src/ReactFlightClient.js - Reply decoding
packages/react-client/src/ReactFlightReplyClient.js
React Compiler
- Babel plugin
compiler/packages/babel-plugin-react-compiler/src/Babel/BabelPlugin.ts - Program entry
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts - Compile pipeline
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts - HIR lowering
compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts - Inference and scopes
compiler/packages/babel-plugin-react-compiler/src/Inference - Optimization passes
compiler/packages/babel-plugin-react-compiler/src/Optimization - Compiler validation
compiler/packages/babel-plugin-react-compiler/src/Validation
Developer Tools
- React DevTools
packages/react-devtools/app.js
Other components
- Application developer
- Rendered UI
- Compiler integrator
- Compiled component
Connections 18
- Application developer → UI components: defines
- Application developer → DOM renderer: creates root
- UI components → DOM renderer: renders through
- React APIs → DOM renderer: renders UI
- DOM renderer → Rendered UI: updates UI
- UI components → Native renderer: renders on mobile
- Application developer → Server rendering: requests rendering
- Server rendering → Rendered UI: renders HTML
- Flight server adapters → Flight client: streams component data
- Flight client → Reply decoding: uses reply client
packages/react-client/src/ReactFlightClient.js - Compiler integrator → Babel plugin: configures compilation
- Babel plugin → Program entry: enters program
- Program entry → Compile pipeline: invokes pipeline
- Compile pipeline → HIR lowering: lowers function
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts - Compile pipeline → Inference and scopes: runs inference
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts - Compile pipeline → Optimization passes: runs passes
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts - Compile pipeline → Compiler validation: validates HIR
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts - Compile pipeline → Compiled component: produces code