-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Small lints #3244
Small lints #3244
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ export function getRegisteredStyles( | |
|
||
classNames.split(' ').forEach(className => { | ||
if (registered[className] !== undefined) { | ||
registeredStyles.push(`${registered[className]};`) | ||
} else { | ||
registeredStyles.push(registered[className] as string) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added in #1656 . Maybe it's good to consider that a mistake in hindsight but it doesn't give me confidence that we can remove this safely now. I'm surprised that tests are OK with this change (well, some failed but I'm not sure if this is related, I see some hashes changed but I'd expect some functional break too). Maybe we are missing a test case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The The I'll revert it for now though, might require more investigation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} else if (className) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a test case probably could be written for this, does it create a problem though? a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah someone might have inserted additional whitespaces in their classnames. So sure engines will usually use a concatenated string like I describe here to optimize concat operations, but adding a single I wrote a benchmark with only this difference, it does seem to have a positive impact: (I inserted a bunch of spaces to highlight the impact more clearly) |
||
rawClassName += `${className} ` | ||
} | ||
}) | ||
|
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.
\s
contains\n
. Seenode -p "'\\n'.match(/\\s/)"