ecs-persistence: export the Matching type of spawn's match option
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- data
调研方向
ecs-persistence 的包入口 index.ts 缺少该导出;Matching 定义在 src/match/match.ts 中,因此请在那里添加 export type { Matching },并检查使用方能否导入它。第二部分要求,当索引指定了未被覆盖的组件时,错误信息需要报告组件名和索引名;请找到 spawn 的 match 选项在哪里抛出“names a component the snapshot's trait doesn't cover”错误。当该类型可以被导入,且错误信息同时包含组件名和索引名时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Summary
@adobe/ecs-persistence's spawn takes match?: readonly Matching[], but Matching isn't exported from the package, so an application that forwards a match argument (a restore function that takes the indexes to match by) has to spell the type out as Index<{ readonly unique: true }>, which is what Matching is defined as in src/match/match.ts.
Where this came from (mecs)
loadTab(world, bytes, match?) and restoreTab(world, match?) pass the indexes through to spawn({ world, snapshot, match, update: true, entities: false }) (the #249 feature, which works well: the camera is made at startup and the saved place and look update it by name). I wanted the parameter typed readonly Matching[], imported from @adobe/ecs-persistence, so that the application's types follow the package's if its definition changes; it isn't exported, so I wrote readonly Index<{ readonly unique: true }>[] instead.
What I need
export type { Matching } from "./match/match.js" in ecs-persistence's index.ts.
A related gap in the same feature
match fails for an index whose key, with or not names a component the snapshot's trait doesn't cover. In mecs the natural index of a camera by name, Index.create({ key: [cameraName], unique: true, components: { with: CameraView } }), where CameraView includes View.target, View.projection and others that aren't part of the saved state, had to be reduced to with: [cameraName]. That is fine here (the failure is clear: "…names a component the snapshot's trait doesn't cover"), but the error could say which component and which index, since the usual fix is narrowing the index's with.
- 主要语言
- TypeScript
- 星标
- 12
- 派生
- 8
- 平均合并
- 11 小时 2 分钟
- 30 天内合并 PR
- 23
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
adobe/data 的其他 Issue
-
ecs: let kernels issue commands through helpers (component lists, symbol-keyed values, void helpers)未关闭
难度 5/5 一周以上 新手友好度 15/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 1 天内回复
-
ecs: an architecture standard (layout, naming, exports, checker, diagrams) for the new ECS samples, and how to distribute it可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 8/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 22/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 15/100
维护者通常 1 天内回复
相似的 Issue
-
test: claim-conflict drop leaves both facts active and is never re-proposed (untested review cell)未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
[Feature]: Usage page should show API-equivalent cost and say when a connected plan shows info only未关闭enhancement from-x
难度 2/5 1-3 小时 新手友好度 66/100
nightly-labs/openbot#4867 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
egonSchiele/agency-lang#1377 ·
维护者通常 1 天内回复
-
normalizePath removes the Windows device namespace prefix可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
caprover/caprover-frontend#273 ·
维护者通常 1 天内回复