This repository was archived by the owner on Jun 18, 2018. It is now read-only.
Open
Conversation
Member
|
Sure, sounds good. I’ll leave it to @kesne to review/release. |
| /firefox/i.test(navigator.userAgent) | ||
| ); | ||
| const _isSafari = Boolean(window.safari); | ||
| const _isFirefox = !_isSafari && /firefox/i.test(navigator.userAgent); |
Collaborator
There was a problem hiding this comment.
Do you need the !_isSafari here?
Author
There was a problem hiding this comment.
No. It was stupid. For some reason I had the impression that this file was ment to be as optimized as possible, and I assumed that for all iOS-devices out there it would be a tiny bit faster to not have to execute that regex.
It could also be an idea to not use an regexp for this simple task at all:
const _isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
Collaborator
There was a problem hiding this comment.
That also seems like a positive change to me.
Let's just guard these in checks so that this doesn't blow up server rendering!
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
@gaearon Whyyyy import another (big) module for memoizing two functions that basically are just constants (pure functions with no arguments)??
This is just picking, and I know you probably aren't actively maintaining this project. But since I stumbled upon it, and since I know you are into optimizing nowadays, I just wanted to mention it. 😃
I'm also very inspired of this one right now: nolanlawson.com The Cost of Small Modules Just think about how extremely much overhead you are putting on something that is basically just a constant value anyway 😮