Skip to content

fix(react): make logging diagnostics an opt-in for React Compiler - #1431

Merged
sapphi-red merged 4 commits into
vitejs:mainfrom
dqbd:feat/react-compiler-log-diagnostics
Aug 28, 2026
Merged

fix(react): make logging diagnostics an opt-in for React Compiler#1431
sapphi-red merged 4 commits into
vitejs:mainfrom
dqbd:feat/react-compiler-log-diagnostics

Conversation

@dqbd

@dqbd dqbd commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

When Rust React Compiler is enabled in @vite/plugin-react@6.1.0, the plugin emits a Vite warning for every recoverable diagnostic, making the console output unnecessarily verbose.

This PR moves the diagnostics logging behind a logDiagnostics plugin option, with the option being disabled by default.

@dqbd
dqbd marked this pull request as draft August 21, 2026 12:42
@dqbd
dqbd marked this pull request as ready for review August 21, 2026 12:46
Comment thread packages/plugin-react/src/index.ts Outdated
Comment thread packages/plugin-react/tests/reactCompiler.test.ts Outdated
@dqbd
dqbd requested a review from ArnaudBarre August 24, 2026 13:49
@ArnaudBarre

Copy link
Copy Markdown
Member

Thanks for the update! Can you document this new option on the readme and add a changelog entry?
@sapphi-red an opinion on the default behaviour?

@dqbd

dqbd commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Added, thank you @ArnaudBarre!

@sapphi-red

Copy link
Copy Markdown
Member

@sapphi-red an opinion on the default behaviour?

Given that the babel plugin (and Next.js) doesn't emit these logs, I think we can skip these by default.

@sapphi-red sapphi-red changed the title feat(react): make logging diagnostics an opt-in for React Compiler fix(react): make logging diagnostics an opt-in for React Compiler Aug 28, 2026
Comment thread packages/plugin-react/tests/reactCompiler.test.ts Outdated
@sapphi-red
sapphi-red merged commit 397e847 into vitejs:main Aug 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants