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

Conversation

Projects
None yet
3 participants
@dotconnor
Copy link
Contributor

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)

dotconnor added some commits Jun 1, 2019

remove chrome polyfill
Already polyfilled by webextension-polyfill
Show resolved Hide resolved source/libs/cache.ts Outdated

@bfred-it bfred-it changed the title New cache implementation WIP: New cache implementation Jun 2, 2019

dotconnor added some commits Jun 2, 2019

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/cache.ts Outdated
Show resolved Hide resolved source/libs/get-default-branch.ts Outdated
Show resolved Hide resolved source/libs/cache.ts Outdated
@bfred-it

This comment has been minimized.

Copy link
Collaborator

commented Jun 4, 2019

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

Show resolved Hide resolved source/libs/cache.ts Outdated

@bfred-it bfred-it added the meta label Jun 4, 2019

@dotconnor

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2019

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

@bfred-it bfred-it changed the title WIP: New cache implementation New cache implementation Jun 4, 2019

@bfred-it

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2019

@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.

@bfred-it bfred-it requested a review from sindresorhus Jun 5, 2019

@bfred-it bfred-it merged commit a3e5423 into sindresorhus:master Jun 7, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bfred-it

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 7, 2019

@bfred-it

This comment has been minimized.

Copy link
Collaborator

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

@bfred-it

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

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

@bfred-it

This comment has been minimized.

Copy link
Collaborator

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 dotconnor:new-cache branch Jun 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.