Skip to content

[Issue] Cleanup base theme JavaScript modules #28811

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #27617: Cleanup base theme JavaScript modules


Description (*)

Magento 2.4-develop
This PR is a part of my effort to improve Magento 2 frontend performance.

Here I went file by file through the network tab and cleaned-up files that are always loaded by a theme. Changes in this PR include:

  • responsive.js is completely removed because no code in its contents seems to be valid anymore. Additionally, because it was defined in deps you couldn't even create a mixin for it.
    1. product-info-additional can't be found anywhere in the code base so lines 23-33 do nothing.
    2. Both mageZoom and mageGallery cannot be found in the code as well (maybe a leftover from M1?). There is mage.zoom widget but it doesn't seem to be imported anywhere.
    3. .action.toggle.checkout.progress element doesn't exist in any HTML, PHTML and JS file.
    4. checkout-progress-wrapper does not exist.
  • theme.js is cleaned-up:
    1. collapsiblecreate event can't be found in the code base.
    2. #store element is not in the code base.
  • ie-class-fixer is adjusted to be a proper AMD module and uses classList API which IE11 supports anyway.

Expected behavior (*)

  1. Regarding responsive.js and theme.js files nothing should change as code was not applied anyway.
  2. Regarding ie-class-fixer.js, ie11 class should be added to the body on IE11.

Benefits

This PR is a part of my effort to improve Magento 2 frontend performance.

Additional information

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Labels

Component: ThemeFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Triage: DoneHas been reviewed and prioritized during Triage with Product Managers

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions