-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix(cache): default clean: true
when necessary, add extraCacheKeys
option
#420
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
extraCacheKeys
option 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
clean
option totrue
by 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
clean
option depending on these 2 other options?
Yep. Here's a quick logic flow:
clean
isfalse
by default- If
sourceMapCallback
ortransformers
are passed in, then it should default totrue
instead - If
extraCacheKeys
is passed in, then it should default back tofalse
again
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 |
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.
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.clean
as'true'
by defaultContext
Fixes #228
Questions
extraCacheKeys
option declared? I don't find it. (_originally posted here)clean
option depending on these 2 other options?