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 SummaryAdds a detailed plan document (
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: d808047 |
| ## 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. It should read "we should instead record the todo error" (remove "construct" before "record").
| * 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. It should read "we should instead record the todo error" (remove "construct" before "record").
```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" category
The pass categorization jumps from "Pattern B" to "Pattern D", skipping "Pattern C". If Pattern C was intentionally removed, consider renaming this to "Pattern C" for sequential ordering. Otherwise, it may confuse readers who expect a Pattern C section.
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" category**
The pass categorization jumps from "Pattern B" to "Pattern D", skipping "Pattern C". If Pattern C was intentionally removed, consider renaming this to "Pattern C" for sequential ordering. Otherwise, it may confuse readers who expect a Pattern C section.
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#35872
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.