Skip to content

fix(client): self-host fonts and drop the Replit banner script - #244

Merged
ttbombadil merged 2 commits into
mainfrom
fix/self-host-fonts
Oct 12, 2026
Merged

ttbombadil merged 2 commits into
mainfrom
fix/self-host-fonts

Conversation

@ttbombadil

Copy link
Copy Markdown
Collaborator

Problem

e2e/arduino-board-header.spec.ts:75 failed intermittently: page.goto('/') waited 60 s for the load event, the server logged no request at all, and the screenshot showed an empty page. Cause: client/index.html loaded a render-blocking Google Fonts stylesheet (~25 families) and a synchronous https://replit.com/public/js/replit-dev-banner.js; index.css imported a second Google Fonts stylesheet. Whenever one of these hosts answered slowly, the page stayed blank. The same happens to real users behind filtered school networks, and loading Google Fonts directly is also a privacy concern.

Fix

  • Remove the leftover Replit banner script.
  • Ship the only two fonts in use, Inter and JetBrains Mono, with the bundle via @fontsource-variable/inter and @fontsource-variable/jetbrains-mono (5.3.0, pinned). Font stacks now start with the variable families and keep the previous fallbacks.
  • The start page no longer requests anything from third-party hosts.

New regression test e2e/self-contained-page-load.spec.ts fails when the start page requests a third-party host (RED with the old client: 9 requests to Google Fonts/Replit; GREEN now).

Not included

The CSP in server/index.ts still allows replit.com and the Google Fonts hosts. Tightening it requires changing the existing assertion in tests/server/dev-entrypoint.test.ts, so it is left for a follow-up after owner approval.

Test plan

  • ./run-tests.sh – all 11 stages green; E2E 28/28 without retries (incl. visual snapshot), E2E time 4.5 min → 1.6 min
  • Built client contains 12 .woff2 files (312 KB) and no reference to fonts.googleapis.com, fonts.gstatic.com or replit.com

🤖 Generated with Claude Code

ttbombadil and others added 2 commits October 12, 2026 08:51
The start page blocked on a Google Fonts stylesheet and a synchronous
replit.com script; when either host was slow, page load hung and the page
stayed blank (flaky arduino-board-header E2E, filtered school networks).
Inter and JetBrains Mono now ship with the bundle via @fontsource-variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Taken from the CI runner (identical on attempt and retry); only the
JetBrains Mono glyphs differ, layout is unchanged. Approved by the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ttbombadil
ttbombadil merged commit 312f9ec into main Oct 12, 2026
6 checks passed
@ttbombadil
ttbombadil deleted the fix/self-host-fonts branch October 12, 2026 08:43
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.

1 participant