All Versions
35
Latest Version
Avg Release Cycle
14 days
Latest Release
462 days ago

Changelog History
Page 2

  • v2.9.0 Changes

    August 26, 2020
    • โž• Add JS (ECMAScript 2020) minifier
    • ๐Ÿ‘Œ Improve benchmark functions
    • ๐ŸŽ Predefine byte-slices instead of inline for performance
    • Don't check write errors to output during minification, but check at the end only
    • ๐Ÿ“œ Lexers/parser now require passing parse.Input instead of io.Reader
    • ๐Ÿ“ฆ Rename subpackage min to minify

    JS minifier overview

    ๐Ÿ”‹ Features:

    • โœ‚ remove superfluous whitespace
    • โœ‚ remove superfluous semicolons
    • shorten true, false, and undefined to !0, !1 and void 0
    • ๐Ÿ“‡ rename variables and functions to shorter names (not in global scope)
    • ๐Ÿšš move var declarations to the top of the global/function scope (if more than one)
    • collapse if/else statements to expressions
    • minify conditional expressions to simpler ones
    • ๐Ÿ”€ merge sequential expression statements to one, including into return and throw
    • โœ‚ remove superfluous grouping in expressions
    • ๐Ÿšš shorten or remove string escapes
    • convert object key or index expression from string to identifier or decimal
    • ๐Ÿ”€ merge concatenated strings
    • rewrite numbers (binary, octal, decimal, hexadecimal) to shorter representations

    It compresses files at about 25 MB/s (only minifying, not considering reading/writing files) which is (much) faster than existing minifiers. Compression rate is between 1.5 and 3.0 depending on the file (respectively, the compression file size is between 35% -- 65% of the original). Example of known files:

    File Original Size Compressed Size Ratio Time Speed
    ace.js 644 kB 346 kB 53.7% 34ms 19 MB/s
    dot.js 5.2 kB 3.3 kB 64.9% 563ยตs 9.2 MB/s
    jquery.js 247 kB 85 kB 34.4% 11ms 22 MB/s
    jqueryui.js 470 kB 241 kB 51.3% 26ms 18 MB/s
    moment.js 99 kB 35 kB 34.9% 4ms 24 MB/s

    โœ… The minifier has been tested for a number of web applications including WordPress. The go-fuzz fuzzer has been used extensively in order to detect bugs, and will continue finding bugs using https://github.com/google/oss-fuzz

  • v2.8.0 Changes

    July 28, 2020

    WARNING for package maintainers, some files have been renamed , adjust your build scripts accordingly.

    • ๐Ÿš€ Use Makefile instead of GoReleaser to build releases for all architectures, use make release. This fixes the README.md file location inside the archives to be in the root of the archive
    • ๐Ÿš€ Release archives will no longer have the version name explicitly stated, fixes #316
    • โœ‚ Remove cmd/minify/install.sh, use make install instead
    • Rename cmd/minify/minify_bash_tab_completion to cmd/minify/bash_completion
    • ๐Ÿ“‡ Rename LICENSE.md to LICENSE as it is not a Markdown file
    • ๐Ÿ“ฆ Rename min subpackage to minify
    • ๐Ÿ–จ cmd: running minify without arguments will print a more informative error message
    • cmd: bad arguments will not display cmd usage automatically
  • v2.7.7 Changes

    July 24, 2020
    • ๐Ÿ cmd: fix file paths on Windows when input and output directories are equal (slash vs backslash)
    • cmd: add --cpuprofile and --memprofile options
    • ๐Ÿ”€ cmd: fix usage of --match and --sync simultaneously, fixes #315
    • cmd: --match applies to all filename inputs not just under directories
    • ๐Ÿšš CSS: remove whitespace around custom variable value, fixes #305
    • ๐Ÿ›  JSON: minify numbers, fixes #302
    • ๐Ÿ“œ HTML: fix slow parsing of <a> tag with many name or id attributes (OSS-Fuzz)
    • ๐Ÿ›  Don't replace space by + in DataURI, fixes #314
    • Don't escape @ : ; = ? + , / $ \t \n \r in DataURIs (works for Chrome, Firefox, Opera, Edge, Safari, Yandex, and IE9, IE10, IE11)
  • v2.7.6 Changes

    June 08, 2020
    • ๐Ÿšš HTML: remove text and whitespace within select and optgroup tags
    • ๐Ÿ“œ CSS: fix slow parsing of selectors when they contain many errors
    • CSS: fix RGB/HSL when a parameter overflows
    • ๐Ÿ“œ CSS: fix slow parsing of large HSL parameters
    • cmd: properly run defer calls after command ends, may fix some race bugs
    • โž• Add easy API in the min/ subpackage
    • โž• Add project to OSS-Fuzz
  • v2.7.5

    June 08, 2020
  • v2.7.4 Changes

    April 24, 2020
    • 0๏ธโƒฃ CSS: fix minification of flex, default of flex-basis is zero for three value case, fixes #292
    • ๐Ÿšš CSS: remove whitespace within @import url(...), fixes #296
    • ๐Ÿšš HTML: remove spaces around/in picture and audio following whitespace removal rules for phrasing elements
  • v2.7.3 Changes

    March 12, 2020
    • external minifiers can now use input/output files instead of only stdin/stdout using the $in and $out keywords
    • ๐Ÿ›  SVG: don't minify inside foreignObject, fixes #291
  • v2.7.2 Changes

    January 14, 2020
    • ๐Ÿ›  SVG: bugfix for C, S, Q, and T commands where if the control points would not overlap with the start or end points of the curve, it would still be converted to a line.
  • v2.7.1 Changes

    January 13, 2020
    • ๐Ÿ›  DataURI: if the original data URI is shorter than the URL-encoded/base64-encoded URI, use the original instead, fixes #282
    • ๐Ÿ›  Bugfix: decimal (i.e. without exponentials) incorrectly minified 139.9 to 230 instead of 140
  • v2.7.0 Changes

    January 06, 2020
    • ๐Ÿ‘‰ Use custom URL encode/decode functions to fix #180 and #243
    • ๐Ÿ›  Decimal and Number now take precision to mean the number of significant digits, and not the number of digits behind the dot (decimals); includes a few subtle bugfixes. Decimals option renamed to Precision
    • ๐Ÿšš Move Hash definitions and EntitiesMap from tdewolff/parse to this repository to prevent releasing new versions of tdewolff/parse everytime
    • ๐Ÿ”€ cmd: add --sync functionality
    • cmd: make --watch work for newly created directories
    • ๐Ÿ›  cmd: various fixes and improved messages
    • ๐Ÿ›  CSS: keep quotes around IE font families, fixes #251
    • โ™ป๏ธ CSS: major refactor to allow nested functions to be minified
    • CSS: improved HSL/RGB minification
    • CSS: minify more properties: color, background-color, border-color, border-*-color, caret-color, outline-color, fill, stroke, column-rule, text-shadow, text-decoration, text-emphasis, flex, flex-*, order, fixes #217
    • ๐Ÿ‘ CSS: minify background better if it has multiple layers
    • CSS: improve box-shadow minification
    • CSS: accept CSS functions where numbers/lengths are required, such as calc, min, max, clamp, attr, var
    • ๐Ÿ–จ SVG: print new path command after bad command, fixes #275
    • ๐Ÿ–จ SVG: print A command correctly with boolean largeArc and sweep
    • SVG: avoid precision errors for alternative (absolute or relative commands) path