Repository navigation
perf(build): 预生成 .gz + graph-vendor 分包修复 + cluster_map papers_per_cluster + KaTeX CSS 异步 - #41
Merged
Merged
Conversation
…ster + KaTeX CSS 异步 PR1 — 传输/构建优化 vite.config.ts: - 装 vite-plugin-compression 预生成 .gz,让 nginx gzip_static on 生效(此前失效回退实时压缩,每请求 +50-100ms) - manualChunks 删死规则 @nivo/three;补全 graph-vendor 依赖链(react-force-graph-2d/react-kapsule/kapsule/canvas-color-tracker/accessor-fn/index-array-by/bezier-js/float-tooltip/@tweenjs/d3),修此前 force-graph 子串不匹配 react-force-graph-2d 导致图谱代码散落到默认 chunk 无法跨页缓存 - 加 experimentalMinChunkSize: 40960 合并 <40KB 碎 chunk(此前 9 个 <2KB 碎 chunk ~9 次额外 RTT) - chunkSizeWarningLimit 600→400 暴露大 chunk 告警 cluster_map 加 papers_per_cluster 参数(消除 10× over-fetch): - similarity.py cluster_map 签名加 papers_per_cluster=5,[:50] 改 [:papers_per_cluster] - graph.py cluster_map 端点加 Query(default=5,ge=1,le=50),拼进 cache_key + 传入 - facade.py 转发加参数 - api.ts clusterMap(nClusters,limit,papersPerCluster=5) 拼 &papers_per_cluster= - 效果:单次 payload 从 12簇×50篇 降到 12簇×5篇,省 ~90% 篇论文 id/title/title_zh 传输 index.html: - KaTeX CSS 改异步加载(media=print + onload=this.media=all),非公式页首屏不再阻塞等跨域 CSS(~5KB gzip + 100-300ms RTT) - 加 noscript 兜底 package.json: - 移除冗余 @types/dompurify(dompurify 3.x 自带类型,误置 dependencies)
🔍 OpenCode PR Review Required这是一个受保护的分支,merge 前需要进行 code review。 请运行以下命令进行 OpenCode review: 或者在 PR 页面评论 This is an automated reminder from PR Review Gate. |
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.
PR1 — 传输/构建优化(低风险高收益)
vite.config.ts
cluster_map 加 papers_per_cluster(消除 10× over-fetch)
index.html
package.json
验证