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
feature: use disk file cache #3275
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3275 +/- ##
==========================================
- Coverage 93.12% 93.09% -0.04%
==========================================
Files 170 170
Lines 5967 5969 +2
Branches 1780 1781 +1
==========================================
Hits 5557 5557
- Misses 219 220 +1
- Partials 191 192 +1
Continue to review full report at Codecov.
|
Hi, thanks for the PR. Could you outline how this enables users to use a disk cache, or more general, how this feature should be used? If we want this feature, then it would need to be documented, possibly with an example as I believe it will be non-trivial. Also, even though you checked the box that there are tests you did not add any, which means the coverage check fails. I may be able to help you with the latter, but first it would be important to see an example usage. |
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.
Also see the longer comment I left in the discussion. Mostly, we need tests and documentation.
@@ -139,6 +139,10 @@ export class Task { | |||
}); | |||
this.inputOptions = inputOptions; | |||
|
|||
if (config && config.cache) { |
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.
Is it possible the config is not an object? Otherwise the check can be shortened.
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.
you are right, it my habitual behavior.
I would have a negative attitude to "use disk cache" if For project like Cocos Creator 3D, the |
@shrinktofit I wouldn't think in today's day and age that a 300mb cache would be too large. @lukastaegert is there a hook that could be used to compress/decompress this cache file? I'm not sure I think the added dependency on something that could gzip, etc would be worth the increase in size to the rollup core bundle. But for those who have massive cache files, it could be useful to provide a path to reducing the file size. |
No, and contrary to the title, this PR DOES NOT add a disk cache to Rollup, which is why any discussion around this is not really relevant to this PR. As I understand it it enables users of the JS API to hook in their own (disk or otherwise) cache by properly restoring from a given cache object. Which is why I was asking for an example code how this could be used to actually have a disk cache and documentation in general. |
eca6a6c
to
71d20c9
Compare
cbd94e6
to
f1538ce
Compare
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
can use disk file cache when rollup watch