修复 AGC 开发态监听 Rust 构建目录导致的加载缓慢 #382

Merged
suzmii merged 5 commits from fix/agc-vite-target-watch into master 2026-09-17 21:19:00 +08:00
Member

关联 #324。

问题与方案

主因已确认:AGC Vite 默认监听应用根目录,包含 Rust 的 src-tauri/target。构建产物较多时,大量 Windows 文件监听器会阻塞前端首次加载。

server.watch.ignored 中增加 **/src-tauri/target/**,仅排除 Rust 构建目录,不关闭 HMR,不修改业务代码、CSS、共享组件或端口配置。

server: {
  watch: {
    ignored: ['**/src-tauri/target/**'],
  },
}

本次变更

  • 增加 Vite 监听排除规则。
  • 增加真实 watcher 回归,覆盖 target 排除及源码、CSS、共享源码变更通知。
  • 同步开发运维文档和排障记录。

实验结果

真实窗口 A/B 对照确认:

指标 原配置 排除 target 后
首次内容绘制 52.2 秒 7.3 秒
target 监听目录 1,632 0

首绘耗时减少约 86%。两组 CSS 输出完全一致,业务源码和共享组件仍被监听,无需关闭热更新。

验证

  • 本次真实 Vite watcher 小型夹具:target 监听目录 3 → 0;源码、CSS、应用根目录外的共享源码仍能收到变更事件,回归连续 3 次通过。
  • 本地类型、配置、ESLint、格式、编码及 diff 检查通过。
  • CI:待运行。保持 WIP,不合并。

剩余约 7 秒的加载耗时不在本次优化范围内。

关联 #324。 ## 问题与方案 主因已确认:AGC Vite 默认监听应用根目录,包含 Rust 的 `src-tauri/target`。构建产物较多时,大量 Windows 文件监听器会阻塞前端首次加载。 在 `server.watch.ignored` 中增加 `**/src-tauri/target/**`,仅排除 Rust 构建目录,不关闭 HMR,不修改业务代码、CSS、共享组件或端口配置。 ```ts server: { watch: { ignored: ['**/src-tauri/target/**'], }, } ``` ## 本次变更 - 增加 Vite 监听排除规则。 - 增加真实 watcher 回归,覆盖 target 排除及源码、CSS、共享源码变更通知。 - 同步开发运维文档和排障记录。 ## 实验结果 真实窗口 A/B 对照确认: | 指标 | 原配置 | 排除 target 后 | | --- | ---: | ---: | | 首次内容绘制 | 52.2 秒 | **7.3 秒** | | target 监听目录 | 1,632 | **0** | 首绘耗时减少约 **86%**。两组 CSS 输出完全一致,业务源码和共享组件仍被监听,无需关闭热更新。 ## 验证 - 本次真实 Vite watcher 小型夹具:target 监听目录 3 → 0;源码、CSS、应用根目录外的共享源码仍能收到变更事件,回归连续 3 次通过。 - 本地类型、配置、ESLint、格式、编码及 diff 检查通过。 - CI:待运行。保持 WIP,不合并。 剩余约 7 秒的加载耗时不在本次优化范围内。
suzmii added 1 commit 2026-09-16 11:40:35 +08:00
修复 AGC 开发态监听 Rust 构建目录导致的加载缓慢
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m12s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 5m29s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m46s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m43s
Project CI / Backend tests (pull_request) Failing after 11s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 4m38s
Project CI / Repository checks (pull_request) Failing after 10s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m31s
Project CI / AI game creator shell web tests (pull_request) Failing after 4m35s
Project CI / Frontend tests (pull_request) Successful in 6m38s
Project CI / Native shell tests (pull_request) Successful in 8m25s
c0db298449
在 Vite 中排除 src-tauri/target,保留业务源码与共享组件热更新。
增加实际 Vite watcher 回归,验证构建目录排除及源码变更通知。
同步开发运维文档和共享排障记录,关联 Issue #324。
kdletters added this to the 陶泥儿gameAgent project 2026-09-16 12:11:45 +08:00
kdletters moved this to 评估中 in 陶泥儿gameAgent on 2026-09-16 12:12:22 +08:00
suzmii added 1 commit 2026-09-17 18:59:08 +08:00
合并 master 到 AGC 开发监听修复分支
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
260edb3521
同步 master 最新代码与文档。

合并排障记录冲突,保留双方新增内容。
suzmii added 1 commit 2026-09-17 19:06:13 +08:00
Merge branch 'master' into fix/agc-vite-target-watch
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m16s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Failing after 5m37s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 5m11s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m2s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Failing after 4m28s
Project CI / Native shell tests (pull_request) Failing after 1m15s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m20s
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
5adc3032e8
suzmii added 1 commit 2026-09-17 19:30:08 +08:00
Merge branch 'master' into fix/agc-vite-target-watch
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m37s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Failing after 5m39s
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
92d1269ccc
suzmii marked the pull request as ready for review 2026-09-17 19:30:26 +08:00
suzmii added 1 commit 2026-09-17 20:02:16 +08:00
Merge branch 'master' into fix/agc-vite-target-watch
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 7m9s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 7m27s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Failing after 7m30s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Failing after 7m35s
Project CI / Native shell tests (pull_request) Failing after 1m54s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m27s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m45s
Project CI / AI game creator shell web tests (pull_request) Failing after 4m42s
Project CI / Frontend tests (pull_request) Failing after 5m17s
Project CI / Repository checks (pull_request) Successful in 5m13s
Project CI / Backend tests (pull_request) Successful in 8m31s
ed6eced16b
suzmii merged commit 6f161a6b36 into master 2026-09-17 21:19:00 +08:00
suzmii deleted branch fix/agc-vite-target-watch 2026-09-17 21:19:00 +08:00
Sign in to join this conversation.