-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix broken css prop ternaries when referencing cssMap
objects.
#1767
Conversation
…tional expressions. Fixes #1750 We simply copy the direct `buildCss > MemberExpression > …` extraction into a new path through `buildCss > ConditionalExpression > extractConditionalExpression(…) > MemberExpression > …`.
🦋 Changeset detectedLatest commit: 5bcb62a The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for compiled-css-in-js canceled.
|
}; | ||
} | ||
|
||
if (fallbackToEvaluate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel a bit annoyed by adding this false
here, but I get into this endless loop with non-cssMap objects, eg. loading ? colors.N20 : colors.N40
where it blew up in a test.
This keeps it 1:1 with the current state by default and lets this if (bindingIdentifier && meta.state.cssMap[bindingIdentifier.name]) {
flow be reused in extractConditionalExpression
, so it feels sane to me.
What is this change?
We extract nested member expressions inside of conditional expressions.
Why are we making this change?
Fixes #1750
How are we making this change?
We simply copy the direct
buildCss > MemberExpression > …
extraction into a new path throughbuildCss > ConditionalExpression > extractConditionalExpression(…) > MemberExpression > …
.…I believe this is safe and well protected, given the underlying
extractMemberExpression
code already existed!PR checklist
I have...
Updated the documentation inn/awebsite/