-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSMin minifier is non-free (suggest JSqueeze or JShrink as alternatives) #13052
Comments
We don't use JSMin - but https://github.com/mrclay/minify - see https://github.com/owncloud/3rdparty/tree/master/mrclay/minify |
JSMin was used long time back until OC5 or 6 |
Yes, yes you do. Follow the breadcrumbs: https://github.com/owncloud/core/blob/master/lib/private/templatelayout.php#L8 has https://github.com/kriswallsmith/assetic/blob/master/src/Assetic/Filter/JSMinFilter.php does What do you get for https://github.com/owncloud/3rdparty/blob/master/composer/autoload_classmap.php#L73 So what's
Yes, you really are using JSMin...:) mrclay has continued to update the copy in his tree since Ryan Grove abandoned the original repo, but it is very definitely the same code with minor fixes. |
I see - THX - and there is the license issue: |
Okay - we better go for jsqueeze then - https://packagist.org/packages/patchwork/jsqueeze @karlitschek We shall fix this for OC8 - will take care about this asap. Agreed? THX |
if time's tight and we can't get jsqueeze or jshrink in shape in time, JSMinPlus from mrclay/minify should be license-safe (despite the name it's an independent implementation) and the patch would be, like, 8 characters, but personally I'd really like to avoid pulling in mrclay at all if possible, it's a messy thing :/ and JSMinPlus seems to be unmaintained these days. |
fuck. Yes. One more challenge! Definitely important to fix. |
Tested and confirmed fix with JSqueeze 2.0.1, but 2.0.1 also namespaces the lib (at my request, sorry :>) so Assetic's filter doesn't work OOTB any more. I've sent a PR to Assetic for that: kriswallsmith/assetic#698 |
IBM has a changed version of this:
http://dev.hasenj.org/post/3272592502/ibm-and-its-minions ;) |
@AdamWill Thanks for spotting this! |
@MorrisJobke that's still not really sufficient as the exception doesn't apply to all (unless you consider everyone a 'minion' of IBM...), so you still effectively can't distribute the software on free terms to all. Everyone who's not a 'customer, partner or minion' of IBM still can't use it for evil. In any case I don't think you could hold that it applies to the copy of In any case, JSqueeze or JShrink or Matthias' 'minify' would be superior choices for several other reasons - they're currently maintained, follow good current coding practices, are faster and/or more efficient than JSMin, and don't come attached to the rest of the crazy stuff in |
@AdamWill Sure |
assetic's now merged my filter change onto master, but not onto the 1.2 branch, yet - I've asked if they can merge it to 1.2. |
@karlitschek @DeepDiver1975 @AdamWill As we are in feature freeze what if the upstream project can't provide the update fast enough? Is there an alternative plan? |
@DeepDiver1975 What is your opinion? |
@MorrisJobke I can see three options:
|
Okay - let's go for JSMinPlus for OC8 because it requires NO updates of 3rdparty libs - which reduces risk and test effort. For OC8.1 we can reevaluate (and maybe even allow some config option for installations who want to run e.g. YUI tools ???) @AdamWill delivery of non-free code is not that of an issue of owncloud itself - but we want to collaborate with linux distributions as good as possible and respect the guidelines to not ship non-free code. For OC8 these code pieces have to be stripped. I hope this works out for you. I'll take care about updating to JSMinPlus ..... |
shouldn't be a huge deal for downstreams - my approach will probably be either to package jsminplus on its own, bundle it with OC since it'll only be used temporarily, or just carry a patch to use jsqueeze instead. |
grrr - JSMinPlus generates broken JS - https://github.com/owncloud/core/tree/use-jsminplus
|
bah :( I guess I didn't test it, I must've only tested JSqueeze and JShrink. |
The JSMin minifier is non-free. JShrink is free, it's also a currently-maintained project following good development practices (though we may wish to switch to JSqueeze soon for performance reasons; waiting on kriswallsmith/assetic#698 reaching upstream Assetic 1.2 for that). This goes along with a 3rdparty commit that drops mrclay/minify and adds JShrink.
So to get something helpful done, I drafted up the necessary changes to use JShrink: #13185 if it would help I can, as an alternative, draft up the changes to use JSqueeze (which would be along the same lines, but probably with an added Assetic filter called 'JSqueeze2Filter' or so in |
The JSMin minifier is non-free. JSqueeze is free, it's also a currently-maintained project following good development practices, and the best-performing minifier we tested. This requires a corresponding 3rdparty commit to drop mrclay/minify and add JSqueeze, and also uses a backport of the latest upstream version of the Assetic JSqueeze filter as the current version in 1.2 does not work with JSqueeze 2.x. The backported filter file can be dropped when our bundled copy of Assetic is updated to a version containing the newer JSqueezeFilter.
The JSMin minifier is non-free. JSqueeze is free, it's also a currently-maintained project following good development practices, and the best-performing minifier we tested. This requires a corresponding 3rdparty commit to drop mrclay/minify and add JSqueeze, and also uses a backport of the latest upstream version of the Assetic JSqueeze filter as the current version in 1.2 does not work with JSqueeze 2.x. The backported filter file can be dropped when our bundled copy of Assetic is updated to a version containing the newer JSqueezeFilter.
@DeepDiver1975 What do you suggest? |
@karlitschek there's been more activity on the PR I submitted to switch to JSqueeze: #13229 . At first we found several cases where the minified JS misbehaved, but most of them seem to be fixed now, and it's close to being mergeable, I think. |
The JSMin minifier is non-free. JSqueeze is free, it's also a currently-maintained project following good development practices, and the best-performing minifier we tested. This requires a corresponding 3rdparty commit to drop mrclay/minify and add JSqueeze, and also uses a backport of the latest upstream version of the Assetic JSqueeze filter as the current version in 1.2 does not work with JSqueeze 2.x. The backported filter file can be dropped when our bundled copy of Assetic is updated to a version containing the newer JSqueezeFilter.
Any update on this ? Or defer to 8.2 ? |
sorry, I'm on vacation till Jun 8, I'll get back to it then. |
@AdamWill any update? We need to make a quick determination to keep this in 8.2. Thanks! |
This has been done, so far as I'm concerned, for months. It just never gets merged when I update it so every two fucking months I have to jump through the 're-generate the 3rdparty PR' hoop again. I'm sick of it. #13229 the last time I jumped through the hoops was July 18, where @PVince81 asked some people to review it, and no-one really did (except for one comment on the 3rdparty PR which I explained is just what composer does when you use it as documented; if someone knows an alternative way to do it, i'm all ears). |
The JSMin minifier is non-free. JSqueeze is free, it's also a currently-maintained project following good development practices, and the best-performing minifier we tested. This requires a corresponding 3rdparty commit to drop mrclay/minify and add JSqueeze, and also uses a backport of the latest upstream version of the Assetic JSqueeze filter as the current version in 1.2 does not work with JSqueeze 2.x. The backported filter file can be dropped when our bundled copy of Assetic is updated to a version containing the newer JSqueezeFilter.
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.
The text was updated successfully, but these errors were encountered: