- Low level resolution cache
- Missing resolution attempt check
- Expose a 'hard-source-cache-factory' plugin hook on the compiler
- Cache module resolutions in a cache serializer
- Expose a 'hard-source-log' plugin hook on the compiler
- Default options
0.4.4
Fix configHash default value0.4.3
Fix #105. Cache assets in memory as well as disk0.4.2
Tune default options0.4.1
Add Appveyor CI
Prior versions of hard-source cache resolution values the NormalModuleFactory creates and a similar data for the ContextModuleFactory. These higher level resolutions provide a lot of hard-sources performance gain by reusing those values when resolving modules as long as an assumption holds. The file or context the resolution points at must still exist. The low level resolution cache takes this further caching the work resolving files, loaders, and contexts. These cached resolutions can be reused between multiple module resolutions as they may share files or loaders. Two modules with the same file but different loaders go through separate NormalModuleFactory resolutions meaning they hit the lower level resolvers. This new cache provides some performance gains in regards to the reused values.
Highly related to the low level resolution cache is the missing resolution attempt check that can be made. When the low level resolvers try to find the resource for a request it can optionally build an array of missing paths that it tried. Caching that information hard-source now provides a stronger assurance that what should have been built is. Seeing any of those missing attempts now existing means the old resolution is invalid and any related NormalModuleFactory resolution is also invalid. During the new build, hard-source will let the normal resolutions occur and store the new information.
Leading up to changing the default cache serializer (#53), hard-source has its first plugin hook to make it more flexible. The 'hard-source-cache-factory'
plugin hook on the webpack compiler lets a users determine how the cache is write to and read from disk. Documentation on this is in the lib/cache-serializer-factory.js
module.
With this hook a working additional serializer and plugin is available to replace the leveldb default serializer with a json serializer. This serializer is primarily available for debugging the contents of the cache as they're directly human readable.
To use this plugin you can add it to your config
plugins: [
// other plugins
new HardSourceWebpackPlugin.HardSourceJsonSerializerPlugin(),
As a step to #53 a patch version with a replacement to the leveldb will come out during v0.4.x
that will become the default in v0.5.0
.
Up until this version the NormalModuleFactory resolutions were using some old code to write and read its cache. That has been replaced with a cache serializer like the other caches. This has little effect on reading but provides a small performance gain when writing changes to the cache from the build. The cache serializers are able to write out changes instead of needing to write out the whole cache. This may a small measurable impact on large project where they were writing out the whole module resolution cache.
A second plugin hook in this release, 'hard-source-log'
presents a way to control the logging output from hard-source. Two obvious uses is a plugin to silence its output or another to write the output to disk. Documentation on this plugin hook can be found in lib/logger-factory.js
.
With a plugin approach to logging, more logging of lower levels (debug, log) will be added that a plugin will optionally enable for writting out. This additional logging will cover when and why modules are invalidated, timing and other information to help debug hard-source.
Past versions required at least the cacheDirectory
and recordsPath
options, along with recommending the configHash
option. This release sets defaults for these making hard-source easier to use.
cacheDirectory
defaults to'node_modules/.cache/hard-source/[confighash]'
recordsPath
defaults to'node_modules/.cache/hard-source/[confighash]/records.json'
configHash
defaults torequire('node-object-hash')({sort: false}).hash
- Internal env-hash implementation relying on file hashes
- Support context dependencies and ContextModule
- Preload the memory cache for faster builds
The env-hash
implementation is more generalized than the npm env-hash implementation that was previously used. That one focused on hashing modified time values of folders and files to be as fast as possible. This new one is a little slower hashing files and files of folders but supports use cases like reusing a cache from a prior build on a CI environment. While the CI environment would have all new modified times, if the files' content didn't change the hash of those files will be the same letting the old cache be used.
Context dependencies and ContextModules are now supported. This information is stored in the cache and deserialized like file dependencies and NormalModules. This will allow projects with ContextModules and NormalModules with context dependencies to gain the caching benefit they were previously missing.
Webpack's memory cache allows webpack to make assumptions about previously built modules and skip build steps it would otherwise perform on those modules. That cache is now filled with up to date modules from the HardSource cache letting builds with webpack or the first build with a webpack server to gain the performance those assumptions support.
0.3.13
Support change to error rendering in webpack 20.3.12
Support different resolutions in different child compilations0.3.11
Support optional dependencies0.3.10
Fix webpack typo'd dependency (HarmonyCompatiblilityDependency)0.3.9
Support webpack.IgnorePlugin0.3.8
Support webpack 2.2.0 stable release0.3.7
Support webpack 2.2.0-rc.4 (by @swernerx)0.3.6
Allow webpack 2 rc versions in package peer dependencies0.3.5
Support out of order harmony import specifiers0.3.4
Support webpack 2.2.0-rc.00.3.3
Support webpack 2.1.0-beta.280.3.1
Fix false positive invalidation against modules like Delegated and External
Builds and stores checksums of files built by webpack to better determine when to rebuild modules. This helps HardSource rebuild less in CI environments.
Code contributed by:
- @nikhilmat
0.2.7
Fix resolve cache invalidation, use resource instead of userRequest0.2.6
Don't log version mismatch message on first build without a cache0.2.5
Stamp cache with library version and fix serializingloc
strings0.2.4
Fix out of date harmony module tree shaking keys0.2.3
Fix context depending modules rebuild check0.2.2
Flatten dependency loc data for HarmonyImportSpecifier0.2.1
Support functions as option to environmentHash
HardSource grew through its 0.0.X
versions up to this point. It currently supports:
- Webpack 1 AMD and CommonJS modules
- Webpack 2 Harmony modules with tree shaking
- Module warnings and errors
- Child Compiler use with plugins like ExtractTextWebpackPlugin and HtmlWebpackPlugin
- Webpack builtin plugins like DllPlugin and UglifyJSPlugin
- Module cache busting when dependencies move
- Multiple caches through the configHash option
- Full cache invalidation through dependency hash comparison
0.1.4
Consider AMDDefineDependencies as a HardNullDependency like ConstDependency0.1.3
Fix normal module resolver plugin that didn't pass on resolve errors0.1.2
Ignore ExtractText root modules so that child compilers always run and output assets
0.0.44
Prefix module cache identifier by child compiler subcache name0.0.43
Flatten dependencyloc
field (HMR fix for 0.0.41)0.0.42
Support out of order harmony module export specifier dependencies0.0.41
Freeze and thaw module warnings and errors (by @Strate)0.0.40
Support latest webpack 2 beta (2.1.0-beta.25)0.0.38
AddconfigHash
option0.0.37
Add a little logic to avoid re-serializing already serialized modules0.0.36
Freeze and thaw some common fields that weren't before0.0.35
Use additional pass in compilation instead of pre-emptive pass. Fixes use with HMR0.0.34
Correctly thaw harmony specifier dependencies0.0.33
Add HardModule.libIdent to support DllPlugin0.0.32
Fix webpack 2 dependency warnings0.0.30
Fix asset thawing and unnecessary dependency invalidation0.0.28
Help ensure cacheDirectory is used as users expect0.0.27
Use pre-emptive compile when supporting isUsed (webpack 2)0.0.26
Invalidate modules based on webpack 2 tree shaking0.0.23
Fix to error in resolve invalidation0.0.19
Store separate non-devtool related base map for Uglify support0.0.18
Invalidate modules depending on a now invalid resolve value0.0.17
Support webpack-isomorphic-tools0.0.16
Incomplete resolve invalidation0.0.15
Invalidate whole cache when environment (node_modules, etc) change0.0.13
Freeze and thaw module's_source
used by Stats0.0.11
Store modules in a leveldb store0.0.10
Store assets separate for performance0.0.9
Support ExtractText and Uglify0.0.8
relativecacheDirectory
support0.0.7
Support Harmony modules by disabling tree shaking0.0.5
First ReadME, travis badge, cacheDirectory change0.0.4
Add source map tests, improve source map thawing0.0.3
Add tests