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

feat(internal): cached datasource lookups #5870

Merged
merged 16 commits into from
Apr 4, 2020
Merged

Conversation

rarkins
Copy link
Collaborator

@rarkins rarkins commented Apr 4, 2020

This PR simplifies the cdnjs datasource while abstracting away the task of caching. Also removes unnecessary getDigest.

I took away some of the "safety" and null checks because I think this datasource should throw a DatasourceError for all errors except 404.

The important thing here is abstracting away the caching - I want to add this to all datasources if possible.

@rarkins rarkins requested a review from viceice April 4, 2020 06:53
…urce-cdnjs

# Conflicts:
#	lib/datasource/cdnjs/index.spec.ts
#	lib/datasource/cdnjs/index.ts
@viceice
Copy link
Member

viceice commented Apr 4, 2020

Have some improvements for types, will do them later, currently on mobile only

viceice
viceice previously approved these changes Apr 4, 2020
@rarkins
Copy link
Collaborator Author

rarkins commented Apr 4, 2020

I split some of the work into #5871

# Conflicts:
#	lib/datasource/cdnjs/__fixtures__/KaTeX.json
#	lib/datasource/cdnjs/index.ts
…tebot/renovate into refactor/datasource-cdnjs

# Conflicts:
#	lib/datasource/cdnjs/index.spec.ts
viceice
viceice previously approved these changes Apr 4, 2020
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have the cache a default timeout?

@rarkins
Copy link
Collaborator Author

rarkins commented Apr 4, 2020

Should have the cache a default timeout?

yes, I'll add. Doing some more refactoring

@viceice
Copy link
Member

viceice commented Apr 4, 2020

I added some code docu, so ide users can see it and it would hopefully help them to use it.

@rarkins rarkins requested a review from viceice April 4, 2020 09:49
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my commit for changes.

JsDoc types can't be linked: microsoft/TypeScript#35524

@rarkins rarkins changed the title feat(internal): cacheAble datasource lookups feat(internal): cached datasource lookups Apr 4, 2020
@rarkins rarkins merged commit d90d94f into master Apr 4, 2020
@rarkins rarkins deleted the refactor/datasource-cdnjs branch April 4, 2020 15:34
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 19.195.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants