Repository navigation
fix: resolve escaped local composition names - #72
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>
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.
Fixes #70.
The default
generateExportEntrydecodes CSS escapes in export keys, but localcomposesreferences were looked up using their escaped spelling. Decode the local lookup name with that same rule when the default export callback is used.This also handles the ambiguous case where both
.tag\:aand.tag\\\:aexist: an escaped reference to the first must not silently compose the second. Keep customgenerateExportEntrycallbacks' existing exact-key behavior, and leave global/imported references and the missing-class diagnostic unchanged.Tests add escaped colon/slash composition, the literal-backslash collision, and custom export-key compatibility. All 45 repository tests pass, along with ESLint and Prettier.
I also checked ordinary CSS Modules imports in Vite 8.4.1 production builds, substituting only this plugin in memory. Stock fails the escaped-utility case; the fix emits the intended direct and transitive class tokens. A local Chromium 154 test loads the emitted JS and CSS: the collision renders blue on stock versus red with the fix, and the composed utility card gets the expected color and 42px width. The collision CSS is identical in both builds.