feat: carry the React Compiler bail-out reason in the primary diagnostic message#793
Open
devin-ai-integration[bot] wants to merge 7 commits into
Open
feat: carry the React Compiler bail-out reason in the primary diagnostic message#793devin-ai-integration[bot] wants to merge 7 commits into
devin-ai-integration[bot] wants to merge 7 commits into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
commit: |
Contributor
|
No React Doctor issues found. 🎉 Reviewed by React Doctor for commit |
Contributor
Author
End-to-end CLI test resultsTested the PR-built CLI against a fixture project with an async
🟢 After (this PR)🔴 Before (react-doctor@0.5.1)Fixtureexport const App = () => {
const data = useMemo(async () => fetchData(), []);
return <div>{String(data)}</div>;
};CI: 19/19 green. Devin session |
…c message Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
4e51106 to
0e81642
Compare
Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
The reason's first line moves into the primary message and only the remaining elaboration stays in help, so renderers that print both never repeat the same sentence back-to-back. `todo` diagnostics keep the generic message — their reasons are compiler-internal work notes, not user-facing copy. Also trims before stripping the leading severity label, and moves the bail-out message tests into their own file with a shared oxlint parse harness.
Per-site messages (React Compiler bail-out reasons) vary within one rule, so the on-disk rule summary no longer presents the first site's reason as if it described all N sites. Also documents in the changeset that distinct same-site reasons now survive dedup as separate diagnostics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every
react-hooks-js/*(React Compiler) diagnostic rendered the same generic primary message ("This component misses React Compiler's automatic memoization…"); the specific bail-out reason lived only inhelp, so contexts that show just the message gave no clue why the compiler bailed.parse-output.tsnow weaves the compiler's reason summary (first line of the upstream message) into the primary message:buildReactCompilerMessage(bailoutReason)falls back to the unchanged generic message when the compiler emits no reason, and dedupes a trailing period on the reason summary.helpstill carries the full reason text plus the Reanimated.get()/.set()hint — unchanged.packages/core/tests/append-reanimated-shared-value-hint.test.tsvia the existingparseOxlintOutputharness, including an async-useMemofixture (react-hooks-js(use-memo)with the real upstream reason string).Link to Devin session: https://app.devin.ai/sessions/641d9fce603f48d380f9d667171b7a02
Requested by: @aidenybai
Note
Low Risk
User-facing diagnostic copy and reporting only; no auth, runtime, or lint rule behavior changes beyond clearer messages and possible slightly higher deduped counts.
Overview
React Compiler (
react-hooks-js/*) diagnostics no longer share one generic primary message.parse-output.tsputs the compiler bail-out first line into the main message (viabuildReactCompilerMessage), keeps extra reason lines inhelpwithout duplicating the summary, strips leadingError:/Warning:labels, and leavestodorules on the generic wording with internal reasons only inhelp.formatRuleSummarylists every distinct per-site message for a rule so on-disk rule summaries do not imply one site's reason applies to all findings.Tests move oxlint parse fixtures into
oxlint-parse-harness, addreact-compiler-bailout-message.test.tsandformat-rule-summary.test.ts, and extend immutability/Reanimated expectations so the reason summary appears in the message. Patch changeset documents that message-based dedupe can surface slightly higher counts when different bail-out reasons share a location.Reviewed by Cursor Bugbot for commit 90fce17. Bugbot is set up for automated code reviews on this repo. Configure here.