Repository navigation
Conversation
The refresh condition of the compiler plugin was inverted in vitejs#1516, so JSX files got no Fast Refresh and non-JSX files got the refresh transform again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Description
#1516 inverted the refresh condition of the compiler plugin. Without
refreshInclude/refreshExclude,refreshis now only enabled for files that are not JSX and do not import the JSX runtime, and with them, only for the files the filter excludes:So with
react({ compiler: true })on main:.tsxfiles get no Fast Refresh registration (no$RefreshReg$).tsfiles with hooks get$RefreshSig$again, which is what fix(plugin-react): disable refresh for non-jsx with compiler enabled #1485 fixed ([plugin-react] Native React Compiler injects Fast Refresh registrations into Web Worker .ts modules #1478)This restores the condition from before #1516 and applies the refresh filter on top of it:
The two new unit tests run the compiler transform in serve mode and fail on main: one checks that a
.tsxcomponent gets$RefreshReg$and a.tshook gets no$RefreshSig$, the other thatrefreshInclude/refreshExcludeinclude and exclude files.No changelog entry, since #1516 is not released yet.
Found while rebasing #1467.
🤖 Generated with Claude Code