- [Rust] Deny unsafe code in minify-html crate.
- BREAKING: Cfg options have changed such that spec compliance is the default, to avoid confusion with users:
do_not_minify_doctype
=>minify_doctype
ensure_spec_compliant_unquoted_attribute_values
=>allow_noncompliant_unquoted_attribute_values
keep_spaces_between_attributes
=>allow_removing_spaces_between_attributes
Cfg::spec_compliant()
=>Cfg::enable_possibly_noncompliant(&mut self)
- BREAKING: Some entity minifications are now classified as "possibly noncompliant" and can be enabled via the
allow_optimal_entities
option but won't be performed by default. - [Internal] Migrate to aHash for faster more consistent performance and once_cell for modern ergonomics.
- [Node.js] Fix ARM64 package metadata.
- [Python] Add Python 3.13 support.
- Add
keep_input_type_text_attr
option to keeptype=text
on<input>
elements. - [Java] The
Configuration
class constructor has been made private to enforce the use of the builder. The constructor has a lot of params which can easily cause bugs due to ordering and confusion.
- Add new options to parse and preserve common templating syntax in content source code. NOTE: The parsing is "dumb" and merely looks for the next subsequence in the source code that matches the closing delimiter characters. This means that literal closing delimiter characters (e.g. strings) and nesting may cause parsing to be incorrect.
preserve_brace_template_syntax
: When{{
,{#
, or{%
are seen in content, all source code until the subsequent matching closing}}
,#}
, or%}
respectively gets piped through untouched.- Templating engines: Pebble, Mustache, Django, Go, Jinja, Twix, Nunjucks, Handlebars, Liquid.
preserve_chevron_percent_template_syntax
: When<%
is seen in content, all source code until the subsequent matching closing%>
gets piped through untouched.- Templating engines: Sailfish, JSP, EJS, ERB.
- Avoid downloading html-data JSON from network on build.
- [Java] Set up cross compilation for macOS and Linux ARM64 builds.
- [CLI] Add missing Cargo metadata.
- Use lightningcss instead of css-minify, which is better maintained.
- BREAKING: The
minify_css_level_*
Cfg options no longer apply and have been removed.
- BREAKING: The
- [onepass] Implement
Display
andError
forError
andFriendlyError
structs.
- Change CLI name to
minhtml
as it's a more concise command name and allows forcargo install minhtml
. - Add
keep_ssi_comments
to preserve SSI comments. - [Ruby] BREAKING: The class method is now a global function, so call
minify_html
instead ofMinifyHtml.minify
. All else remains the same. This is due to migrating from Rutie (see 0.11.3).- This change was inadvertently released in patch version bumps from
0.11.3
to0.11.5
; these gems have been yanked.
- This change was inadvertently released in patch version bumps from
- Omit Rust source files from Node.js package.
- Bump minify-js version.
- Fix Node.js native package names.
- Fix detection of module type scripts.
- Derive
Clone
forCfg
in minify-html. - Fix parsing of malformed closing tags.
- Cross compile Python library for macOS ARM64.
- Migrate to rb-sys and magnus for Ruby library, which adds support for up to Ruby 3.2 and more platforms.
- Cross compile Node.js library for macOS ARM64.
- Use optional dependencies instead of downloading from remote server for Node.js library.
- Build and release for Python 3.12.
- Restructure project to use top-level Cargo workspace instead of separate isolated crates.
- Extract out common Rust code to separate published shared crate instead of symlinking.
- Port
gen
code tobuild.rs
in common Rust library to avoid requiring Node.js in order to build, and to ensure code stays in sync. - Rename library folders to
minify-html-*
to better distinguish them from other assorted project code.
- Bump GitHub Actions Ubuntu image version.
- Change the default CSS minifier optimisation level to 1, as higher levels may perform dangerous optimisations.
- Allow configuring the CSS minifier optimisation level.
- Fix building from source in Node.js postinstall.js script.
- [Node.js] Fix assertion failure panic on invalid argument type.
- Do not consider empty
href
attributes as redundant.
- Bump minify-js to 0.4.2.
- Improve handling of RCDATA text content in edge cases.
- Do not encode entities in RCDATA text content (e.g. contents of
<textarea>
and<title>
).
- Use FxHasher for internal hash-based data structures.
- Bump css-minify to 0.3.1.
- [WASM] Add
type
andmain
fields to package.json. - [Node.js] Improve invalid argument type error messages.
- [Python] Add Python 3.11 support.
- [Python] Build source distribution wheels that will compile on install when prebuilt variants are not available. The Rust compiler must be available.
- Bump minify-js to 0.2.6.
- Bump minify-js to 0.2.
- Minify JS as module instead of global script if
type
ismodule
.
- Drop unmatched closing tags instead of reinterpreting them as opening tags. This avoids the possibility of unintentionally creating a large deep tree due to malformed inputs where there are repeated unmatched closing tags (e.g. broken HTML template).
- Fix parallel minification in CLI mode, where some inputs were ignored.
- Output file names as they're processed in parallel mode from the CLI.
- Allow self-closing
<svg>
tags. - Drop support for macOS ARM64 due to lack of GitHub Actions runners.
- Fix Node.js dependency version.
- Create onepass variant for Python.
- Bump minify-js to 0.1.1.
- Implement parallel in-place minification for CLI.
- Fix Node.js postinstall script.
- Replace esbuild with minify-js as the JS minifier, a fast minifier written from scratch in Rust. This alleviates many of the problems with integrating with esbuild, including interference with process signals by the Go runtime, compatibility issues with C libraries other than glibc, use of threading libraries without actually threading, inability to compile to rarer Rust targets, dependency on the Go compiler, maintaining a fork of esbuild, unsafe FFI, and more. CSS minification is now done by css-minify.
- As minify-js is a relatively new library, any feedback, suggestions, and issues around JS minification is most welcome! Please report them to the repo.
- Use Neon for the Node.js library instead of custom hand-written N-API bindings in C. This simplifies the code and makes it safer and easier to extend. It also allows building from source if a prebuilt binary is not available (the Rust compiler must be installed).
- The package has been renamed to
@minify-js/node
. - There is a slight API change: instead of calling
createConfiguration
, directly pass the JavaScript object to theminify
function. Theminify
function also no longer takes a string.
- The package has been renamed to
- Thanks to the change to the fully-Rust minify-js, we can now add support for Deno and WebAssembly.
- Due to the dropping of esbuild, there is no more
core
variant for Node.js and Python, as the issues should no longer exist.
- Create wrapper index.js for Node.js library to support ESM.
- Do not consider empty
value
attributes onoption
elements as redundant. - Consider
crossorigin
attributes as boolean.
- Minify whitespace in SVG elements.
- Fix Node.js library build process on Windows.
- Do not remove
alt
attribute when empty.
- Fix Node.js library not including
cli.js
. - [CLI] Add support for macOS ARM64.
- [Node.js] Add support for macOS ARM64.
- [Python] Add support for Linux ARM64 and macOS ARM64. Drop support for Python 3.7 (breaking change).
- Fix the Node.js library TypeScript definitions.
minifyJs
has been fixed tominify_js
andminifyCss
has been fixed tominify_css
. This is not a breaking change the library itself only ever accepted the fixed names, so this is actually a typo fix. - Implement a basic CLI script for Node.js to allow using the library from the command line e.g. quick testing or sandboxing without needing to download and install the CLI separately. It accepts all configuration properties (all of which are currently booleans) using hyphen case e.g.
--do-not-minify-doctype
, as well as--output [path]
and one default (i.e. not after an option switch) argument for the path to the input. It's only a few lines long and should not have a tangible effect on library size.
- Intrepret
type=module
on<script>
tags as a JavaScript MIME eligible for its contents to be minified as JavaScript (previously it would not be and so its contents would be considered data and never minified as JavaScript). - Fix issue where spaces are not added between unquoted attributes even when
cfg.keep_spaces_between_attributes
istrue
.