Skip to content

fix(website): bundle fonts for offline builds - #2969

Merged
hidb4ai merged 1 commit into
oceanbase:masterfrom
frf12:codex/website-local-fonts
Dec 3, 2026
Merged

hidb4ai merged 1 commit into
oceanbase:masterfrom
frf12:codex/website-local-fonts

Conversation

@frf12

@frf12 frf12 commented Dec 2, 2026

Copy link
Copy Markdown
Member

Which issue or RFC does this PR close?

Fixes the website build failure observed in #2923 (failed job). Related to the font loading introduced by #2732; no tracking issue is closed.

Rationale for this change

Website builds fetch Google Fonts CSS and font files through next/font/google. The failing build reached Next.js 16.4.1's font URL extension parser and crashed with Cannot read properties of null (reading '1'). The same master had built successfully earlier, so this removes the external response dependency without assuming that the missing failing URL can be reproduced.

What changes are included in this PR?

  • Load Fraunces, IBM Plex Sans and JetBrains Mono with next/font/local, using complete WOFF2 assets converted from a pinned official Google Fonts commit. Include upstream licenses, source and output checksums, and reproducible conversion instructions.
  • Preserve the existing CSS variables, explicit weight selections, normal style, swap behavior and fallback metrics. Keep the complete character sets and variable axes.
  • Add a regression that runs an actual Next.js static export of the site's font configuration with HTTP/fetch requests disabled, then checks that its referenced font files are exported. The original implementation fails this test while fetching all three Google fonts.

Are there any user-facing changes?

The font families and layout styles remain the same. Complete font files preload 514,060 bytes, about 322 KB more than the previous Latin-only preload; this preserves all character coverage without maintaining separate Unicode-range shards. Builds no longer need Google Fonts access. No dependency versions or CI runner settings change.

How was this change tested?

  • make docs-test passed: 40 website tests, production build, and validation of 1,146 exported public pages and their links.
  • POWERCONTEXT_TEST_BLOG_SITE=1 uv run --locked pytest tests/e2e/test_blog_site.py -q — 7 passed.
  • uv run --locked prek run -a and git diff --cached --check passed.
  • Verified lossless font-table preservation apart from documented WOFF2 container fields and empty signature-table removal; checked fallback metrics against the prior Google loader.
  • Browser checks on the exported English and Chinese home pages: all font faces loaded, expected fallback chains present, no horizontal overflow.
  • Local validation used macOS, Node 26.7.0 and pnpm 11.25.0. Linux/Windows execution remains for CI. Next.js emitted an existing security advisory and stopped one local build; the same command completed on retry. This PR does not resolve that dependency advisory.

AI usage statement

Implemented and reviewed with OpenAI Codex assistance, including an independent code review and local validation.

@hidb4ai hidb4ai added module:core Core: PR changes under src/ module:other Other: changes without an applicable Knowledge base, Gateway, Core, Desktop or pc-mate label and removed module:core Core: PR changes under src/ labels Dec 2, 2026

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the local-font change and the documented preload-size tradeoff. The offline font build, full static export, and actual English/Chinese browser font loading passed. No actionable defect found in this change.

@hireview001

Copy link
Copy Markdown
Collaborator

The affected modules are Other. @hidb4ai, please coordinate follow-up. Other: @hidb4ai @PsiACE. Please coordinate the review of the affected changes.

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hidb4ai
hidb4ai merged commit 3e52be8 into oceanbase:master Dec 3, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:other Other: changes without an applicable Knowledge base, Gateway, Core, Desktop or pc-mate label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants