Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Dave Willis
Disable Javascript Minifier? [resolved]
January 7, 2010 9:32 AM
Answer

Dave Willis

Rank: Expert

Posts: 301

Join Date: July 13, 2009

Recent Posts

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
Bruno Farache
RE: Disable Javascript Minifier?
January 6, 2010 5:38 PM
Answer

Bruno Farache

LIFERAY STAFF

Rank: Expert

Posts: 484

Join Date: May 14, 2007

Recent Posts

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
RE: Disable Javascript Minifier?
January 7, 2010 9:31 AM
Answer

Dave Willis

Rank: Expert

Posts: 301

Join Date: July 13, 2009

Recent Posts

Thanks!
Felipe Sere
RE: Disable Javascript Minifier?
September 15, 2010 12:20 PM
Answer

Felipe Sere

Rank: Junior Member

Posts: 87

Join Date: January 27, 2010

Recent Posts

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
Bruno Farache
RE: Disable Javascript Minifier?
September 15, 2010 2:36 PM
Answer

Bruno Farache

LIFERAY STAFF

Rank: Expert

Posts: 484

Join Date: May 14, 2007

Recent Posts

Hi Felipe,

I think there are browsers that are more liberal than others, some can accept wrong syntax and others are more strict.
Felipe Sere
RE: Disable Javascript Minifier?
September 15, 2010 9:05 PM
Answer

Felipe Sere

Rank: Junior Member

Posts: 87

Join Date: January 27, 2010

Recent Posts

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 Nobody
RE: Disable Javascript Minifier?
February 5, 2012 10:03 AM
Answer

Guenter Nobody

Rank: Regular Member

Posts: 119

Join Date: January 27, 2012

Recent Posts

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 Nobody
RE: Disable Javascript Minifier?
February 5, 2012 10:11 AM
Answer

Guenter Nobody

Rank: Regular Member

Posts: 119

Join Date: January 27, 2012

Recent Posts

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
RE: Disable Javascript Minifier?
May 4, 2012 11:35 AM
Answer

Kirk Stork

Rank: Junior Member

Posts: 29

Join Date: May 19, 2010

Recent Posts

Same here.

Also ...
Attachment

Attachments: Untitled 2.png (56.5k)
David H Nebinger
RE: Disable Javascript Minifier?
May 4, 2012 11:38 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6126

Join Date: September 1, 2006

Recent Posts

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 Nobody
RE: Disable Javascript Minifier?
May 4, 2012 12:59 PM
Answer

Guenter Nobody

Rank: Regular Member

Posts: 119

Join Date: January 27, 2012

Recent Posts

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
David H Nebinger
RE: Disable Javascript Minifier?
May 4, 2012 2:08 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6126

Join Date: September 1, 2006

Recent Posts

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...
Brian Scott Schupbach
RE: Disable Javascript Minifier?
June 5, 2013 4:17 PM
Answer

Brian Scott Schupbach

Rank: Expert

Posts: 331

Join Date: October 23, 2008

Recent Posts

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
RE: Disable Javascript Minifier?
June 5, 2013 4:28 PM
Answer

Guenter Nobody

Rank: Regular Member

Posts: 119

Join Date: January 27, 2012

Recent Posts

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