Added caching to getBrowserName()#113
Merged
ErikBjare merged 3 commits intoActivityWatch:masterfrom Aug 2, 2023
Merged
Conversation
Member
|
I rewrote your implementation to store the information in the Review & testing appreciated, then ready for merge :) |
Contributor
Author
|
I removed an async and an await that is not needed anymore. From a quick test of my commit, it seems that aw-watcher-web is working as expected. |
Member
|
Very nice, thanks! Not sure when I'll get around to making a new release for the addon stores, hopefully in not too long. |
powellnorma
pushed a commit
to powellnorma/aw-watcher-web
that referenced
this pull request
Oct 3, 2024
* Added caching to getBrowserName() * fix: improved caching of browserName * Removed unused async and await --------- Co-authored-by: Erik Bjäreholt <erik@bjareho.lt>
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.
This time (my second PR on this optimizing getBrowserName, previous: #89) I went with a caching approach instead of writing a lightweight alternative to UAParser.
UAParser is still a fairly heavy library, however we will only be using it for the first time we call getBrowserName().
I have only tested in Firefox where it seems to work perfectly fine.
A few functions have been turned asynchronous, however I have not spotted any places where that could be an issue, and awaits have been added where needed.