← Blog
Engineering

Rebuilding a bilingual portfolio for speed, Server Components, and automated proof

How moving case studies into a schema-validated TypeScript registry, keeping client bundles lean, and replacing heavy runtime motion turned reading speed and accessibility into automated checks.

Date
November 21, 2026
Reading time
3 min read
Author
Lewis Dong
Topics
Engineering · Architecture

A portfolio for interaction and design-engineering roles should feel effortless to read and hold up to basic web hygiene. During the V3–V4 evolution of this site, I audited what actually reached the reader's browser and every place where case-study facts drifted apart across files.

The goal was never a visual overhaul—the warm-paper typography and editorial pacing already fit the work. The real goal was eliminating duplicated data, keeping initial page loads responsive, and catching accessibility or broken-link slips before they reach production.

Moving case studies out of client JSON bundles#

Earlier versions stored narrative case-study copy inside global translation dictionaries (en.json and zh.json). Because NextIntlClientProvider serialized the whole object into HTML, visiting the home page meant downloading bilingual essays for every project just to render the top bar.

Consolidating all case records into typed src/data/cases/*.ts modules validated with Zod reversed that weight right away: client bundles now receive only interactive interface labels (nav, contact, resume, search), cutting translation payloads sharply while keeping project slugs, media paths, and DesignDecisionTradeoff matrices checked automatically.

Stopping client boundary creep and enforcing CSS budgets#

Even after slimming dictionaries, build inspection flagged /projects as heavier than other routes because WorkIndex sat behind a "use client" boundary—pulling interactive thumbnails, summaries, and helpers into client JavaScript just to power a filter bar.

Lifting those presentational blocks back into the Server Component (app/[locale]/projects/page.tsx) and passing rendered slots left only the lightweight tab toggle on the client, which kept the /projects route script small. I have not re-measured that route for this post; the standing guard is pnpm budget:check, which fails the build if any app route chunk passes 22 kB gz. Engineering notePassing pre-rendered server ReactNode trees as props into a small client wrapper keeps heavy SVG/media helpers off the browser bundle.

When we later added the dedicated AI Lab with telemetry inspectors and structured 4-part cards, new layout rules went into a route-scoped CSS Module (ai-workbench.module.css) rather than swelling global primitives.css. The budget check caps authored app CSS at 68 kB gz and all CSS at 98 kB gz.

| Architectural Gate | What Fails Without It | Automated Check Enforced | | --- | --- | --- | | Zod case-study registry | EN/ZH drift, missing honest limits, broken media refs | tests/lib/case-registry.test.ts | | RSC Server-Client split | Entire essays & UI Chrome hydrated in client JS | Next.js build budget inspector | | Route-scoped CSS Modules | Dedicated lab widgets bloat every portfolio page | pnpm budget:check (app CSS <= 68 kB gz) | | 3-viewport accessibility scan | Dark-mode #141413 contrast or 375px horizontal overflow | e2e/a11y.spec.ts + @axe-core/playwright |

Lighter assets, calmer motion, and continuous verification#

Three practical habits closed the loop:

  1. Media discipline (pnpm media:check): Compressing screenshots and generating vector architecture SVGs kept the archive snappy without degrading legibility.
  2. Restrained GSAP motion: Centralizing subtle reveals with useGsapContext cleanup and prefers-reduced-motion support makes transitions settle immediately when motion is reduced.
  3. Live Lab & AI Grounding: All six public cases now connect directly into the Interaction Lab and the AI Lab, where reviewers can question the tradeoffs against the case records.
Share:

Related Articles

Rebuilding a bilingual portfolio for speed, Server Components, and automated proof | Lewis Dong