A pull request by @sokra was merged and maintainers requested a documentation change.
See pull request: webpack/webpack#11176
add missing serializers for classes used in test suite
cc @evilebottnawi for terser-webpack-plugin
What kind of change does this PR introduce?
feature
Did you add tests for your changes?
internal plugins now use the new API
Does this PR introduce a breaking change?
yes, compilation.cache is deprecated now
What needs to be documented once your changes are merged?
- The API for access to cache has changed. It's now very similar to the API to get Loggers.
compilation.getCache("MyPlugin") resp. compiler.getCache("MyPlugin") can be used to get a CacheFacade, which is a way to access the cache. compilation.getCache should be preferred of compiler.getCache.
Interface of CacheFacade see here: https://github.com/webpack/webpack/pull/11176/files#diff-d96ec7ae5bb4a0907779f25ed03acb33
There are methods for get and store and promise variants.
There is also a getChildCache(name) method to get a child cache,
and there is a getItemCache(identifier, etag) to get an ItemCacheFacade which allows to access a single item.
The CacheFacade also exposes getLazyHashedEtag to get etags for hashable objects like Sources.
A pull request by @sokra was merged and maintainers requested a documentation change.
See pull request: webpack/webpack#11176
add missing serializers for classes used in test suite
cc @evilebottnawi for terser-webpack-plugin
What kind of change does this PR introduce?
feature
Did you add tests for your changes?
internal plugins now use the new API
Does this PR introduce a breaking change?
yes,
compilation.cacheis deprecated nowWhat needs to be documented once your changes are merged?
compilation.getCache("MyPlugin")resp.compiler.getCache("MyPlugin")can be used to get aCacheFacade, which is a way to access the cache.compilation.getCacheshould be preferred ofcompiler.getCache.Interface of
CacheFacadesee here: https://github.com/webpack/webpack/pull/11176/files#diff-d96ec7ae5bb4a0907779f25ed03acb33There are methods for
getandstoreand promise variants.There is also a
getChildCache(name)method to get a child cache,and there is a
getItemCache(identifier, etag)to get anItemCacheFacadewhich allows to access a single item.The
CacheFacadealso exposesgetLazyHashedEtagto get etags for hashable objects likeSources.