All Versions
35
Latest Version
Avg Release Cycle
14 days
Latest Release
1243 days ago
Changelog History
Page 2
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 ofio.Reader
- ๐ฆ Rename subpackage
min
tominify
JS minifier overview
๐ Features:
- โ remove superfluous whitespace
- โ remove superfluous semicolons
- shorten
true
,false
, andundefined
to!0
,!1
andvoid 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
andthrow
- โ 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, 2020WARNING 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 theREADME.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
, usemake install
instead - Rename
cmd/minify/minify_bash_tab_completion
tocmd/minify/bash_completion
- ๐ Rename
LICENSE.md
toLICENSE
as it is not a Markdown file - ๐ฆ Rename
min
subpackage tominify
- ๐จ cmd: running
minify
without arguments will print a more informative error message - cmd: bad arguments will not display cmd usage automatically
- ๐ Use Makefile instead of GoReleaser to build releases for all architectures, use
-
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 manyname
orid
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
andoptgroup
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
- ๐ HTML: remove text and whitespace within
-
v2.7.5
June 08, 2020 -
v2.7.4 Changes
April 24, 2020 -
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
- external minifiers can now use input/output files instead of only stdin/stdout using the
-
v2.7.2 Changes
January 14, 2020- ๐ SVG: bugfix for
C
,S
,Q
, andT
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.
- ๐ SVG: bugfix for
-
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
andNumber
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 toPrecision
- ๐ Move
Hash
definitions andEntitiesMap
fromtdewolff/parse
to this repository to prevent releasing new versions oftdewolff/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 booleanlargeArc
andsweep
- SVG: avoid precision errors for alternative (absolute or relative commands) path