Skip to content

fix(benchmark): keep the landing build and lint passing after a benchmark refresh - #1005

Merged
owjs3901 merged 8 commits into
mainfrom
fix/landing-benchmark-types
Nov 18, 2026
Merged

owjs3901 merged 8 commits into
mainfrom
fix/landing-benchmark-types

Conversation

@owjs3901

@owjs3901 owjs3901 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The first automatic benchmark refreshes (from #985) broke two checks for every PR. This fixes both.

1. Landing build: type error

src/app/benchmark-data.ts(15,14): error TS2322: Type '{ ... clientBytes: null; sizes: null ... }' is not assignable to type '{ ... clientBytes: number; sizes: { ... } ... }'
  • Cause: the refresh rewrote benchmark-results.json in the current format, where clientBytes and sizes are filled in. The frozen e2e fixture still has them null, and benchmark-data.ts typed both files as typeof live.
  • Fix: benchmark-data.ts now declares a BenchmarkResults interface with only the fields Bench.tsx reads. A later refresh that changes other fields can no longer break the build, and rendering is unchanged.

2. bun run lint: Prettier rejects benchmark/history.json

  • Cause: formatJson puts every item of a too-long array on its own line, but Prettier fills arrays of numbers several to a line.
  • Fix: formatJson now fills long number arrays the way Prettier does. Long string arrays stay one per line, as Prettier prints them. history.json is rewritten with the new formatter, including the entry main's latest refresh added.

Verification

  • tsc --noEmit in apps/landing: the benchmark-data.ts error is gone; before this change it is reported.
  • prettier --check benchmark/history.json benchmark-results.json passes, and the formatter's output for a synthetic deep array also passes prettier --check.
  • benchmark-record.test.ts: 27 pass, and benchmark-record.js has 100% coverage. The format test now expects Prettier's fill, and the "checked files are formatted as written" test passes.

요약

첫 자동 벤치마크 갱신(#985) 이후 모든 PR에서 검사 두 개가 깨졌고, 이 PR이 둘 다 고칩니다.

1. 랜딩 빌드 타입 에러

  • 원인: 갱신 봇이 benchmark-results.json을 최신 형식으로 다시 썼고, 이 형식에서는 clientBytes와 sizes에 값이 들어 있습니다. 고정된 e2e fixture는 이 두 필드가 아직 null인데, benchmark-data.ts가 두 파일을 typeof live 하나로 묶고 있었습니다.
  • 수정: Bench.tsx가 실제로 읽는 필드만 담은 BenchmarkResults 인터페이스를 선언했습니다. 앞으로 갱신이 다른 필드를 바꿔도 빌드가 깨지지 않고, 화면 결과는 바뀌지 않습니다.

2. bun run lint: Prettier가 benchmark/history.json을 거부

  • 원인: formatJson은 한 줄에 안 들어가는 배열을 항목마다 한 줄씩 썼습니다. 그런데 Prettier는 숫자 배열을 한 줄에 여러 개씩 채워 씁니다.
  • 수정: formatJson이 긴 숫자 배열을 Prettier와 똑같이 채워 씁니다. 긴 문자열 배열은 Prettier처럼 한 줄에 하나씩 그대로 둡니다. main의 최근 갱신이 추가한 항목까지 포함해 history.json을 새 포매터로 다시 썼습니다.

검증

  • apps/landing에서 tsc --noEmit을 돌리면 benchmark-data.ts 에러가 사라졌습니다. 수정 전에는 이 에러가 나옵니다.
  • prettier --check benchmark/history.json benchmark-results.json이 통과합니다. 깊게 중첩된 배열을 합성해 포매터로 쓴 결과도 prettier --check를 통과합니다.
  • benchmark-record.test.ts는 27개가 통과하고, benchmark-record.js 커버리지는 100%입니다. 포맷 테스트는 이제 Prettier의 채워 쓰기를 기대하고, "체크인된 파일이 포매터 출력과 같은지" 확인하는 테스트도 통과합니다.

🤖 Generated with Claude Code

The first benchmark refresh (db50062) rewrote benchmark-results.json
in the current format, where clientBytes and sizes are filled in, while
the frozen e2e fixture still has them null. benchmark-data.ts typed both
as `typeof live`, so the fixture no longer matched and every landing
build failed type checking. The page now declares only the fields Bench
reads, which both files have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901 and others added 3 commits November 18, 2026 17:52
formatJson put each item of a too-long array on its own line, but
Prettier fills arrays of numbers several to a line. The first refresh
therefore committed a benchmark/history.json that `bun run lint` rejects.
Long number arrays are now filled the same way, and history.json is
rewritten with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@owjs3901 owjs3901 changed the title fix(landing): type the benchmark data by the fields the page reads fix(benchmark): keep the landing build and lint passing after a benchmark refresh Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
benchmark-record.js 100.00% <100.00%> (ø)

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@owjs3901
owjs3901 merged commit 871efc9 into main Nov 18, 2026
28 checks passed
@owjs3901
owjs3901 deleted the fix/landing-benchmark-types branch November 18, 2026 11:40
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