Skip to content

Adjust mechanism that moves all scripts to the end of the page #27270

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
merged 16 commits into from
May 19, 2020

Conversation

krzksz
Copy link
Contributor

@krzksz krzksz commented Mar 12, 2020

Description (*)

This PR introduces a similar change to #27211, we had this feature implemented in our custom extension and we eventually had to increase both ipcre.backtrack_limit and pcre.recursion_limit to something around 1000000 in order for the regular expressions to work for large pages.

Fixed Issues (if relevant)

  1. Possibly https://community.magento.com/t5/Magento-2-x-Technical-Issues/Magento-2-3-3-Move-JS-code-to-the-bottom-of-the-page-Error/td-p/348577
  2. JsFooterPlugin sets Http Response content empty if PCRE limit reached #26026 - JsFooterPlugin sets Http Response content empty if PCRE limit reached

Manual testing scenarios (*)

  1. Change Move JS code to the bottom of the page to Yes under Stores->Configuration->Advanced->Developer.
  2. Refresh the caches and open the shopfront.
  3. Verify that all script tags are located in the same order right before the end of body tag.

Questions or comments

I am unable to find any tests for this feature and I'm not experienced enough with PHP to write one from scratch so it would be great if someone contributed some tests here. Thanks!

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)

@krzksz krzksz requested a review from vzabaznov March 12, 2020 19:34
@m2-assistant
Copy link

m2-assistant bot commented Mar 12, 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 unit test failure. Other tests failures looks not related to changes from this PR

@krzksz
Copy link
Contributor Author

krzksz commented Mar 18, 2020

Hey @ihor-sviziev, checking it now... I wonder why I was not able to find them before 🤔

@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests B2B

@ihor-sviziev ihor-sviziev added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: category of expertise Award: test coverage labels Mar 20, 2020
ihor-sviziev
ihor-sviziev previously approved these changes Mar 20, 2020
@magento-engcom-team
Copy link
Contributor

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

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@engcom-Echo
Copy link
Contributor

@magento run all tests

@engcom-Echo
Copy link
Contributor

Need to approve the failures of MCHI tests

@ihor-sviziev
Copy link
Contributor

@engcom-Echo Magento Health Index seems like false positive. Are you sure we need approval for that?

@VladimirZaets VladimirZaets added the QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope label May 18, 2020
@slavvka
Copy link
Member

slavvka commented May 19, 2020

MCHI failure is false positive, no need to approve

@magento-engcom-team
Copy link
Contributor

Hi @slavvka, thank you for the review.
ENGCOM-7154 has been created to process this Pull Request

@engcom-Echo
Copy link
Contributor

@magento run all tests

@sdzhepa sdzhepa added QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope labels May 19, 2020
@slavvka slavvka merged commit c471500 into magento:2.4-develop May 19, 2020
@m2-assistant
Copy link

m2-assistant bot commented May 19, 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
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: category of expertise Component: Catalog Component: Sales Component: Theme Partner: creativestyle partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. 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
None yet
Development

Successfully merging this pull request may close these issues.

JsFooterPlugin sets Http Response content empty if PCRE limit reached