fix(compiler): expand var()-valued border-inline shorthands to start/end#393
Draft
YevheniiKotyrlo wants to merge 1 commit into
Draft
Conversation
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.
Completes #379
#379 maps the logical-border longhands to their RN start/end props via
propertyRename(border-inline-start-color→borderStartColor, …). The shorthandsborder-inline-color/border-inline-widthtake a different path when they'revar()-valued: the parsedparseBorderInline*never runs (the value is a runtime variable), so they fall through toparseUnparsedDeclaration— wherepropertyRenameonly covers the longhands. The shorthand is therefore never expanded to start/end and silently drops on native (RN has noborder-inline-*).Concretely:
border-x/border-ycomposed from a runtime variable (border-inline-color: var(--x)) renders nothing, while the explicit-value form #379 already handles works.Fix
Expand the two logical-border shorthands to their RTL-aware start/end props inside
parseUnparsedDeclaration, sharing the single runtime value — exactly whatparseBorderInline*does on the parsed path:border-inline-stylestays out — RN has noborderStartStyle/borderEndStyleto map it to (it's already in the unsupported set).Test plan
New cases in
src/__tests__/compiler/logical-borders.test.ts: avar()-valuedborder-inline-colorandborder-inline-widtheach expand to both start and end descriptors sharing the resolved value. Verified against #379's built branch — this branch is stacked onfix-logical-border-props, so the diff here is only the completion (+24 logic / +33 tests).yarn test,yarn typecheck,yarn eslint, andprettier --checkpass; lefthook-clean.Stacked on your
fix-logical-border-propsbranch so this shows only the delta. Merge it into #379, cherry-pick the commit, or tell me to retarget — whatever's easiest for you.