[Phpmyadmin-devel] not uglifying js for production

Dieter Adriaenssens dieter.adriaenssens at gmail.com
Thu Jun 20 11:01:30 CEST 2013


2013/6/19 Rouslan Placella <rouslan at placella.com>:
> On 06/19/2013 08:49 AM, Dieter Adriaenssens wrote:
>> 2013/6/19 Mohamed Ashraf <mohamed.ashraf.213 at gmail.com>:
>>> On Tue, Jun 18, 2013 at 3:44 PM, Michal Čihař <michal at cihar.com> wrote:
>>>> Hi
>>>>
>>>> Dne Tue, 18 Jun 2013 12:01:22 +0200
>>>> Mohamed Ashraf <mohamed.ashraf.213 at gmail.com> napsal(a):
>>>>
>>>>> A web server that is configured to support gzip would help alot more
>>>>> than minification anyway and provides a much smaller size whether the
>>>>> files are minified or not. Most web servers and web browsers already
>>>>> support gzip compression so it is not a problem. also the javascript
>>>>> files are already aggressively cached so it is not a big problem.
>>>>
>>>> Indeed gzip can save transfer size, minified code has also benefits for
>>>> parsing and execution time due to shorter identifiers. Or at least
>>>> Google claims so:
>>>>
>>>> https://developers.google.com/speed/docs/best-practices/payload#MinifyJS
>>>
>>> I just did a small test to see how much does minifying and/or gzipping
>>> affects file size. I chose to use the list of scripts requested in the
>>> main page as a reference for a large number of scripts downloaded at
>>> the same time to maximize the differences.
>>> original js 1.4M
>>> minified js 629K
>>> gzipped original 331K
>>> gzipped minified 181K
>>>
>>> when using gzip the difference of 150K is negligible since this is
>>> only downloaded once in every session and every other request only
>>> gets one or two extra js files since your ajax script takes care of
>>> that caching. an extra 150K for the first page download is not too
>>> much to ask since it is more than likely to be cached by the browser
>>> itself. for normal page accesses only one or two extra scripts are
>>> requested. here is the same breakdown for a single js file. I chose
>>> server_database.js arbitrarily
>>> original js 4.3K
>>> minified js 1.8K
>>> gzipped original 1.4K
>>> gzipped minified 811B
>>>
>>> the difference between the gzipped original and minified is just 600B.
>>> that is not much.
>>
>> This seems reasonable to me.
>>
>> I'd suggest to drop the js minification to being able to get a stack
>> trace for the error reporting.
>> Thanks for investigating, Mohamed.
>
> Thought I'd mention that third party libraries (jquery, jquery plugins,
> etc) can stay minified IMO. All we really care to debug is our code.
> Besides, the public API of any external library will remain unmangled.

I agree, it doesn't make sense to show a stack trace of where it goes
wrong in those libraries. If there would be a bug there it can be
found by a developer who investigates an error report.

Mohamed, can you take a look at the release script and modify it so
that our JS files are no longer minified?

--
Kind regards,

Dieter Adriaenssens




More information about the Developers mailing list