Repository navigation
fix(perf): cut client bundle, image and prefetch weight / 减少客户端代码、图片与预取体积 - #1550
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 28, 2026
Merged
adibarra
force-pushed
the
feat/isr-programmatic-pages
branch
from
October 29, 2026 02:06
e5360b6 to
06a3d3f
Compare
adibarra
force-pushed
the
fix/client-bundle-weight
branch
from
October 29, 2026 02:06
eff686b to
c090b03
Compare
adibarra
force-pushed
the
feat/isr-programmatic-pages
branch
from
October 29, 2026 05:54
93468d9 to
ce85fca
Compare
adibarra
force-pushed
the
fix/client-bundle-weight
branch
from
October 29, 2026 05:54
c090b03 to
aade255
Compare
adibarra
force-pushed
the
fix/client-bundle-weight
branch
from
October 29, 2026 06:03
aade255 to
4023e11
Compare
adibarra
force-pushed
the
fix/client-bundle-weight
branch
from
October 29, 2026 06:15
4023e11 to
96b2e47
Compare
HardwareChart and the off-by-default chart views (table, GPU over time, power timeline, PowerX panels) load on first use. MDX figures render through next/image at sizes recorded in figure-dimensions.json, written by a new generator script, and the image optimizer serves WebP with a one-day minimum TTL. Header, footer and tab links prefetch on intent. The GitHub star count is fetched by the browser, so the root layout no longer awaits it, and the duplicate SVG preload is gone. The proxy runs only on paths that need it, public files get daily Cache-Control, and the unused Vercel cron is removed. The landing hero renders outside Reveal, and nudges gain an idle trigger. The ubenchX nav link targets /ubenchx/mem-bw, which /ubenchx now redirects to. 中文:HardwareChart 与默认关闭的图表视图(表格、GPU 时间序列、功耗时间线、 PowerX 面板)改为首次使用时加载。MDX 配图通过 next/image 按 figure-dimensions.json 记录的尺寸渲染,该文件由新脚本生成,图片优化器输出 WebP,最短缓存一天。页头、页脚与标签页链接按意图预取。GitHub star 数改由 浏览器获取,根布局不再等待该请求,并移除重复的 SVG 预加载。proxy 只在需要的 路径上运行,public 文件使用按天缓存的 Cache-Control,并移除未使用的 Vercel cron。首页主视觉不再包在 Reveal 中,nudge 新增 idle 触发方式。ubenchX 导航 指向 /ubenchx/mem-bw,/ubenchx 重定向到该页。
adibarra
force-pushed
the
fix/client-bundle-weight
branch
from
October 29, 2026 06:19
96b2e47 to
5e40569
Compare
This branch was successfully deployed
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.
Summary
Part 6 of the stack split from #1530. Review and merge in order. CI only runs on PRs that target
master, so each layer was verified locally; the combined change passed full CI on #1530.Stack (merge in order):
Blog posts shipped the whole dashboard bundle (+355 KB br) and served 222 MB of raw PNGs. Nav links prefetched dynamic routes. The root layout awaited a GitHub fetch that made every static page regenerate hourly.
HardwareChartloads lazily. MDX figures render throughnext/imagewith dimensions fromfigure-dimensions.json(regenerate withbun run blog:figure-dimensions). Optimized images are WebP with a one-dayminimumCacheTTL.IntentPrefetchLink, which prefetches on hover or focus instead of on viewport entry.proxy.tsgets aconfig.matcher, public assets get cache headers, and the dead/api/croncron is removed.ChartDisplayviews load lazily. The landing hero renders without waiting for hydration, and the launch modal opens on idle./ubenchx/mem-bw, and/ubenchxbecomes a redirect.The decorative background can still be the desktop LCP element, and typography and KaTeX CSS are not scoped yet; both carry visual risk.
Validation details
Targeted Cypress (Chrome): blog 17/17, landing-performance 5/5, ubenchx 20/20, header component 26/26. On a Vercel preview of the combined change, a blog post loaded 15 Next chunks against 45 on dashboard pages. Lint, format, typecheck and the full unit suite pass on this layer.
AI model disclosure
anthropic/claude-opus-5-5(runtime-exposed identifier for the coordinating agent).PR checklist
inferencex-skillschanges (no filters or views change)/zhsiblingdocs/chinese-copy.md(Chinese maintainer review pending)中文
本 PR 为从 #1530 拆分的 stack 中的第 6 部分,请按顺序审核与合并。CI 只在以
master为目标的 PR 上运行,因此每一层都在本地验证;整体改动已在 #1530 上通过完整 CI。博客文章此前会加载整个 dashboard 代码(+355 KB br)并输出共 222 MB 的原始 PNG;导航链接会预取动态路由;根布局等待 GitHub 请求,导致所有静态页每小时重新生成。
HardwareChart改为懒加载;MDX 图片改用next/image,尺寸来自figure-dimensions.json(用bun run blog:figure-dimensions重新生成);优化后的图片为 WebP,minimumCacheTTL为一天。IntentPrefetchLink,改为悬停或聚焦时预取,不再在进入视口时预取。proxy.ts增加config.matcher,公共静态资源设置缓存头,并移除失效的/api/cron定时任务。ChartDisplay中默认隐藏的视图改为懒加载;首页首屏不再等待水合,发布弹窗改为空闲时打开。/ubenchx/mem-bw,/ubenchx改为跳转。装饰性背景仍可能是桌面端 LCP 元素,typography 与 KaTeX 样式尚未按路由拆分,两者都有视觉风险。
验证:定向 Cypress(Chrome):blog 17/17、landing-performance 5/5、ubenchx 20/20、header 组件 26/26。在整体改动的 Vercel preview 上,博客文章加载 15 个 Next 代码块,dashboard 页面为 45 个。本层的 lint、格式、类型检查与完整单元测试均通过。
AI 模型使用说明:协调 agent 使用
anthropic/claude-opus-5-5(运行环境提供的标识),负责审计、规划与整合改动、拆分 stack 以及撰写提交与 PR 文本;委派的子 agent 在同一环境中实现各部分、构建 stack 并运行验证,其确切模型标识无法获取,因此无法确认。Note
Medium Risk
Broad performance refactors across blog rendering, root layout, middleware matching, and lazy-loaded dashboard views; wrong matcher or missing figure dimensions could break images or redirects, but no auth or data-path changes.
Overview
This PR reduces what every page loads: blog and dashboard UI are split and deferred, images go through the optimizer, and nav no longer prefetches heavy routes until the user shows intent.
Blog and MDX.
<Figure>images with entries infigure-dimensions.jsonrender vianext/image(WebP, responsivesrcset, fixed dimensions, eager/high priority only for the first figure). A newblog:figure-dimensionsscript and manifest keep sizes in sync; tests fail if a figure is missing.HardwareChartis dynamically imported so posts that do not use it skip the dashboard bundle. Themed figures pick up optimizersrcSetin pre-hydration bootstrap.Navigation and layout. Header, footer, and dashboard tab links use
IntentPrefetchLink(prefetch on hover/focus/touch, not in-viewport). GitHub star counts move from a blocking server fetch in the root layout to a client hook with localStorage TTL and failure backoff; the high-priority decorative SVG preload is removed. The root layout is synchronous again.Dashboard and landing. Off-by-default
ChartDisplayviews (table, GPU-over-time, power timeline, PowerX panels) load withnext/dynamic. The landing hero and intro render withoutRevealdelay wrappers; the TPUv7 launch modal trigger switches from immediate to idle after load.Routing and caching.
/ubenchxredirects to/ubenchx/mem-bw(nav links updated; standalone redirect pages removed).next.configadds one-day cache headers for public assets, WebP-only optimized images, and documents proxy scope.proxy.tsgets an explicitconfig.matcherso middleware runs only on API routes, embeds, legacy inference query redirects, and compare canonicalization—not static pages or RSC compare navigations. The unused Vercel/api/cronjob is dropped.Docs, Cypress, and unit tests are updated for optimizer URLs, ubenchX hrefs, and the new figure workflow.
Reviewed by Cursor Bugbot for commit 5e40569. Bugbot is set up for automated code reviews on this repo. Configure here.