Fórum

Disable Javascript Minifier? [resolved]

Dave Willis, modificado 14 Anos atrás.

Disable Javascript Minifier? [resolved]

Expert Postagens: 301 Data de Entrada: 13/07/09 Postagens Recentes
Is there a way to disable the minifier in web.xml? I found a thread where someone mentioned that but they didn't say how to do it and I can't find that information anywhere. The minifier suddenly started breaking all the Javascript on my site so I want to disable it. Thanks
-Dave
thumbnail
Bruno Farache, modificado 14 Anos atrás.

RE: Disable Javascript Minifier?

Liferay Master Postagens: 603 Data de Entrada: 14/05/07 Postagens Recentes
You disable it in portal.properties:

#
# Set this property to true to load the packed version of files listed in
# the properties "javascript.barebone.files" or
# "javascript.everything.files".
#
# Set this property to false for easier debugging for development. You can
# also disable fast loading by setting the URL parameter "js_fast_load" to
# "0".
#
javascript.fast.load=true

However, I wouldn't recommend disabling it since it can degrade your site performance significantly, you should try to figure out why it's breaking. In general, it breaks if you've written custom javascript that is syntactically incorrect. If you had written custom js, I would suggest removing them until you find which one is wrong.

If you want to disable the MinifierFilter only:

#
# The minifier filter is used to minify CSS and JavaScript.
#
com.liferay.portal.servlet.filters.minifier.MinifierFilter=true
Dave Willis, modificado 14 Anos atrás.

RE: Disable Javascript Minifier?

Expert Postagens: 301 Data de Entrada: 13/07/09 Postagens Recentes
Thanks!
thumbnail
Felipe Sere, modificado 13 Anos atrás.

RE: Disable Javascript Minifier?

Junior Member Postagens: 87 Data de Entrada: 27/01/10 Postagens Recentes
Hi Bruno,

I don't use any custom JS code and minifier is still crashing on me. The really interesting part is, that a buddy of mine who works with the same setup except for the OS (he runs Windows 7 where I run Mac OS X) does not get the Minifier failure.

It's really hard to debug where the problem is coming from...

Do you have any advanced tips?

Felipe
thumbnail
Bruno Farache, modificado 13 Anos atrás.

RE: Disable Javascript Minifier?

Liferay Master Postagens: 603 Data de Entrada: 14/05/07 Postagens Recentes
Hi Felipe,

I think there are browsers that are more liberal than others, some can accept wrong syntax and others are more strict.
thumbnail
Felipe Sere, modificado 13 Anos atrás.

RE: Disable Javascript Minifier?

Junior Member Postagens: 87 Data de Entrada: 27/01/10 Postagens Recentes
That is the funny part, we both use Chrome... and I just tried it with the latest Opera and I get the exact same results.
Can it be that the JavaScript in AUY is looking at my OS and using different code and that the OS X version just happens to be broken?
Sounds like a longshot, but it is the only way for me to explain the behaviour...

Felipe
Guenter Baumgart, modificado 12 Anos atrás.

RE: Disable Javascript Minifier?

Regular Member Postagens: 119 Data de Entrada: 27/01/12 Postagens Recentes
Please add an option to disable minifier per portlet. We have 300+ JS files and your filter or minifier breaks our code. We are not able to identifier the problem as it happens randomly. Then we tested your filter with a Google closure compiled 1.5 MB big JS file but the results are even worst. Our code is being written properly and works with Rhino and passes all other validations(We have to).

Please consider to add an option for saas exclusion per portlet as well.

Best, G
Guenter Baumgart, modificado 12 Anos atrás.

RE: Disable Javascript Minifier?

Regular Member Postagens: 119 Data de Entrada: 27/01/12 Postagens Recentes
When I set
javascript.fast.load=0 or false and com.liferay.portal.servlet.filters.minifier.MinifierFilter=false
then the top bar controls(Signout,Add Page,..) dissapear except an ongoin activity indicator.

Liferay 6.1
Kirk Stork, modificado 11 Anos atrás.

RE: Disable Javascript Minifier?

Junior Member Postagens: 33 Data de Entrada: 19/05/10 Postagens Recentes
Same here.

Also ...
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: Disable Javascript Minifier?

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
This is a known issue w/ disabling the minifier and the dockbar. Not sure if/when they plan on fixing it.

You really only want to disable the minifier when your trying to diagnose issues w/ your own stuff; after the issues are resolved, you should re-enable the minifier...
Guenter Baumgart, modificado 11 Anos atrás.

RE: Disable Javascript Minifier?

Regular Member Postagens: 119 Data de Entrada: 27/01/12 Postagens Recentes
Hi,
I disagree with this design decision of dictacting a built-in css/js minification globally only. It locks out quite a bunch of applications like ours. We've done for instance a very sophisticated visual CSS3 designer and it collides so much that we had to seperate it. In that we lost the entire benefits of the Liferay portlet concept. We would've loved to see it in Liferay together with community portlets/resources.

However, when we were struggeling with Liferay's filter we also noticed that it filters even correct CSS files out and the client receives empty CSS files. In the response filter we found "HeaderFilter" or something. The Ruby filter btw. also rejects valid css3 as used in Dojo's Dijit framework.

It would be great if we could have some classical run-time configurations per portlet, say post and pre-compile steps. I tried to add this on own but I encountered to many side effects and gave it up.

Is there any support for Google-Closure regarding AUI files on the roadmap ? That could resolve quite some issues. It seems its also not Rhino compatible btw.
g
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: Disable Javascript Minifier?

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
I agree that it is a pain being an all-or-nothing situation with the minifier.

At the very least I would like to see support for disabling the minifier within a script (i.e. if minifier sees a comment /* MINIFIER: OFF */ it does not minify anything in the current file until it sees /* MINIFIER: ON */). That would solve a lot of my minifying issues.

The problem w/ per-portlet settings is that the minifier is outside of portlet processing - it's busy minifying any file being returned by the portal, not the portlets themselves (the portal is feeding the portlet's resources back to the browser in most cases, but the filter is also added to the portlet's web.xml file to ensure it's files are also minified).

The AUI question I'd post to the AUI forum. I don't really do anything w/ AUI, but you'll get more responses from a post there...
thumbnail
Brian Scott Schupbach, modificado 10 Anos atrás.

RE: Disable Javascript Minifier?

Expert Postagens: 329 Data de Entrada: 23/10/08 Postagens Recentes
You can also append &js_fast_load=0&css_fast_load=0&strip=0 to the end of the URL and it will work.
Guenter Nobody, modificado 10 Anos atrás.

RE: Disable Javascript Minifier?

Regular Member Postagens: 119 Data de Entrada: 27/01/12 Postagens Recentes
nice one ! I wish I would have known that before. In the meantime I've put all resources/assets behind a proxy servlet which serves from url or directory. Within the proxy filter I can decide about caching via url parameters or simple config files, or do let Apache its job. The 'proxy file server' variant turns out as best fit in terms of speed for 'hot' user files. I can really recommend it also for development of themes of bigger portlets as the hot-deploy in Liferay IDE is still anything else but a pain for working on daily base with Liferay.

thanks
Brahma Teja Ponnuru, modificado 5 Anos atrás.

RE: Disable Javascript Minifier? [resolved]

New Member Postagens: 12 Data de Entrada: 09/09/15 Postagens Recentes
Setting this minifier.enabled=false in portal-ext.properties actually turns off the minification of JS files which are included in the Portetl View jsps.