MyBB Community Forums

Full Version: Does minifying mybb JS files cause problems ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

From a SEO report(Google) I've been taught that long JS files needed to be minified or compressed in order to gain perfomance.

I did minified both prototype.js and general.js using Closure Compiler by Google. Hopefully I don't experience any problems but does this cause any kind of errors in future ??

I mean can mybb recognize these minified files because they are minified and mybb can't recognize or edit it ???

I really need an answer guys,

Thank You
Yea... don't use CC for that... I've tried minifying and even as far as grouping relevant MyBB js files.. Some can minify but most can not with CC... might have something to do with the renaming of functions and operators.

Try using this to minify instead:
http://jscompress.com/

That minifier has never produced me a non-working script.. ever.

Edit:
but I haven't used it to try and minify MyBB's js files.. after my earlier efforts I decided it was not worth the trouble. But let us know if it works for you. IMO the dev team should have minified release code from the start and left beautified commented code on github.. but that's just my opinion.
I've minified both prototype.js and general.js with google closure compiler and it's working fine for now, but my worry is does they cause any errors in future like when I install plugin that have to work with these minified scripts etc.

#Are they worth doing this ?
If it works... why not.. it saves time, resources, and is an economically sound choice. So yes if it works it's most definitely worth minifying code.
i tried lot of js minifier for compressing prototype.js but quick post won't working (i entered the reply, and click post reply but always loading)

so any one succedded in minifying prototype.js ..??

159 Kb is really a big file Sad
Rather than attempting to minify prototype (it does not really like being minified) then why not load it from a CDN? I use Google CDN for my Prototype.js though others may suggest cloudflare CDN.

Regarding Closure Compiler - I routinely combine popup and general js files whenever I work on a new MyBB forum.
Thanks leefish,
finally i minified prototype hope it work fine, Still don't know whether "mark as read" working or not, i just messed with some settings, so can you test this....???

http://earnmoneybb.com/prototype.js
(rigt click and save as) - minified using http://refresh-sf.com/yui/

size: 120 KB (saved ~39 kb)
* Quick post working, other minified version just show "loading image" after quick post.


any other place/things to test whether it is fully working or not..??