Skip to content
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

New cache implementation #2109

Merged
merged 10 commits into from Jun 7, 2019
Merged

Conversation

dotconnor
Copy link
Contributor

@dotconnor dotconnor commented Jun 1, 2019

What methods should I implement besides get/set?

  • set
  • get
  • has
  • purge (clean up old/unused cached data)

Closes #2100

Test

https://github.com/sindresorhus/refined-github (Open devtools on the background page to see the console, repo pages use release-count and default-branch caches)

Already polyfilled by webextension-polyfill
source/libs/cache.ts Outdated Show resolved Hide resolved
@fregante fregante changed the title New cache implementation WIP: New cache implementation Jun 2, 2019
source/libs/cache.ts Outdated Show resolved Hide resolved
source/libs/cache.ts Outdated Show resolved Hide resolved
source/libs/cache.ts Outdated Show resolved Hide resolved
source/libs/cache.ts Outdated Show resolved Hide resolved
source/libs/cache.ts Outdated Show resolved Hide resolved
source/libs/cache.ts Outdated Show resolved Hide resolved
source/libs/cache.ts Outdated Show resolved Hide resolved
source/libs/cache.ts Outdated Show resolved Hide resolved
source/libs/get-default-branch.ts Outdated Show resolved Hide resolved
source/libs/cache.ts Outdated Show resolved Hide resolved
@fregante
Copy link
Member

fregante commented Jun 4, 2019

Apart from the review, is this PR still a WIP?

source/libs/cache.ts Outdated Show resolved Hide resolved
@fregante fregante added the meta Related to Refined GitHub itself label Jun 4, 2019
@dotconnor
Copy link
Contributor Author

@bfred-it I'm good with this when you are.

@fregante fregante changed the title WIP: New cache implementation New cache implementation Jun 4, 2019
@fregante
Copy link
Member

fregante commented Jun 4, 2019

The suggested test isn't working in Chrome nor Firefox. They appear in the cache but the cached releases number isn't picked up and shown elsewhere

Screenshot 2019-06-05 at 03 58 58

@dotconnor
Copy link
Contributor Author

@bfred-it Looks like the default branch one is working (for me at least), still trying to figure out why the release count one isn't working.

@fregante fregante merged commit a3e5423 into refined-github:master Jun 7, 2019
@fregante
Copy link
Member

fregante commented Jun 7, 2019

Thanks for this! Are you interested in publishing it as a module? I’ve been wanting to publish a module like this as webext-storage-cache

@dotconnor
Copy link
Contributor Author

@fregante
Copy link
Member

fregante commented Jun 7, 2019

I'd have preferred webext-storage-cache because there's also the regular browser cache which might be confused with it. If you prefer I can publish and mainain the module as my own

@fregante
Copy link
Member

fregante commented Jun 7, 2019

I got the repo transfer, thanks! Can you npm unpublish webext-cache --force to avoid duplicates? I just published a temporary webext-storage-cache

Storage Cache for Web Extensions
https://github.com/dotconnor/webext-storage-cache#readme

dist
.tarball: https://registry.npmjs.org/webext-storage-cache/-/webext-storage-cache-0.0.0.tgz
.shasum: ad847845ce2cb56ce53c89b68a991d46635e2c1c
.integrity: sha512-ZwBQLPHrETO5uf81Cw4iTr75KaQj5vGs8vW3LXfm1pl3FitflGMB2h/x1zEs8c5nkGJWseD6sF3dftx4XJ2ZgA==
.unpackedSize: 4.7 kB

dependencies:
webext-detect-page: ^0.9.1 

maintainers:
- bfred-it <npm@bfred.it>

dist-tags:
latest: 0.0.0  

published 2 minutes ago by bfred-it <npm@bfred.it>

@notlmn
Copy link
Contributor

notlmn commented Jun 7, 2019

I'd suggest to open a new issue to track the migration process, updating across all features that use cache.

@fregante
Copy link
Member

fregante commented Jun 7, 2019

You can use the local version for now. When I'm ready with the npm module I'll just implement it in RGH. Only 2 features use it at the moment.

@dotconnor dotconnor deleted the new-cache branch June 8, 2019 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Related to Refined GitHub itself
Development

Successfully merging this pull request may close these issues.

Replace our cookie-based cache with self-clearing browser.storage
3 participants