feat: migrate to HTML Minifier Next - #170
Open
stevenjoezhang wants to merge 2 commits into
Open
stevenjoezhang wants to merge 2 commits into
stevenjoezhang wants to merge 2 commits into
Conversation
stevenjoezhang
marked this pull request as ready for review
August 17, 2026 17:09
This was
linked to
issues
Aug 17, 2026
SukkaW
requested changes
Aug 20, 2026
SukkaW
left a comment
Member
There was a problem hiding this comment.
Let's not hang dead on one tree. I'd rather having a breaking change and go htmlnano route.
tomap
approved these changes
Aug 20, 2026
Member
Author
|
I ran a fresh benchmark against the Methodology
Results
PR #170 produced byte-for-byte identical output to the original implementation on this dataset while being 1.69x faster. PR #156 produced output around 5.3 MiB smaller than PR #170, but it was about 24% slower than the original and 2.09x slower than PR #170. The other alternatives are less direct comparisons:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
html-minifierdependency withhtml-minifier-nextremoveDefaultTypeAttributesexcludeas a plugin-only option without forwarding it to the minifierWhy
html-minifieris unmaintained and its ReDoS vulnerability has no patched release. HTML Minifier Next is its actively maintained successor and preserves the configuration and output semantics needed by this plugin much more closely than the alternatives evaluated in #156.This supersedes #156 and addresses #84 and #148.
Breaking changes
removeScriptTypeAttributesandremoveStyleLinkTypeAttributesare now represented by the combinedremoveDefaultTypeAttributesoption. Equal legacy values are migrated automatically. When they differ, the plugin preserves both attributes and emits a warning instead of applying a more aggressive transform.Compatibility and performance
Using the plugin defaults against a local generated Hexo corpus of 1,368 HTML files (99,016,729 input bytes):
html-minifier@4.0.0<!-- more -->remained intactValidation
npm test -- --no-parallelnode@22.13.1npm audit --omit=dev— 0 production vulnerabilitiesnpm pack --dry-run --json