Skip to content

JSMin minifier is non-free (suggest JSqueeze or JShrink as alternatives) #13052

@AdamWill

Description

@AdamWill

As explained at #11430 (comment) , the JSMin minifier which is used by that PR is non-free according to FSF, Debian, and Fedora. Also, its original upstream developer abandoned it years ago and explicitly recommends other alternatives. mrclay is maintaining the copy in his repo, but probably not as actively as the newer alternatives.

I ran some benchmarks which indicated JSqueeze might be the best replacement, at least from a numbers perspective. It's also actively maintained by a well-known developer. Its lack of namespacing is a bit of a pain for distros but in the worst case (if they don't take my suggestion to namespace) can be dealt with.

More importantly, though, I managed to get a hacky build of master up and running and tested it with JSqueeze, and it, er, doesn't work (for me, anyway, confirmation would be welcome). Upstream seems fairly responsive to bug reports, so I'm hoping they'll get to that one soon.

The other alternative that looked decent to me was JShrink. It's currently-maintained, namespaced, travis-ified, psr-0 compliant, lots of buzzword boxes. It doesn't perform as well as JSqueeze in terms of speed or file size, but it does work with OC for basic use (I just tested), which is a significant advantage.

I'll note an ancillary benefit, here: pulling in mrclay/minify just to get a JavaScript minifier is kind of atomic-weapon-nutcracker stuff. As my blog post (linked earlier) points out, it's a sort of poor man's Assetic with eight different CSS/JS minification implementations and a whole bunch of other nutty stuff in it. Switching to JShrink or JSqueeze would allow us to just have a JavaScript minifier, not a JavaScript minifier tied to three other JavaScript minifiers and lord knows what else. As it stands, OC 8 will be shipping (by my count) four CSS minifiers (the three in mrclay/minify, plus the one it actually uses), two full PHP JavaScript minifiers, and two different Closure Compiler wrappers/interfaces (and that's not even counting any others lying around in the source tree...)

I can send PRs for switching to either JSqueeze or JShrink pretty easily - the changes to OC itself are trivial, then it's just a 3rdparty commit that drops mrclay/minify and pulls in the one we want - but it seemed prudent to wait for a response from JSqueeze to my bug report.

Edit: oh, for the record, a drawback of JShrink is that Assetic doesn't currently ship a filter for it. There's a github project which adds one - for my test I just dropped that straight into the Assetic tree and it worked fine, so it could be sent upstream pretty easily if they'd take it. But they do have a JSqueeze filter already, so it's one less step there.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions