perf(web): improve lighthouse performance score#20
Conversation
📝 WalkthroughWalkthroughRemoved Google Fonts links from index.html, added three local ChangesFont Loading Modernization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying koutyuke-dev with
|
| Latest commit: |
a0cfc1b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c195a4ea.koutyuke-dev.pages.dev |
| Branch Preview URL: | https://9-perf-improve-lighthouse-pe.koutyuke-dev.pages.dev |
0eeb6c4 to
5286bb9
Compare
🗼 Lighthouse Preview Report 🗼
Analyze Report
Detailed Report |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AGENTS.md`:
- Line 80: Replace the grammatically incorrect phrase "git追跡外になっていないの一時成果物"
found in AGENTS.md with a clear expression; locate that exact string and change
it to either "git追跡外の一時成果物" (preferred) or "git追跡外になっている一時成果物" depending on
intended meaning so the sentence reads correctly (e.g., "Codex が生成した
git追跡外の一時成果物(`.tmp/`, `result`)は、検証後に不要なら削除する。").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8cf76952-c9ad-4370-a25d-a7c686287acf
⛔ Files ignored due to path filters (4)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlsrc/shared/assets/fonts/Caveat-Regular.woff2is excluded by!**/*.woff2src/shared/assets/fonts/ZenMaruGothic-Medium.woff2is excluded by!**/*.woff2src/shared/assets/fonts/ZenMaruGothic-Regular.woff2is excluded by!**/*.woff2
📒 Files selected for processing (5)
AGENTS.mdindex.htmlpackage.jsonsrc/app/styles/global.cssvite.config.ts
💤 Files with no reviewable changes (1)
- index.html
🚧 Files skipped from review as they are similar to previous changes (2)
- package.json
- vite.config.ts
d363c68 to
a0cfc1b
Compare
Summary
Lighthouse の mobile Performance score を改善するため、Google Fonts の外部読み込みをやめ、ローカル font asset を build 時に subset 化する構成へ変更しました。
Background
Mobile Lighthouse で font の読み込みが初期表示の大きなボトルネックになっていました。font を無効化すると score が大きく改善したため、font payload と critical request chain の削減を主目的にしています。
Closes #9
Change Details
preconnect/ stylesheet 読み込みを削除rollup-plugin-font-subsetterを導入し、build 時に.woff2を使用文字に基づいて subset 化@font-faceを local bundled asset 参照へ変更index.htmlとsrc/**/*.ts(x)に限定し、不要 utility の混入を抑制AGENTS.mdに追記Result
Build output の subset 後 font はおおむね 42-46 KiB まで縮小しています。
Impact Area
Testing
node_modules/.bin/vp buildnode_modules/.bin/vp checknode_modules/.bin/vp previewbunx --bun lighthouse http://127.0.0.1:4173/ --output=json --output=html --output-path=.koutyuke/lighthouse-score/mobile-tailwind-source --chrome-flags="--headless=new --no-sandbox --disable-gpu" --quietNotes
rollup-plugin-font-subsetterはまだ小規模な package のため、今後 dynamic text が増える場合は subset 漏れに注意が必要です。