Skip to content

Don't load datepicker module until it is actually needed #27860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

krzksz
Copy link
Contributor

@krzksz krzksz commented Apr 15, 2020

Description (*)

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

Goal here is to eliminate unnecessary loading of datepicker UI component, which is only needed when the shop has date of birth field enabled.

Performance improvement

Tested on Magento 2.4-develop with Luma and sample data.

  • 205 → 202 JS requests (-1.46%).
  • 698.40kB → 652.57kB JS transferred (-6.56%).

Manual testing scenarios (*)

  1. Enable date of birth field for customers in admin.
  2. Verify that jquery/ui-modules/datepicker.js is not loaded on pages that do not use datepicker (e.g. homepage, category, product etc.).
  3. Verify that above file is loaded and datepicker works properly on pages that use it (e.g. customer registration form page).

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)

Resolved issues:

  1. resolves [Issue] Don't load datepicker module until it is actually needed #28823: Don't load datepicker module until it is actually needed

@krzksz krzksz added the Area: Perf/Frontend All tickets related with improving frontend performance. label Apr 15, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2020

Hi @krzksz. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @krzksz,
Please review failing tests, looks like date format has changed

@ihor-sviziev ihor-sviziev added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Apr 15, 2020
@Bartlomiejsz Bartlomiejsz removed their request for review April 15, 2020 11:38
@ihor-sviziev ihor-sviziev removed the request for review from ptylek April 15, 2020 13:38
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @krzksz,
Functional tests still fails due to incorrect date format, please fix it

@krzksz
Copy link
Contributor Author

krzksz commented Apr 19, 2020

@magento give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @krzksz. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @krzksz, here is your new Magento instance.
Admin access: https://pr-27860.instances.magento-community.engineering/admin_be04
Login: de96da0c Password: f341cfebc4ef
Instance will be terminated in up to 3 hours.

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ approved
Failing functional tests for EE isn’t related to changes from this PR

@ghost ghost added the Progress: accept label Apr 22, 2020
@slavvka slavvka added this to the 2.4.1 milestone Apr 22, 2020
@slavvka slavvka added Priority: P3 May be fixed according to the position in the backlog. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Apr 22, 2020
@ghost ghost assigned DrewML Apr 24, 2020
Copy link

@DrewML DrewML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work! Suggested one additional optimization, but looks great!

@ihor-sviziev ihor-sviziev added Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. and removed Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Apr 28, 2020
@VladimirZaets VladimirZaets added Progress: accept QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) and removed Progress: extended testing Progress: accept labels May 19, 2020
@engcom-Delta
Copy link
Contributor

@magento create issue

@engcom-Delta engcom-Delta added QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels Jun 22, 2020
@ghost ghost added the Progress: accept label Jun 23, 2020
@magento-engcom-team magento-engcom-team merged commit 587d0c0 into magento:2.4-develop Jun 24, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jun 24, 2020

Hi @krzksz, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Area: Perf/Frontend All tickets related with improving frontend performance. Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Theme Component: Ui improvement Partner: creativestyle partners-contribution Pull Request is created by Magento Partner Priority: P3 May be fixed according to the position in the backlog. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] Don't load datepicker module until it is actually needed
10 participants