react/compiler/crates/react_estree
Joe Savona f33e63838d Update copyrights to reference Meta instead of Facebook
Thanks @zpao!!! This was mostly his work, i just fixed up the last bit.
2024-04-03 08:43:36 -07:00
..
src Update copyrights to reference Meta instead of Facebook 2024-04-03 08:43:36 -07:00
build.rs Update copyrights to reference Meta instead of Facebook 2024-04-03 08:43:36 -07:00
Cargo.toml s/Forget/React Compiler/ in Rust port 2024-04-02 16:49:31 -07:00
README.md s/Forget/React Compiler/ in Rust port 2024-04-02 16:49:31 -07:00

react_estree

This crate is a Rust representation of the ESTree format and popular extenions including JSX and (eventually) Flow and TypeScript.

This crate is intended as the main interchange format with outside code. A typical integration with React Compiler will look as follows:

  1. Host Compiler parses into the host AST format.
  2. Host Compiler converts into react_estree.
  3. Host Compiler invokes React Compiler to compile the input, which (conceptually) returns the resulting code in react_estree format.
  4. Host Compiler convert back from react_estree to its host AST format.

Because React Compiler is intended to support JavaScript-based toolchains, react_estree is designed to support accurate serialization to/from estree-compatible JSON. We may also support the Babel AST format (a variant of ESTree) as well, depending on demand.