minify icon indicating copy to clipboard operation
minify copied to clipboard

Planned improvements

Open tdewolff opened this issue 7 years ago • 0 comments

Also see https://github.com/tdewolff/parse/issues/44

  • [x] Rename MinifyMimetype to MinifyBytes or similar, and accept []byte instead of io.Reader, make all other functions that explicitly convert to buffer.NewReader(b) to use this new function. Keep the original MinifyMimetype but mark as deprecated. unlikely due to insignificant performance gain
  • [x] SVG paths: use S, Q, T, L or remove if (some) control points coincide for curved paths.
  • [x] CSS: shorten dimensions, for example 200grad -> 180deg. But also 0ms -> 0s and 500ms -> .5s or .005s -> 5ms.
  • [x] CSS: take care of comma separations in background
  • [ ] CSS: filter declaration blocks for duplicate property definitions, i.e. remove earlier background-position if either background or background-position is set afterwards
  • [ ] CSS: remove % from 0% where possible
  • [ ] CSS: minify aggregate declarations better, such as grid, transition, ...
  • [ ] CSS: find where the initial value is shorter than initial
  • [ ] CSS: remove dimension for zero values if possible
  • [ ] CSS: check if remove duplicate property definitions can be removed (see multiple background with -moz-linear-gradient, -ie-linear-gradient).
  • [ ] CSS: add implementation for more functions and value types, for example calc, min, max, clamp, transform + related functions in with (https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function), linear-gradient (ie. the <gradient> type) (https://developer.mozilla.org/en-US/docs/Web/CSS/gradient), and more.
  • [ ] CSS: find more optimizations from https://cssnano.co/optimisations/ and https://github.com/css/csso/tree/master/test/fixture/compress
  • [x] cmd: refactor and separate reusable code
  • [x] cmd: allow options input from command line, config file and environment variables
  • [ ] Find faster hash function
  • [x] Set proper cap on parsers and helper functions, does this prevent the need for copy?
  • [x] JS: use template strings where we can convert \n to a newline, as well as \r as a carriage return
  • [x] JS: order var declarations without definition to improve GZIP

tdewolff avatar Nov 09 '18 00:11 tdewolff