fix: detect React Compiler through bundled config wrappers - #1470
Merged
Conversation
commit: |
aidenybai
marked this pull request as ready for review
July 28, 2026 10:03
Contributor
Interactive terminal E2ERecorded from the built CLI at |
This was referenced Jul 28, 2026
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
defineConfig()+reactCompilerPreset()setupFixes #1468.
Root cause
The detector could resolve
defineConfiginto Vite's bundled package implementation, but arguments forwarded through that re-export chain were analyzed against Vite's source file. Imports owned by the user's config, includingreactCompilerPreset, were therefore no longer resolvable.The fix carries each bound expression's originating analysis context through calls and selected object properties. This follows the actual wrapper implementation instead of treating every
defineConfig-shaped call as transparent, preserving the negative case where a wrapper discards the compiler-enabled config.Product brief
project.reactCompilertelemetry dimensionValidation
nr testnr typechecknr lintnr format:checknr smoke:json-reportreact-doctor --verbose --scope changed— 100/100, no issuesNote
Medium Risk
Touches recursive static analysis in project discovery; incorrect heuristics could mis-gate compiler-related diagnostics, but scope is limited to detection logic with expanded fixture tests.
Overview
React Compiler detection now follows config arguments through bundled wrapper functions (Vite
defineConfig, Next.js-style helpers) instead of analyzing them only inside the wrapper package, so user-owned imports likereactCompilerPresetandreactCompilerflags resolve correctly.The config analyzer threads originating analysis context with each bound expression (
ConfigExpressionReference/ConfigPropertyReference), including when crossing imported re-exports and function parameters. Wrappers that discard the passed config still evaluate as no compiler.Tests cover Vite 8
defineConfig+reactCompilerPreset, and parameterized Next.js bundled wrappers (pass-through, nested selection, discard). Patch changeset for@react-doctor/coreandreact-doctor.Reviewed by Cursor Bugbot for commit a8613eb. Bugbot is set up for automated code reviews on this repo. Configure here.