Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-141000

JavaScript Minifier does not shorten local variable names

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 7.2.X, 7.3.X, Master
    • Fix Version/s: None
    • Component/s: Minifier
    • Labels:

      Description

      JavaScript minifier is not shortening local variable nor function parameter names.

      Reproduction steps

      • Add the following properties to your portal-ext.properties file:
        minifier.enabled=true
        javascript.fast.load=true
        theme.images.fast.load=true
        layout.template.cache.enabled=true
      • Start a Liferay DXP instance
      • Check some Javascript files. For instance: session.js or form.js

       

      Expected result  
      Local variable and function parameter names are shortened.

      Example (session.js):

      AUI.add("liferay-session", (b)=>{
          var c = b.Lang
            , d = []
            , e = b.config
            , f = e.doc
            , x = {
              active: "activated"
          }
      

       

       Actual result

      Local variable and function parameter names remain the same as in source code.

      Example (session.js):

      AUI.add("liferay-session", (A)=>{
          var Lang = A.Lang;
          var BUFFER_TIME = [];
          var CONFIG = A.config;
          var DOC = CONFIG.doc;
          var MAP_SESSION_STATE_EVENTS = {
              active: "activated"
          };
      

       

      * Note that all of the above code examples are pretty-printed, because line breaks and unnecessary spaces are successfully removed.

       

        Attachments

          Activity

            People

            Assignee:
            team-frontend-infra Product Team Frontend Infrastructure
            Reporter:
            jose.bango Jose L. Bango
            Participants of an Issue:
            Recent user:
            Jose L. Bango
            Engineering Assignee:
            Jose L. Bango
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              4 weeks, 6 days ago

                Packages

                Version Package