-
Notifications
You must be signed in to change notification settings - Fork 70
fix(cache): default clean: true when necessary, add extraCacheKeys option
#420
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
base: master
Are you sure you want to change the base?
fix(cache): default clean: true when necessary, add extraCacheKeys option
#420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good questions -- you're on the right track with those 🙂
- Where is the
extraCacheKeysoption declared? I don't find it. (_originally posted here)
It doesn't exist yet -- this PR would be creating it.
It would be placed in the same index.ts block where you changed clean currently (the Object.assign block sets defaults).
- Set
cleanoption totrueby default
It should not be true by default -- see below
- Does this mean I need to do some logic to decide the default value for
cleanoption depending on these 2 other options?
Yep. Here's a quick logic flow:
cleanisfalseby default- If
sourceMapCallbackortransformersare passed in, then it should default totrueinstead - If
extraCacheKeysis passed in, then it should default back tofalseagain
2 should also log out, telling the user to set extraCacheKeys if they want to re-enable the cache.
extraCacheKeys options, default to clean: true when necessary
extraCacheKeys options, default to clean: true when necessaryextraCacheKeys option, default to clean: true when necessary
extraCacheKeys option, default to clean: true when necessaryclean: true when necessary, add extraCacheKeys option
a196d87 to
fa70a2f
Compare
|
Applied more changes to the draft. Now it's not clear to me which part of the code (and how) the |
agilgur5
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on my phone rn, so only left a few simpler comments for now.
With regard to where to use extraCacheKeys, it would be in the call to object-hash in tscache, i.e. in this block.
agilgur5
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few other things from my laptop now
Summary
options.cleanas'true'by defaultContext
Fixes #228
Questions
extraCacheKeysoption declared? I don't find it. (_originally posted here)cleanoption depending on these 2 other options?