RE: Disable lodash in Liferay 7.1

thumbnail
Eric D, modified 6 Years ago. Junior Member Posts: 59 Join Date: 3/25/16 Recent Posts
In Liferay 7.1, we can disable lodash and increase performance of every pages.Do you know if we can do that with no consequences? If yes, why lodash is active by default? 
Javier Lamadrid, modified 6 Years ago. New Member Posts: 15 Join Date: 4/8/19 Recent Posts
There is a consequence when deactivating Lodash, at least in version 7.1.2 GA3. The forms stop working in the backend, it causes an error js.
Regards
thumbnail
Eric D, modified 6 Years ago. Junior Member Posts: 59 Join Date: 3/25/16 Recent Posts
Thanks for your answer. I have try in our website and it seems ok for Forms with fixpack 11.Do you know what is wrong with form because it seems ok for us. 
Javier Lamadrid, modified 6 Years ago. New Member Posts: 15 Join Date: 4/8/19 Recent Posts
The error occurs when trying to edit a form. The editing screen is not displayed and a javascript error appears.

Maybe it is solved in the version you are commenting on...

Regards
thumbnail
Chema Balsas, modified 6 Years ago. Regular Member Posts: 127 Join Date: 2/25/13 Recent Posts
Hey Eric, 

Do you know if we can do that with no consequences? 

That depends. From Liferay, we tried to remove all of our usages on Lodash. Other than missing some usages (like that of forms), it should be safe from out of the box features. The consequence of disabling Lodash is that if you have code depending on it, it will fail to work, so wether it will have or not consequences is pretty much a very specific question that only you can answer.
why lodash is active by default? 

As I stated before, disabling Lodash should be safe from a platform's point of view, because we no longer depend on it. Since we can't tell if you need it or not, we keep it enabled in 7.1 to make sure we don't break existing code and installations. We disable it by default in 7.2 because you can then make the choice of updating your code or enabling Lodash.

In summary, if you know you don't depend on Lodash, it should be safe for you to disable it. We can't make that decision by default on 7.1 because it would mean introducing a huge breaking change.
Javier Lamadrid, modified 6 Years ago. New Member Posts: 15 Join Date: 4/8/19 Recent Posts
Chema's is the good answer emoticon
I was just trying to expose the problem we encountered in a project when we tried to deactivate it.

Regards...
thumbnail
Eric D, modified 6 Years ago. Junior Member Posts: 59 Join Date: 3/25/16 Recent Posts
One week later... we must reactivate lodash. :-(
There is a problem when users want to edit the properties of a picture of a web content in backoffice.
I will open a ticket for this because this lib has 3 high vulnerabilities :

And is very slow :