perf(ratewise): 幣別頁 SEO 文案移出首屏 app chunk(#647) - #677
Merged
s123104 merged 1 commit intoJul 7, 2026
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
Author
|
PM 覆核:255KB ratchet 預算核可——135KB 在 vendor 靜態基底(~155KB)下不可達,實測+1.5% 棘輪+下修路徑(vendor-motion −37KB 候選)屬證據驅動的正確重裁。core.ts 細拆的 lastmod regex 錨點風險認可為後續 debt。待審查通過後收棒。 |
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
- 首屏靜態鏈四模組(routes/SEOHelmet/AppLayout/HomepageSEOSection)改直接 import seo-metadata/core,barrel 留給 lazy 頁面維持單一 import 路徑 - currency-landing 與 personas 落入 34 幣別頁共享 lazy chunk(59.7KB raw), 初始 JS brotli 267.0KB → 251.1KB、app chunk 106.2KB → 90.3KB(-15.9KB) - 守門三層:靜態掃描禁首屏模組 runtime import barrel(含 @app/ratewise alias 形態)、manifest 閉包禁 seo-metadata/currency-landing/personas chunk 進 entry、brotli 預算 ratchet 兜底 inline 回歸形態 - bundle 預算依實測重裁 135KB → 255KB ratchet(vendor 靜態基底 147KB+, 135KB 已不現實,PM 覆核佐證見 PR) - SSG 254 頁輸出 hash 正規化後零 diff;LH mobile 前後中位數 87 vs 89 無回退 測試:pnpm --filter @app/ratewise exec vitest run 9226 綠;typecheck 過; test:perf:bundle 過(含紅測驗證:barrel 回歸時靜態掃描與預算斷言雙雙轉紅); SSG A/B 對照零 diff;LH mobile 3 次中位數對照 Co-authored-by: Cursor <cursoragent@cursor.com>
s123104
force-pushed
the
fix/647-seo-metadata-split
branch
from
July 7, 2026 15:14
c46d9f1 to
8ff09f3
Compare
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
This was referenced Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #647
摘要
currency-landing.ts30KB+currency-personas.ts53KB source)自首屏 app chunk 移出,改為隨幣別/內容頁 lazy chunk 載入。根因與拆分策略
進入路徑:首屏靜態鏈四模組(
routes.tsx、SEOHelmet.tsx、AppLayout.tsx、HomepageSEOSection.tsx)從 barrelconfig/seo-metadataimport 首頁需要的HOMEPAGE_SEO/SITE_SEO/builders;barrel 的export * from './currency-landing'使 currency-landing+personas 進入 entry 靜態圖,被 rolldown 併入 app chunk(以 personas 專屬字串在 chunk 內證實)。採用「首屏輕量模組」策略:四個首屏模組改直接 import
seo-metadata/core;barrel 留給 lazy 頁面與測試(維持單一 import 路徑不動 34 頁)。幣別文案自然落入 34 頁共享 lazy chunk(seo-metadata-*.js,59.7KB raw),manifest 證實僅被 lazy pages import。新增seo-metadata-first-screen-imports.test.ts守門防 barrel 回歸。未採用方案:
manualChunks隔離:仍在初始靜態圖內,預算與下載量皆無改善(下策)。core.ts再拆(FAQ/About/Guide 等頁文案 ~45KB source 仍留首屏):會破壞seo-lastmod-policy.ts的 regex 區段錨點與generate-markdown-mirrors.mjs的來源擷取,且檔案搬移使 sitemap lastmod 漂移(假新鮮度信號),違反 SSG 零變化紅線——列為後續 debt 候選,需連動 lastmod policy 一起設計。Chunk 組成前後表(brotli bytes,manifest 靜態 import 圖)
新增 lazy chunk:
seo-metadata-*.js(59,686 raw),僅由 34 幣別頁與內容頁(About/FAQ/Guide 等 lazy route)import。預算重裁證據(135KB → 255KB,請 PM 覆核)
LH mobile 前後對照(vite preview @4173、3 次取中位數)
perf 不回退(#646 門檻 ≥85 之上);單機量測差異在雜訊範圍內,主增益體現在首屏下載字節而非本機 LH 分數。LH JSON:
/tmp/lh-base-*.json、/tmp/lh-after-*.json。紅線驗證
RATEWISE_BUILD_TIMEA/B 建置,254 頁index.html在 asset hash 與__VITE_REACT_SSG_HASH__正規化後 0 diff(head/JSON-LD/內文全部一致)。/usd-twd/直開、首頁→幣別頁 SPA 導航,console error=0(僅 localhost preview 已知 manifest scope 警告 ×2)。seo-ssot/seo-copy-guard含於全套 vitest 9226 passed | 2 skipped。test:perf:bundle2 passed(modulepreload 斷言+255KB 預算)。變更檔案
routes.tsx、SEOHelmet.tsx、AppLayout.tsx、HomepageSEOSection.tsx:barrel →seo-metadata/core直接 importconfig/seo-metadata/index.ts:barrel 契約註解更新performance/__tests__/seo-metadata-first-screen-imports.test.ts:新增首屏 import 守門performance/__tests__/homepage-modulepreload.test.ts:預算 135KB → 255KB(附重裁理由註解)Made with Cursor