Skip to content
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

chore: use compilation.getCache() instead of compilation.cache #284

Closed

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented Aug 3, 2020

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Breaking Changes

Remove deprecated method

Additional Info

Refers webpack/webpack-cli#1724 (comment) webpack/webpack-cli#1724 (comment)

@codecov
Copy link

codecov bot commented Aug 3, 2020

Codecov Report

Merging #284 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #284   +/-   ##
=======================================
  Coverage   93.05%   93.05%           
=======================================
  Files           5        5           
  Lines         403      403           
  Branches      154      154           
=======================================
  Hits          375      375           
  Misses         27       27           
  Partials        1        1           
Impacted Files Coverage Δ
src/Webpack5Cache.js 90.32% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a5acaa...3bdb9f8. Read the comment docs.

@@ -11,7 +11,7 @@ export default class Cache {
}

isEnabled() {
return Boolean(this.compilation.cache);
return Boolean(this.compilation.getCache());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return Boolean(this.compilation.getCache());
return true;

This always exists and getCache() always returns something.

It's not detectable if the cache is enabled. When no memory cache or filesystem cache is attached cache.get always returns undefined and store does nothing. Is this needed to be detectable? @evilebottnawi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add tests on this, but I think it is unnecessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants