Skip to content

[PERF Improvements]Load polyfills for browsers that don't support certain features #27618

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 5, 2020

Description (*)

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

Here I'm using RequireJS configuration and the whole deps mechanism to conditionally load browser features polyfils only when needed. Changes in this PR include:

Manual testing scenarios (*)

  1. UI components, e.g. in checkout or admin are still functional.
  2. Polyfills for Map, WeakMap, FormData and MutationObserver are loaded only for old browsers that do not support them.

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] [PERF Improvements]Load polyfills for browsers that don't support certain features #28382: [PERF Improvements]Load polyfills for browsers that don't support certain features

@m2-assistant
Copy link

m2-assistant bot commented Apr 5, 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.

@krzksz krzksz mentioned this pull request Apr 5, 2020
5 tasks
@okorshenko okorshenko changed the title Load polyfills for browsers that don't support certain features [PERF Improvements]Load polyfills for browsers that don't support certain features Apr 5, 2020
@okorshenko
Copy link
Contributor

memo: We do have a recording of this demo.

@ihor-sviziev ihor-sviziev self-assigned this Apr 6, 2020
@ihor-sviziev
Copy link
Contributor

@krzksz looks like it will be not easy to cover these changes with automatic tests. Do you think it's possible to cover your changes with some tests?

@ihor-sviziev ihor-sviziev added Award: complex Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests labels Apr 6, 2020
@ihor-sviziev
Copy link
Contributor

As we discussed in Slack - it's too hard to cover these changes with automated tests, so I put label "not required"

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,
Your changes looks good to me.
Could you fix static tests?

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-7285 has been created to process this Pull Request

@krzksz krzksz added the Area: Perf/Frontend All tickets related with improving frontend performance. label Apr 10, 2020
@engcom-Alfa engcom-Alfa self-assigned this Apr 27, 2020
@magento-engcom-team
Copy link
Contributor

Hi @engcom-Alfa. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @engcom-Alfa, here is your new Magento instance.
Admin access: https://pr-27618.instances.magento-community.engineering/admin_8eb0
Login: e84ff395 Password: 12428af099a7
Instance will be terminated in up to 3 hours.

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

UI components are still functional and polyfills for Map, WeakMap, FormData, and MutationObserver aren't loaded for new browsers.

@engcom-Echo engcom-Echo self-assigned this Apr 27, 2020
@slavvka slavvka added this to the 2.4.1 milestone Apr 27, 2020
@slavvka slavvka added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Apr 27, 2020
@VladimirZaets VladimirZaets added the QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) label May 19, 2020
@ghost ghost mentioned this pull request May 27, 2020
5 tasks
@VladimirZaets
Copy link
Contributor

@magento create issue

@VladimirZaets
Copy link
Contributor

@magento run all tests

@VladimirZaets VladimirZaets 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 May 27, 2020
magento-engcom-team pushed a commit that referenced this pull request Jun 5, 2020
@magento-engcom-team magento-engcom-team merged commit 0a39260 into magento:2.4-develop Jun 5, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jun 5, 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: Not Required Changes in Pull Request does not require coverage by auto-tests Award: category of expertise Award: complex Component: Ui Event: Global-Contribution-Day 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: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] [PERF Improvements]Load polyfills for browsers that don't support certain features
8 participants