magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

[Issue] Code cleanup and add new critical head block and move critical css before assets

Open m2-assistant[bot] opened this issue 1 year ago • 4 comments
trafficstars

This issue is automatically created based on existing pull request: magento/magento2#35580: Code cleanup and add new critical head block and move critical css before assets


Description (*)

The critical css should appear before the assets. In addition, the changes provide many more opportunities to insert custom blocks between the meta details and assets via template or xml blocks. These include, for example, own meta specifications which are not controllable via XML, as well as assets from the template which must be inserted before other files, for example, constentscripts or special preloads, og:meta tags.

These changes are important to make the frontend basically more customizable and performace or function optimization.

Related Pull Requests

Fixed Issues (if relevant)

  1. use short syntax PHP 5 compatibility is no longer needed
  2. adjustment namespace import
  3. use switch statement with direct return
  4. move critical inline css before assets

Manual testing scenarios (*)

  1. Use CSS critical path

Questions or comments

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)
  • [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [ ] All automated tests passed successfully (all builds are green)

Before: before

After: after

m2-assistant[bot] avatar May 23 '24 10:05 m2-assistant[bot]

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • [ ] 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • [ ] 5. Add label Issue: Confirmed once verification is complete.
  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar May 23 '24 10:05 m2-assistant[bot]

Hello @in-session,

Thank you for the report and collaboration!

Verified this on 2.4-develop. The critical CSS is appearing after the assets. Take a look at the screenshot below: image

And the rest of the code cleanup looks good, Hence confirming the issue.

Thank you.

engcom-November avatar May 23 '24 10:05 engcom-November

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12000 is successfully created for this GitHub issue.

github-jira-sync-bot avatar May 23 '24 10:05 github-jira-sync-bot

:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] avatar May 23 '24 10:05 m2-assistant[bot]