Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041093Openbravo ERPA. Platformpublic2019-06-13 18:012019-06-21 14:42
caristu 
jarmendariz 
immediateminoralways
closedfixed 
5
 
3.0PR19Q3 
caristu
Core
Pre packaging ( pi )
2019-11-12
pi
No
0041093: JS static resources are not correctly minimized
The JS static resources are not correctly minimized.

It seems that JSMin is not able to minimize the code in ob-utilities.js file after this change[1]

[1]https://code.openbravo.com/erp/devel/pi/diff/a3916b3d436d/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js#l1.846 [^]
1- Start tomcat having no modules in development status. Also make sure that there is not any JS file generated in WebContent/web/js/gen.
2- The following error appears in the log:
2019-06-13 16:58:47,011 [http-nio-8080-exec-5] ERROR org.openbravo.client.kernel.JSCompressor - Unterminated string literal at line 4617 and column 0
net.matthaynes.jsmin.JSMin$UnterminatedStringLiteralException: Unterminated string literal at line 4617 and column 0
    at net.matthaynes.jsmin.JSMin.action(Unknown Source) ~[jsmin.0.2.4.jar:?]
    at net.matthaynes.jsmin.JSMin.jsmin(Unknown Source) ~[jsmin.0.2.4.jar:?]
    at org.openbravo.client.kernel.JSCompressor.compress(JSCompressor.java:59) [classes/:?]
    at org.openbravo.client.kernel.StaticResourceComponent.getStaticResourceFileName(StaticResourceComponent.java:327) [classes/:?]
    at org.openbravo.client.kernel.StaticResourceComponent.generate(StaticResourceComponent.java:109) [classes/:?]
    at org.openbravo.client.kernel.ComponentGenerator.generate(ComponentGenerator.java:58) [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.processComponentRequest(KernelServlet.java:264) [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.doGet(KernelServlet.java:209) [classes/:?]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) [servlet-api.jar:?]
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:200) [openbravo-core.jar:?]
3- Tomcat starts but note that the JS content is not minimized
No tags attached.
caused by feature request 0039983 closed jarmendariz Upgrade javascript linter and formatter 
related to defect 0042475 closed alostale Openbravo JS minimizer does not work well with template literals 
Issue History
2019-06-13 18:01caristuNew Issue
2019-06-13 18:01caristuAssigned To => jarmendariz
2019-06-13 18:01caristuModules => Core
2019-06-13 18:01caristuRegression introduced in release => pi
2019-06-13 18:01caristuTriggers an Emergency Pack => No
2019-06-13 18:01caristuIssue generated from0039983
2019-06-13 18:01caristuRelationship addedcaused by 0039983
2019-06-13 18:02caristuRegression level => Pre packaging ( pi )
2019-06-13 18:02caristuRegression date => 2019-11-12
2019-06-14 11:58jarmendarizStatusnew => scheduled
2019-06-17 11:37hgbotCheckin
2019-06-17 11:37hgbotNote Added: 0112811
2019-06-17 11:37hgbotStatusscheduled => resolved
2019-06-17 11:37hgbotResolutionopen => fixed
2019-06-17 11:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5fd4f84539e6a4754dad0666bcfb9a4ee4ab9e53 [^]
2019-06-17 11:41jarmendarizReview Assigned To => caristu
2019-06-17 19:39hudsonbotCheckin
2019-06-17 19:39hudsonbotNote Added: 0112841
2019-06-21 14:42caristuNote Added: 0112945
2019-06-21 14:42caristuStatusresolved => closed
2019-06-21 14:42caristuFixed in Version => 3.0PR19Q3
2019-12-05 12:15alostaleRelationship addedrelated to 0042475

Notes
(0112811)
hgbot   
2019-06-17 11:37   
Repository: erp/devel/pi
Changeset: 5fd4f84539e6a4754dad0666bcfb9a4ee4ab9e53
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Mon Jun 17 11:35:38 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/5fd4f84539e6a4754dad0666bcfb9a4ee4ab9e53 [^]

Fixed issue 41093: JS static resources are not correctly minimized

Changes in format and escaping in regular expressions made JSMin to not
parse properly javascript files. This commid adds missing parentheses wrapping
regexes (removed by prettier) and adding a scaping character removed by ESLint.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
---
(0112841)
hudsonbot   
2019-06-17 19:39   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/2ad95dac1570 [^]
Maturity status: Test
(0112945)
caristu   
2019-06-21 14:42   
Reviewed + tested OK.