fix(cache): default clean: true when necessary, add extraCacheKeys option#420
fix(cache): default clean: true when necessary, add extraCacheKeys option#420oscard0m wants to merge 3 commits intoezolenko:masterfrom
clean: true when necessary, add extraCacheKeys option#420Conversation
There was a problem hiding this comment.
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.
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.
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?