Skip to content
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 #7241: 3.19 Preload Fonts Beacon Processing Part #7316

Conversation

jeawhanlee
Copy link
Contributor

Description

Fixes #7241
Collates the fonts above the fold using the beacon script.

Type of change

  • New feature (non-breaking change which adds functionality).

Detailed scenario

N/A

Technical description

Documentation

Collates all urls of fonts above the fold both external and self hosted.

Use a template with the following external fonts to test with the mock data in this PR:

 <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<link href="https://fonts.cdnfonts.com/css/paper-sign" rel="stylesheet">

You can use any font for self hosted fonts.

The mock data can be adjusted using the filter rocket_preload_fonts_font_data to return different external fonts data that matches with what is used in the template.

New dependencies

N/A

Risks

N/A

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Unticked items justification

If some mandatory items are not relevant, explain why in this section.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

@jeawhanlee jeawhanlee self-assigned this Feb 20, 2025
@jeawhanlee jeawhanlee linked an issue Feb 20, 2025 that may be closed by this pull request
Copy link

codacy-production bot commented Feb 20, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.14% (target: -0.10%) 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (045ea4a) 39430 17232 43.70%
Head commit (9fb850e) 39531 (+101) 17333 (+101) 43.85% (+0.14%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7316) 102 102 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@jeawhanlee jeawhanlee modified the milestones: 3.19, 3.19-prealpha Feb 20, 2025
@Khadreal Khadreal merged commit e4638fa into feature/preload-fonts Feb 21, 2025
13 checks passed
@Khadreal Khadreal deleted the task/7241-3.19-preload-fonts-beacon-processing-part branch February 21, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.19 - Preload Fonts - Beacon processing part
2 participants