refactor(core): split typed_api.rs and move its inline tests out
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
Start with aimdb-core/src/typed_api.rs and its inline tests, then inspect aimdb-core/src/typed_record.rs and aimdb-core/src/session/client.rs to understand the module conventions and feature gates. Split the typed API concerns into the suggested modules, preserve public paths, and reorganize the tests around shared mocks; assess whether typed_record's gated blocks can use internal helpers. Done when the files are easier to navigate and the refactor introduces no behavior change.
由索引模型根据 Issue 内容生成。
描述
Problem
A few aimdb-core modules have grown well past the size where they are easy to navigate or review.
aimdb-core/src/typed_api.rs— 3,748 lines. The non-test part (lines 1–1783) holds five separate concerns:Producer<T>(104),Consumer<T>(226),RecordRegistrar(468),OutboundLinkBuilder(917) andInboundLinkBuilder(1241). The remaining ~1,960 lines are one inlinemod testscontaining five hand-written mock trait impls whose methods areunimplemented!("not needed for … tests")(lines 1837, 1861, 2968, 3062, 3261).aimdb-core/src/typed_record.rs— 1,726 lines, 54cfg(feature …)gates, the highest gate density in the workspace, plus four#[allow(unused_mut)](858, 1167, 1203, 1279) that exist only because of those gates.aimdb-core/src/session/client.rs— 1,685 lines (tests from line 1013).
Suggested work
- Turn
typed_api.rsinto atyped_api/module:producer.rs,consumer.rs,registrar.rs,link_outbound.rs,link_inbound.rs, re-exported frommod.rsso the public paths do not change. - Move the inline tests into per-concern test modules and share one mock connector/runtime between them instead of five partial mocks.
- For
typed_record.rs, look at whether the gated blocks can be grouped behind a small number of internal helper functions so theunused_mutallows disappear.
No behaviour change intended; purely a move/re-organise refactor.
Notes
Line numbers are from the tree at d9c7be0. Sizes were measured with wc -l; the split points are the first top-level #[cfg(test)] in each file.
- 主要语言
- Rust
- 星标
- 101
- 派生
- 20
- 平均合并
- 2 小时 33 分钟
- 30 天内合并 PR
- 90
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aimdb-dev/aimdb 的其他 Issue
-
🏷️ good first issue enhancement
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
Panic on live viewport resize when unstyled elements exist in display: none subtree可能已有人在做 @GoCoder7 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
DioxusLabs/blitz#1488 ·
维护者通常 1 天内回复
-
S-Needs triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
vectordotdev/vrl#2042 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复