Avoid prefixing css vars - #302
Merged
Merged
Conversation
Andarist
commented
Sep 9, 2022
Pull Request Test Coverage Report for Build 50eaf8637b4ed9b8ed9bf6e49adf6cc35f4af1ca-PR-302
💛 - Coveralls |
Andarist
commented
Sep 9, 2022
| */ | ||
| export function prefix (value, length, children) { | ||
| switch (hash(value, length)) { | ||
| switch (charat(value, 0) != 45 && charat(value, 1) != 45 && hash(value, length)) { |
Collaborator
Author
There was a problem hiding this comment.
the expression's type now is false | number - perhaps we should convert false to a 0? would that have any effect on the engine? According to some TS PRs that I've seen lately (like this one) JS engines don't do jump-table optimization for switch statements anyway so perhaps this doesn't matter at all? I'm not sure 🤷♂️
Owner
There was a problem hiding this comment.
The second charat(value, 0) != 45 is probably not needed as we also prefer to not touch -webkit- already prefixed props.
It'd put charat(value, 0) < 46 ? 0 : ... inside the hash function.
There was a problem hiding this comment.
It depends on the function - we believe the jump table optimization didn't happen because forEachChild was just very large.
Andarist
commented
Sep 9, 2022
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 #301