Details

      Description

      Epic Information

      Probably one of the most common and direct suggestions to improve a page performance is to Minify Resources (HTML, CSS, and JavaScript).

      Tools like Lighthouse will flag unminified resources like CSS or JS as possible things to improve.

      Currently, and for many years, DXP has a complex minification scheme that involves minifiying resources on the fly in the server.

      This has caused plenty of performance and runtime issues over time and has even stalled progress because the minifiers are outdated and don't support new language features.

      The goal of this Epic is to design and implement a modern and robust strategy to serve minified resources in DXP.

      Acceptance Criteria

      • The current minifier classes are deprecated and disabled by default
      • A new mechanism (flag, setting) can be used to detect if the system is running in production or dev mode to decide which files to serve
      • The new schema does not depend on runtime minification of assets
      • Build process is updated to properly generate the necessary minified (and unminified) JS in build time

      Test Information

      Test Scenarios

      Requirement Test Scenarios Test Priority (business impact)  Covered by frontend/backend Unit Test? Chrome
      Pass/Fail
      Edge Pass/Fail
      LPS-123550 GIVEN fresh portal source code
      WHEN I build portal bundle
      THEN JS files are minified
      5 no  n/a  n/a
      LPS-123550 GIVEN downloaded bundle
      WHEN I check the portal.properties (\liferay-portal\portal-impl\src)
      THEN minifier.enabled = false
      AND minifier.inline.content.cache.enabled = false
      AND minifier.inline.content.cache.skip.css = false
      AND minifier.inline.content.cache.skip.javascript = false
       4 no  n/a  n/a
        GIVEN nodejs.node.env=production in build.properties
      WHEN I start building the system
      THEN JS files are served AND the system is built without any error
       5 yes  n/a  n/a
        GIVEN nodejs.node.env=development in build.properties
      WHEN I start building the system
      THEN Portal is built with unminified JS
      4 no  n/a  n/a

      QA will not test: 
      -every module of Portal
      -build time
      -file size
      -will not look for deprecated minifications
      -will not check if the code is minified
      -will not compared minified with unminified files

      Qa will do:
      -check if there are not building problems
      -funcionalities are not broken (Poshi) 
      -check if flag works; is possible to build Portal with minifications and without

      Maight be helpful with testing: 
      https://github.com/liferay/liferay-frontend-projects/pull/233
      https://stackoverflow.com/questions/36998995/how-to-check-if-minification-went-wrong

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              jose.balsas Chema Balsas
              Recent user:
              Bruno Fernández
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package