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
Dependency Extraction Webpack Plugin: Use OpenSSL provider supported in Node 17+ #40503
Conversation
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
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.
There's another line with md4
which should probably be updated as well:
contentHash: createHash( 'md4' ) |
Did you test if sha512 is noticeable slower (or faster) than md4? Only asking because the webpack docs mentions xxhash64
as a faster algorithm.
Tested in Gutenberg where we create an asset file per every entry point.
It's hard to tell whether there is performance impact using the build in Gutenberg repository. |
80fe6bd
to
bb2f919
Compare
I think xxhash64 is the one that's only implemented in webpack and can be used like you tried it in #36471 (comment)? #36471 (comment) doesn't seem to be case any more. |
True, the issue was that it didn't return the value that could be chained, so I couldn't apply Documentation is missing: https://webpack.js.org/api/compilation-object/#createhash. |
I landed this change to fix the issue. We can change the algorithm later. We have another fix coming in #34969 which will also use the same hashing algorithm. |
… output rather than Webpack internal state (#34969) * Use `contentHash` in dependency-extraction-webpack-plugin Webpack 5 recommends using the content hash over the old-style chunk hash for cache invalidation, as the chunk hash can change even if the output does not. dependency-extraction-webpack-plugin will now include the content hash for each content type in the asset file. The `version` field is still present, now as a combined hash for all the content types reported, to maintain backwards compatibility. Fixes #34660 * Don't expose individual assets' contentHashes, it's considered too scary. * Hash assets directly, chunk.contentHash doesn't get updated by minification * Switch hash to match #40503 * Changelog entry
What?
Fixes #36471.
Why?
How?
I picked
sha512
as it was listed in Node.js documentation at https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-options:I'm more than happy to change that if there is something that is better.
Testing Instructions
npx wp-script build
and ensure that it doesn't error.