Skip to content

New cache implementation - #2109

Merged
fregante merged 10 commits into
refined-github:masterfrom
dotconnor:new-cache
Jun 7, 2019
Merged

fregante merged 10 commits into
refined-github:masterfrom
dotconnor:new-cache

Conversation

@dotconnor

@dotconnor dotconnor commented Jun 1, 2019 •

Copy link
Copy Markdown
Contributor

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 2 commits June 1, 2019 18:36
Already polyfilled by webextension-polyfill
Comment thread source/libs/cache.ts Resolved
@fregante fregante changed the title New cache implementation WIP: New cache implementation Jun 2, 2019
Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/get-default-branch.ts Resolved
Comment thread source/libs/cache.ts Resolved
@fregante

fregante commented Jun 4, 2019

Copy link
Copy Markdown
Member

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

Comment thread source/libs/cache.ts Resolved
Comment thread source/libs/cache.ts Resolved
@fregante fregante added the meta Related to Refined GitHub itself label Jun 4, 2019
@dotconnor

Copy link
Copy Markdown
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

fregante commented Jun 4, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
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 requested a review from sindresorhus June 5, 2019 04:15
@fregante
fregante merged commit a3e5423 into refined-github:master Jun 7, 2019
@fregante

fregante commented Jun 7, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

@fregante

fregante commented Jun 7, 2019 •

Copy link
Copy Markdown
Member

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

fregante commented Jun 7, 2019

Copy link
Copy Markdown
Member

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 <[email protected]>

dist-tags:
latest: 0.0.0  

published 2 minutes ago by bfred-it <[email protected]>

@notlmn

notlmn commented Jun 7, 2019

Copy link
Copy Markdown
Contributor

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

@fregante

fregante commented Jun 7, 2019 •

Copy link
Copy Markdown
Member

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