Skip to content

Commit

Permalink
chore(docs): fix typo (plugion => plugin) in DESIGN_GOALS.md
Browse files Browse the repository at this point in the history
This PR fixes a typo in `./compiler/docs/DESIGN_GOALS.md`.

I believe `plugion` should be `plugin`.
  • Loading branch information
styfle committed May 16, 2024
1 parent 50c999e commit e6827c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/docs/DESIGN_GOALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ React Compiler has two primary public interfaces: a Babel plugin for transformin

The core of the compiler is largely decoupled from Babel, using its own intermediate representations. The high-level flow is as follows:

- **Babel Plugin**: Determines which functions in a file should be compiled, based on the plugion options and any local opt-in/opt-out directives. For each component or hook to be compiled, the plugin calls the compiler, passing in the original function and getting back a new AST node which will replace the original.
- **Babel Plugin**: Determines which functions in a file should be compiled, based on the plugin options and any local opt-in/opt-out directives. For each component or hook to be compiled, the plugin calls the compiler, passing in the original function and getting back a new AST node which will replace the original.
- **Lowering** (BuildHIR): The first step of the compiler is to convert the Babel AST into React Compiler's primary intermediate representation, HIR (High-level Intermediate Representation). This phase is primarily based on the AST itself, but currently leans on Babel to resolve identifiers. The HIR preserves the precise order-of-evaluation semantics of JavaScript, resolves break/continue to their jump points, etc. The resulting HIR forms a control-flow graph of basic blocks, each of which contains zero or more consecutive instructions followed by a terminal. The basic blocks are stored in reverse postorder, such that forward iteration of the blocks allows predecessors to be visited before successors _unless_ there is a "back edge" (ie a loop).
- **SSA Conversion** (EnterSSA): The HIR is converted to HIR form, such that all Identifiers in the HIR are updated to an SSA-based identifier.
- Validation: We run various validation passes to check that the input is valid React, ie that it does not break the rules. This includes looking for conditional hook calls, unconditional setState calls, etc.
Expand Down

0 comments on commit e6827c7

Please sign in to comment.