-
Notifications
You must be signed in to change notification settings - Fork 293
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 conditional style ordering #893
Conversation
🦋 Changeset detectedLatest commit: 3d09c6b The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 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 |
…s/vanilla-extract into fix-condition-sorting
const matchingCondition = this.ruleset.find( | ||
(cond) => cond.query === query, | ||
); | ||
for (const { query, rules, children } of incomingRuleset.ruleset.values()) { |
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.
The comment on the line above should now be Wait nevermind it's still constructing an array.Merge rulesets into one map
, or you could shorten it to Merge rulesets
to make it data structure agnostic.
This PR resolves an issue where our conditional style sort algorithm was not implementing the
Array.sort
spec correctly. It didn't handle conditions that don't have direct relationships to each other.I have refactored
conditionalRulesets
to instead store rulesets as aMap
(which is ideal for lookups) and then return a correctly sorted ruleset array when requested.Fixes #874