-
Notifications
You must be signed in to change notification settings - Fork 227
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
Closes #7243: Preload fonts frontend #7312
base: feature/preload-fonts
Are you sure you want to change the base?
Closes #7243: Preload fonts frontend #7312
Conversation
…ment/7240-beacon-insertion
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR depends on the following PR:
#7304
I'm going to document this now to mention how to use the new approach, this will help a lot in preparing the head items not to print the tags directly and will adjust the ordering of preload, preconnect, ...etc. into head.
The new way of printing head elements is documented here: |
Description
Fixes #7243
This PR brings the front-end optimization to the newly added feature
Preload Fonts
.Type of change
Detailed scenario
None
Technical description
Documentation
This pull request introduces several changes to the
inc/Engine/Media/PreloadFonts/Frontend/Controller.php
file to implement font preloading functionality. Additionally, it includes updates to the test fixtures to ensure the feature works correctly.Key changes:
Implementation of Font Preloading:
UrlTrait
to theController
class to leverage URL-related utilities.optimize
method to include logic for preloading fonts if the corresponding database row indicates fonts to preload.preload_fonts
,is_third_party_font
, andpreload_tag
private methods to handle the generation of preload tags for fonts and determine if a font URL is third-party.Test Fixtures Updates:
maybe_apply_optimizations.php
to include new test cases for font preloading, ensuring the expected output matches the preloaded fonts scenario. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]Configuration Updates:
phpstan-baseline.neon
to account for a new usage ofapply_filters
in theController.php
file.New dependencies
None
Risks
None
Mandatory Checklist
Code validation
Code style