Conversation
Add detailed plan for making the React Compiler fault-tolerant by accumulating errors across all passes instead of stopping at the first error. This enables reporting multiple compilation errors at once.
Greptile SummaryThis PR adds a detailed plan document for making the React Compiler fault-tolerant by accumulating errors across all compilation passes instead of halting at the first error. The plan outlines 8 phases covering environment infrastructure, pipeline changes, HIR lowering, validation/inference pass updates, codegen, integration, and testing.
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: d30d189 |
| ## Detailed Design | ||
|
|
||
| * The Environment needs a way to record errors as compilation proceeds. This should generally store the error (and log, if a logger is configured), but should immediately throw if the error is an invariant (see above). | ||
| * BuildHIR should always produce an HIR without error. For syntax forms that are unsupported (currently throwing a Todo error), we should instead construct record the todo error on the environment, and construct a partial HIR. The exact form of the partial HIR can be situation specific: |
There was a problem hiding this comment.
Typo: duplicate word
"we should instead construct record the todo error" appears to have an extra word. Should this be "we should instead record the todo error" or "we should instead construct and record the todo error"?
| * BuildHIR should always produce an HIR without error. For syntax forms that are unsupported (currently throwing a Todo error), we should instead construct record the todo error on the environment, and construct a partial HIR. The exact form of the partial HIR can be situation specific: | |
| * BuildHIR should always produce an HIR without error. For syntax forms that are unsupported (currently throwing a Todo error), we should instead record the todo error on the environment, and construct a partial HIR. The exact form of the partial HIR can be situation specific: |
Prompt To Fix With AI
This is a comment left during a code review.
Path: compiler/fault-tolerance-overview.md
Line: 20
Comment:
**Typo: duplicate word**
"we should instead construct record the todo error" appears to have an extra word. Should this be "we should instead **record** the todo error" or "we should instead **construct and record** the todo error"?
```suggestion
* BuildHIR should always produce an HIR without error. For syntax forms that are unsupported (currently throwing a Todo error), we should instead record the todo error on the environment, and construct a partial HIR. The exact form of the partial HIR can be situation specific:
```
How can I resolve this? If you propose a fix, please make it concise.| - [ ] **4.15 `validateNoJSXInTryStatement`** — change to record on env directly | ||
| - [ ] **4.16 `validateStaticComponents`** — change to record on env directly | ||
|
|
||
| #### Pattern D passes (currently throw directly, no Result) |
There was a problem hiding this comment.
Missing "Pattern C" label
The document labels error handling patterns as "Pattern A", "Pattern B", and "Pattern D", skipping "Pattern C". Was there an intended Pattern C that was removed, or should "Pattern D" be relabeled to "Pattern C" for consistency?
Prompt To Fix With AI
This is a comment left during a code review.
Path: compiler/fault-tolerance-overview.md
Line: 201
Comment:
**Missing "Pattern C" label**
The document labels error handling patterns as "Pattern A", "Pattern B", and "Pattern D", skipping "Pattern C". Was there an intended Pattern C that was removed, or should "Pattern D" be relabeled to "Pattern C" for consistency?
How can I resolve this? If you propose a fix, please make it concise.|
Upstream PR was closed or merged. Code is synced via branch mirror. |
Mirror of facebook/react#35828
Original author: josephsavona
Add detailed plan for making the React Compiler fault-tolerant by
accumulating errors across all passes instead of stopping at the first
error. This enables reporting multiple compilation errors at once.
Stack created with Sapling. Best reviewed with ReviewStack.