-
-
Notifications
You must be signed in to change notification settings - Fork 938
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
Fixed selector|value-no-vendor-prefix performance #7016
Conversation
🦋 Changeset detectedLatest commit: 6a918a6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
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.
Great! LGTM 👍🏼
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
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.
Thank you! 👍🏼
@@ -0,0 +1,5 @@ | |||
const prefixes = new Set(['-webkit-', '-moz-', '-ms-', '-o-']); |
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.
If this is to be reused, Ill eventually add some more rare ones to the set.
ref: https://stackoverflow.com/questions/11705144/webkit-and-its-legacy-prefixes
!isStandardSyntaxProperty(decl.prop) || | ||
!value.startsWith('-') | ||
) { | ||
if (!hasPrefix(value)) return; |
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.
A more agnostic way would be to use
Lines 22 to 30 in 3065425
prefix(prop) { | |
const match = prop.match(/^(-\w+-)/); | |
if (match) { | |
return match[0] || ''; | |
} | |
return ''; | |
}, |
instead.
#6869
selector-no-vendor-prefix
Mean: 246.52507291666666 ms
Deviation: 22.75678614753106 ms
To
Mean: 91.62227779999999 ms
Deviation: 7.8451629248369095 ms
value-no-vendor-prefix
Mean: 102.0994388 ms
Deviation: 11.78154094781758 ms
To
Mean: 91.27013606666667 ms
Deviation: 15.351019516794766 ms