Repository navigation
fix(plugin-react): honor explicit all-mode compilation - #1624
Open
Cynnamoroll wants to merge 1 commit into
Open
Cynnamoroll wants to merge 1 commit into
Cynnamoroll wants to merge 1 commit into
Conversation
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
ArnaudBarre
approved these changes
Dec 4, 2026
ArnaudBarre
left a comment
Member
There was a problem hiding this comment.
Given that it doesn't change the behaviour for the default usage I'm ok with this change
This branch has not been deployed
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.
With
compilationMode: 'all', a top-level anonymous default component such asexport default ({ name }) => <div>{name}</div>was skipped by both the native plugin and the Babel preset. Its source doesn't match the heuristic used to find component and hook names. The compiler itself does optimize this component when given the same options.Skip the source-code prefilter only for explicit
allmode. File and environment filters still apply. Infer and annotation modes keep their existing filters.I tested both compiler paths with production Vite builds and React DOM. Rendering the same component with labels
one,one,twocalled a stable render prop three times before this change and twice after it. Both paths still skipped the same unannotated component in infer and annotation modes, when the file was excluded, and in SSR builds. All ten cases rendered the expected text.All 59 plugin-react unit tests, the workspace build, package typecheck, repo lint and formatting passed. Developed and tested with AI assistance (Factory Droid).