React

repository·main·Indexed 26 days ago

https://github.com/react/react

A declarative, component-based JavaScript library for building user interfaces. This documentation includes details on the React Compiler pipeline, its High-level Intermediate Representation (HIR), the babel-plugin-react-compiler, and the eslint-plugin-react-compiler.

Tokens
219.2K
Snippets
615
Records
916
Agent score
97%

What's inside React

  1. Introduction to React

    main

    React is a JavaScript library for building user interfaces based on two core principles:

    • Declarative: You design simple views for each state in your application, and React efficiently updates and renders the right components when data changes.
    • Component-Based: You build encapsulated components that manage their own state and compose them to create complex UIs.

    React is designed to be flexible, allowing you to render on the server using Node or power mobile applications via React Native.

  2. Overview of the react_compiler_ast crate

    main

    The react_compiler_ast crate is a Rust implementation designed to precisely model the Babel AST structure. Its primary purpose is to serve as a serialization boundary between the JavaScript toolchain (Babel parser) and the Rust compiler, enabling 1:1 JSON round-tripping.

    This means you can parse JavaScript with Babel in Node.js, serialize it to JSON, deserialize it into this Rust crate, and then re-serialize it back to JSON to obtain an identical result. It is not a simplified or custom Intermediate Representation (IR), but a faithful representation of Babel's output.

  3. Overview of the React Compiler

    main
    The React Compiler is an optimization tool for React applications. It automatically optimizes components and hooks to ensure that only the minimal necessary parts of the UI re-render when state changes. Additionally, it performs validation to ensure that components and hooks adhere to the 'Rules of React'.
  4. Overview of react-server

    main

    The react-server package is an experimental tool for creating custom React streaming server renderers. It provides two primary implementation paths:

    1. Fizz: A renderer for Server Side Rendering (SSR). It runs the same code on the server that runs in the client to produce an initial view, reducing the time before the user sees content while React and user code are downloading.
    2. Flight: A renderer for React Server Components (RSC). These components run exclusively on the server. The output can be a React tree for client-side execution or can be SSR'd using Fizz.

    Warning: This API is experimental, unstable, and does not follow common versioning schemes. Use it at your own risk.

  5. Overview of the Code Path Analyzer

    main
    The Code Path Analyzer is a specialized version of ESLint's Code Path Analysis engine. It is specifically enhanced to support Component Syntax, allowing for more accurate analysis of variable usage and control flows within React component structures. It is a fork of the original ESLint implementation found at https://github.com/eslint/eslint/tree/main/lib/linter/code-path-analysis.
  6. Overview of the scheduler package

    main

    The scheduler package provides a mechanism for cooperative scheduling within a browser environment. While it is currently used internally by React to manage task execution, the React team intends to evolve it into a more generic utility.

    Note: The public API for this package is not yet finalized and is subject to change.

  7. What is react-refresh?

    main

    The react-refresh package provides the necessary wiring to integrate Fast Refresh into JavaScript bundlers.

    Fast Refresh is a feature that allows you to edit React components in a running application without losing the component's state. It is the officially supported and more reliable successor to the older "hot reloading" mechanism.

  8. Overview of react-cache

    main

    react-cache is a basic caching implementation designed for React applications. It is primarily intended to serve as a reference for more advanced caching implementations and is meant to be used alongside experimental, upcoming React features.

    WARNING: This package is unstable and experimental.

    • Do not use in a real application. It is published for demonstration purposes only.
    • The API is subject to wild changes between versions.
    • Use it at your own risk.