ElkArte Community

Title: script/css minimizer bug
Post by: scripple on April 10, 2014, 10:31:34 pm
It's commented out, but if the gzip option is uncommented there's a bug in it.  It's missing the '/' separator between the output directory and the file name.

Code: [Select]
$fp = gzopen($this->_archive_dir . $this->_archive_name . '.gz', 'w9');

Should be
Code: [Select]
$fp = gzopen($this->_archive_dir . '/' . $this->_archive_name . '.gz', 'w9');

And why are jquery and and sha256.js not included into the combined scripts but loaded separately?
Title: Re: script/css minimizer bug
Post by: emanuele on April 11, 2014, 02:38:14 am
Great catch! :D

sha256 I think it's just slipped through.
jquery... I think it's on one side because of all the alternative ways of loading it and on the other because we should be sure it's loaded before anything else, but... yeah, it should be added there as well.
Title: Re: script/css minimizer bug
Post by: emanuele on April 11, 2014, 03:40:35 pm
I was looking at jquery, and make it work with the minifier is tricky, very tricky. At least if we want to support all the alternatives. In particular the "auto" mode: when jquery source is set to auto, a small bit of js is added, but this must be just after the jquery url and before any other script (and this is true for both jquery and jquery UI), but with the current tools this is impossible... :(
Title: Re: script/css minimizer bug
Post by: Spuds on April 11, 2014, 04:42:52 pm
I think it would be a mistake to try and add jquery (plus UI in some cases) to the hive ... Just my opinion.
Title: Re: script/css minimizer bug
Post by: emanuele on April 11, 2014, 07:01:57 pm
Yeah, it is already minified, it is a pain to deal with, better keep it as an exception... ::)
Title: Re: script/css minimizer bug
Post by: Spuds on April 11, 2014, 09:41:51 pm
They are also (mostly) served from the CDN so keeping it separate will be faster.