feat: configurable compilationMode (#67)#78
Open
blazejkustra wants to merge 1 commit into
Open
Conversation
Expose React Compiler's `compilationMode` as a per-workspace setting (`infer` | `annotation` | `syntax` | `all`, default `infer`) across all clients (VS Code, IntelliJ, Neovim, Zed, CLI), so teams using `annotation` mode for incremental adoption see markers that match their actual build output. Invalid values fall back to `infer` and the compilation cache is invalidated when the mode changes.
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.
Closes #67.
Summary
compilationModeas a per-workspace setting (infer|annotation|syntax|all, defaultinfer) instead of hardcoding"infer"incheckReactCompiler.ts.--compilation-mode)."infer"with a throttled error, so a typo can't break the inlay-hint pass.panicThreshold,enableTreatRefLikeIdentifiersAsRefs) stay hardcoded — they're set the way they are because this is a marker tool.Why this matters
Teams using
compilationMode: "annotation"for incremental adoption (only"use memo"opted-in functions get compiled) currently see the extension light up every component, which doesn't match what React Compiler actually does in their app. With this setting, the markers track the real build.Test plan
npm testinpackages/vscode-client— 14/14 pass, including a newannotation-mode.tsxfixture asserting that under"annotation"only the"use memo"component compiles, while"infer"still compiles both.tsc -bclean acrossserverandvscode-client; ESLint clean.--compilation-modeflag rejects invalid values before invoking the report.reactCompilerMarker.compilationModeflipped between values; confirm cache invalidates and markers update.