Details

      Description

      Epic Information

      As part of our Platform Evolution Roadmap, we want to complete the Removal of Metal.js usage by December 2020.

      About 10 months ago we wrote about The State of Frontend Infrastructure in DXP. In there, we made our position clear about React being our frontend technology pick. In there, we said the following about Metal:

      While it came close to achieving some of those goals, we never hit the performance we wanted and more importantly, it always felt like we were the only people using this technology. We've moved on and recommend you learn from our mistakes and stay away.

      While there are still some useful utilities in metal, most of the usages overlap other libraries already in DXP, so removing usage will help improve our product code consistency, maintenance and overall performance.

      The goal of this particular epic is to replace usages of metal with standard APIs or specific DXP functions when needed. This is a continuation of LPS-122383 (Remove usages of metal-dom in DXP codebase)

      Acceptance Criteria

      • There are no usages of any metal modules in DXP's code base
      • For backwards compatibility, all metal modules should still be bundled as part of frontend-js-metal-web
      • There should be no dependencies with any metal module in any other module in their package.json file
      • There is no references to any any metal module in any .npmbundlerrc file
      • The metal eslintrc preset is not used in the DXP codebase

      This is the list of metal modules dependencies in frontend-js-metal-web, plus some other modules found in both metal and metal-plugins source repositories. Bold items define elements currently used and referenced from some DXP module, therefore, specific tasks to remove those dependencies must exist. Italic items only exist in the codebase as referenced elements from .npmbundlerrc files. All references to metal packages in .npmbundlerrc files will be handled in a specific removal task (LPS-125185):

      • incremental-dom-string
      • metal: LPS-125114
      • metal-affix: LPS-125119
      • metal-ajax
      • metal-anim
      • metal-aop
      • metal-assertions
      • metal-clipboard
      • metal-component: LPS-125125
      • metal-debounce: LPS-125126
      • metal-dom (handled in a separate epic LPS-122383)
      • metal-drag-drop: LPS-125130
      • metal-events: LPS-125131
      • metal-incremental-dom: LPS-125133
      • metal-isomorphic
      • metal-jsx: LPS-125134
      • metal-key
      • metal-keyboard-focus
      • metal-multimap
      • metal-pagination
      • metal-path-parser
      • metal-position: LPS-125135
      • metal-promise: LPS-125136
      • metal-router
      • metal-scrollspy
      • metal-soy: LPS-125137
      • metal-soy-bundle
      • metal-state: LPS-125138
      • metal-storage
      • metal-structs
      • metal-throttle: LPS-125139
      • metal-toggler
      • metal-uri
      • metal-useragent
      • metal-web-component

       
      Test Information section

       

      Requirement Test Scenarios Covered by frontend/backend unit test? (Yes/No) Test Priority (business impact)
      There should be no dependencies with any metal module in any other module in their package.json file  Given console terminal at liferay portal root
      When run command:
      git grep -W metal -- '*package.json'

      Then returns no lines except from frontend-js-metal-web directory if any

      no 5-critical
      There are no usages of any metal modules in DXP's code base Given console terminal at liferay portal root
      When run command:
      git grep -W metal

      Then returns no lines except from frontend-js-metal-web directory if any

      no 4-major
      There are no usages of any metal modules in DXP's code base  Given console terminal at liferay portal root
      When run command:
      git grep -W "import {[A-Za-z]*\} from 'metal'\|import [A-Za-z]* from 'metal'" *

      Then returns no lines except from frontend-js-metal-web directory if any

      no 3-medium
      LPS-125185 - There is no references to any any metal module in any .npmbundlerrc file Given console terminal at liferay portal root
      When run command:
       git grep -E '"metal|incremental-dom-string' -- '*.npmbundlerrc' ':(exclude)*frontend-js-metal-web*'

      Then returns no lines except from frontend-js-metal-web directory if any

      no 4-major
      LPS-125174 - The metal eslintrc preset is not used in the DXP codebase Given console terminal at liferay portal root
      When run command:
      git grep -W @liferay/eslint-config/metal -- '*.eslintrc.js'

      Then returns no lines except from frontend-js-metal-web directory if any

      no 4-major
      For backwards compatibility, all metal modules should still be bundled as part of frontend-js-metal-web  Given   https://github.com/liferay/liferay-portal/blob/db5efa19792bebefbdfe1c8022b84469bbf73942/modules/apps/frontend-js/frontend-js-metal-web/package.json
      When I check the history from 8th January and compare with the current
      Then files are the same
       no  4-major

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              daniel.sanz Daniel Sanz
              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