René's URL Explorer Experiment


Title: feat: preload the heading font on published pages by ysamcode · Pull Request #560 · ycode/ycode · GitHub

Open Graph Title: feat: preload the heading font on published pages by ysamcode · Pull Request #560 · ycode/ycode

X Title: feat: preload the heading font on published pages by ysamcode · Pull Request #560 · ycode/ycode

Description: Summary Google Fonts CSS is already inlined, but the browser only discovers which .woff2 it needs after layout, once text is matched against @font-face rules. On a text-hero page that gap sits directly on the LCP critical path — the H1 waits on a font request that could have been issued from . Uploaded custom fonts are already preloaded; Google families were left CSS-discovered. This preloads exactly one file: the upright latin subset of the font the page's first heading renders in. Second slice of #550, alongside #559. Stacked on #559 so a single preview deploy carries both LCP changes for the PageSpeed comparison. GitHub will retarget to develop once #559 merges. Changes Add lib/font-preload.ts: getTextFontFromClasses reads font-[Family_Name], font-sans|serif|mono, font-bold / font-[700] from compiled classes (desktop only) findLcpTextFont walks the tree in render order, cascading font-* from ancestors like CSS inheritance, skipping header / nav / footer and hidden layers; prefers the first

, then any heading, then the first paragraph; weight defaults to 400 (Tailwind preflight resets headings to inherit) parseFontFaceRules + getLcpFontPreloads match family, upright style and weight (handles variable-font ranges like 200 800) and keep only the U+0000-00FF subset PageRenderer: append the LCP font to the existing fontPreloads after the inlined CSS is resolved Static export: resolver exposes lcpTextFont per page; engine merges the preload into buildDocument's fontPreloads Add lib/font-preload.test.ts (11 cases) and register it in the test script Verified against the client website's live inlined CSS and H1 classes: resolves to Plus Jakarta Sans 700 → fonts.gstatic.com/s/plusjakartasans/v12/…woff2 (upright latin, not italic / latin-ext). Test plan Page with a Google-font H1: contains one pointing at the H1 family's upright latin file Page whose H1 uses a built-in stack (font-sans) or a custom uploaded font: no extra Google preload emitted; custom preload unchanged Page with no Google fonts installed: no preload, no errors Heading inside header/nav is ignored; the first hero heading wins Static export: same appears in exported HTML per page PageSpeed (mobile) on the #559 + this preview for the client website: LCP element stays the H1, "font-display" / "preload LCP" audits improve vs the two runs in #551 npm test passes (117 tests)

Open Graph Description: Summary Google Fonts CSS is already inlined, but the browser only discovers which .woff2 it needs after layout, once text is matched against @font-face rules. On a text-hero page that gap sits dire...

X Description: Summary Google Fonts CSS is already inlined, but the browser only discovers which .woff2 it needs after layout, once text is matched against @font-face rules. On a text-hero page that gap sits dire...

Opengraph URL: https://github.com/ycode/ycode/pull/560

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5ba0d657-2eda-49de-cc1a-2e5cf62325c1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEDA6:391445:2324C9:2DA1CA:6AFE48D6
html-safe-nonce13ce8f1c2c38c16dcdc41614a750d513d367927d081626ec1c24381aaeaf4986
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREE2OjM5MTQ0NToyMzI0Qzk6MkRBMUNBOjZBRkU0OEQ2IiwidmlzaXRvcl9pZCI6IjkyMTA5NDE3MDMyMTU1MzIyNDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3f5c32ae6b74e3ab281d8783845b268c5cd5b343c493dcc260b4c151b3cfb2c8
hovercard-subject-tagpull_request:4557971210
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/ycode/ycode/pull/560/files
twitter:imagehttps://avatars.githubusercontent.com/u/7631193?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/7631193?s=400&v=4
og:image:altSummary Google Fonts CSS is already inlined, but the browser only discovers which .woff2 it needs after layout, once text is matched against @font-face rules. On a text-hero page that gap sits dire...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef1a5901e2377b0af2a0b303f9528678f1475d04b9219dca1e993344196eaa07c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/ycode/ycode git https://github.com/ycode/ycode.git
octolytics-dimension-user_id65892203
octolytics-dimension-user_loginycode
octolytics-dimension-repository_id1165452593
octolytics-dimension-repository_nwoycode/ycode
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1165452593
octolytics-dimension-repository_network_root_nwoycode/ycode
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasece393ea11ad276623b946bc9663d3e7d6f564275
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/ycode/ycode/pull/560/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fycode%2Fycode%2Fpull%2F560%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fycode%2Fycode%2Fpull%2F560%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=ycode%2Fycode
Reloadhttps://github.com/ycode/ycode/pull/560/files
Reloadhttps://github.com/ycode/ycode/pull/560/files
Reloadhttps://github.com/ycode/ycode/pull/560/files
ycodehttps://github.com/ycode
ycodehttps://github.com/ycode/ycode
Codehttps://github.com/ycode/ycode
Issues7 (7)https://github.com/ycode/ycode/issues
Pull requests1 (1)https://github.com/ycode/ycode/pulls
Discussionshttps://github.com/ycode/ycode/discussions
Actionshttps://github.com/ycode/ycode/actions
Projectshttps://github.com/ycode/ycode/projects
Security and quality1 (1)https://github.com/ycode/ycode/security
Insightshttps://github.com/ycode/ycode/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fycode%2Fycode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fycode%2Fycode%2Fissues%2Fnew%2Fchoose
ysamcodehttps://github.com/ysamcode
develophttps://github.com/ycode/ycode/tree/develop
feat/preload-lcp-google-fonthttps://github.com/ycode/ycode/tree/feat/preload-lcp-google-font
Conversation 0 https://github.com/ycode/ycode/pull/560
Commits 1 https://github.com/ycode/ycode/pull/560/commits
Checks 0 https://github.com/ycode/ycode/pull/560/checks
Files changed https://github.com/ycode/ycode/pull/560/files
Please reload this pagehttps://github.com/ycode/ycode/pull/560/files
feat: preload the heading font on published pages https://github.com/ycode/ycode/pull/560/files#top
Show all changes 1 commit https://github.com/ycode/ycode/pull/560/files
42f8691 feat: preload the Google Font file behind the LCP heading ysamcode Sep 17, 2026 https://github.com/ycode/ycode/pull/560/commits/42f869195043bf479dcdb8bc2e39271102703291
Clear filters https://github.com/ycode/ycode/pull/560/files
Please reload this pagehttps://github.com/ycode/ycode/pull/560/files
Please reload this pagehttps://github.com/ycode/ycode/pull/560/files
PageRenderer.tsx https://github.com/ycode/ycode/pull/560/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
document.ts https://github.com/ycode/ycode/pull/560/files#diff-0bcbcbe7801b0e38ffba7132985c78f9025d675f44dda5695564d4a973541c62
engine.ts https://github.com/ycode/ycode/pull/560/files#diff-980c1ab9eab6420e969a08f73414ba357c47475446e706d15d6e26b2bc59333c
resolver.ts https://github.com/ycode/ycode/pull/560/files#diff-e67ab945efadda5454a3930dae5c1ddee399223b5962a9f375277ac6fb10dd7c
font-preload.test.ts https://github.com/ycode/ycode/pull/560/files#diff-75a3ce65055fa654f201a12ea22bd500156d319abdee329154b79bdf743aa7fb
font-preload.ts https://github.com/ycode/ycode/pull/560/files#diff-d7f4f1aee621aa7c2d5a1f69c98ca9eab613cbaa7ddf77d42c888bd8ea846aa5
package.json https://github.com/ycode/ycode/pull/560/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
components/PageRenderer.tsxhttps://github.com/ycode/ycode/pull/560/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
View file https://github.com/ycode/ycode/blob/42f869195043bf479dcdb8bc2e39271102703291/components/PageRenderer.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/560/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/560/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/560/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/560/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/560/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/560/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/560/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/apps/static-export/document.tshttps://github.com/ycode/ycode/pull/560/files#diff-0bcbcbe7801b0e38ffba7132985c78f9025d675f44dda5695564d4a973541c62
View file https://github.com/ycode/ycode/blob/42f869195043bf479dcdb8bc2e39271102703291/lib/apps/static-export/document.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/560/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/560/files#diff-0bcbcbe7801b0e38ffba7132985c78f9025d675f44dda5695564d4a973541c62
https://github.com/ycode/ycode/pull/560/files#diff-0bcbcbe7801b0e38ffba7132985c78f9025d675f44dda5695564d4a973541c62
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/apps/static-export/engine.tshttps://github.com/ycode/ycode/pull/560/files#diff-980c1ab9eab6420e969a08f73414ba357c47475446e706d15d6e26b2bc59333c
View file https://github.com/ycode/ycode/blob/42f869195043bf479dcdb8bc2e39271102703291/lib/apps/static-export/engine.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/560/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/560/files#diff-980c1ab9eab6420e969a08f73414ba357c47475446e706d15d6e26b2bc59333c
https://github.com/ycode/ycode/pull/560/files#diff-980c1ab9eab6420e969a08f73414ba357c47475446e706d15d6e26b2bc59333c
https://github.com/ycode/ycode/pull/560/files#diff-980c1ab9eab6420e969a08f73414ba357c47475446e706d15d6e26b2bc59333c
https://github.com/ycode/ycode/pull/560/files#diff-980c1ab9eab6420e969a08f73414ba357c47475446e706d15d6e26b2bc59333c
https://github.com/ycode/ycode/pull/560/files#diff-980c1ab9eab6420e969a08f73414ba357c47475446e706d15d6e26b2bc59333c
https://github.com/ycode/ycode/pull/560/files#diff-980c1ab9eab6420e969a08f73414ba357c47475446e706d15d6e26b2bc59333c
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/apps/static-export/resolver.tshttps://github.com/ycode/ycode/pull/560/files#diff-e67ab945efadda5454a3930dae5c1ddee399223b5962a9f375277ac6fb10dd7c
View file https://github.com/ycode/ycode/blob/42f869195043bf479dcdb8bc2e39271102703291/lib/apps/static-export/resolver.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/560/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/560/files#diff-e67ab945efadda5454a3930dae5c1ddee399223b5962a9f375277ac6fb10dd7c
https://github.com/ycode/ycode/pull/560/files#diff-e67ab945efadda5454a3930dae5c1ddee399223b5962a9f375277ac6fb10dd7c
https://github.com/ycode/ycode/pull/560/files#diff-e67ab945efadda5454a3930dae5c1ddee399223b5962a9f375277ac6fb10dd7c
https://github.com/ycode/ycode/pull/560/files#diff-e67ab945efadda5454a3930dae5c1ddee399223b5962a9f375277ac6fb10dd7c
https://github.com/ycode/ycode/pull/560/files#diff-e67ab945efadda5454a3930dae5c1ddee399223b5962a9f375277ac6fb10dd7c
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/font-preload.test.tshttps://github.com/ycode/ycode/pull/560/files#diff-75a3ce65055fa654f201a12ea22bd500156d319abdee329154b79bdf743aa7fb
View file https://github.com/ycode/ycode/blob/42f869195043bf479dcdb8bc2e39271102703291/lib/font-preload.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/560/{{ revealButtonHref }}
Please reload this pagehttps://github.com/ycode/ycode/pull/560/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.