citty icon indicating copy to clipboard operation
citty copied to clipboard

feat: cache async results

Open zuixinwang opened this issue 2 years ago • 1 comments

close #34

zuixinwang avatar May 25 '23 08:05 zuixinwang

Hi. Thanks for this PR (and sorry for late review). I think this would be a really really nice enhancement. However we might need to make it opt-in (or opt-out) by explicitly passing a context dependent (non global) cavche instance from resolveValue calls.

Having live value would be particularly useful for supporting HMR with cli development.

Also note that usual usage for async with dynamic imports, Node.js ALWAYS caches the import results so calling it twice would already leverage cache.

pi0 avatar Jun 18 '23 11:06 pi0

Thanks for PR again, considering the risks of stalling resolved value, i think it is better we don't introduce it.

pi0 avatar Mar 08 '25 21:03 pi0