Skip to content

Load storage polyfill conditionally #27619

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.

This one follows the approach from #27618 which let's us remove loading of storage polyfill so it is only applied for those rare cases when it is not supported. I also reformatted requirejs-config.js keys a bit so it is aligned with other configurations you can find in Magento codebase.

Manual testing scenarios (*)

  1. Storage polyfill is only loaded and applied when either localStorage or sessionStorage are not available.

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] Load storage polyfill conditionally #28381: Load storage polyfill conditionally

@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 force-pushed the performance-storage-polyfill branch from 51a3163 to cba9d46 Compare April 5, 2020 08:38
@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
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 the static tests?

@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"

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

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

@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests CE

@engcom-Echo engcom-Echo self-assigned this Apr 28, 2020
@ihor-sviziev ihor-sviziev added the Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. label Apr 28, 2020
@slavvka slavvka added this to the 2.4.1 milestone Apr 28, 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. 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 the QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) label May 19, 2020
@VladimirZaets
Copy link
Contributor

@magento create issue

@slavvka
Copy link
Member

slavvka commented May 27, 2020

@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 magento-engcom-team merged commit c9e6b13 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.

@omiroshnichenko
Copy link
Contributor

Hi @krzksz! Thanks for this PR. This is a small, but very helpful fix. One thing, I see that this polyfill been used only in frontend area(declared in frontend layout), but you added a condition in base require.js. This means that this polyfill will appear for the admin area as well. Could you please move this condition in frontend requirejs-config file?

@ihor-sviziev
Copy link
Contributor

@omiroshnichenko done in #28749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Area: Lib/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: complex Component: Theme 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: 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] Load storage polyfill conditionally
8 participants