perf: preload the hero font so it arrives before the text it sets #23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/preload-hero-font"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The homepage hero is set in Fraunces, but nothing asks for the font until the
Homechunk mounts — so it starts downloading at ~2.1s and lands at ~4.6s, asecond after the hero has painted in a fallback serif and reflowed.
A
transformIndexHtmlplugin emits a<link rel="preload">for it, resolvingthe hashed filename from
ctx.bundle. A pattern that matches nothing throws, soa Fontsource rename can't silently drop the preload.
Measured on
perf/homepage-loop.mjs, four runs:The ~130ms of FCP is the real cost — the preload competes with the entry bundle
for bandwidth. It still finishes after FCP, so nothing blocks the first paint.
New
heroFontMsbudget at 2600ms guards the win. Only the upright is preloaded;adding the italic costs the upright 744ms and it sits below the first fold.
tsc, 71 tests,biome ci, both build modes, all five budgets green.