ecs-persistence: export the Matching type of spawn's match option
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- data
調査の方向性
ecs-persistence のパッケージエントリポイント index.ts にエクスポートがありません。Matching は src/match/match.ts で定義されているため、そこに export type { Matching } を追加し、利用側から import できることを確認してください。後半では、カバーされていないコンポーネントを指定したインデックスのエラーに、コンポーネント名とインデックス名を含めることを求めています。spawn の match オプションが「names a component the snapshot's trait doesn't cover」エラーを発生させている箇所を見つけてください。型が import でき、エラーメッセージにコンポーネントとインデックスの両方の名前が含まれていれば完了です。
索引モデルが 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時間 36分
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
adobe/data のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
remotion-dev/remotion#12905 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
supermomonga/paseo-plugin-zcode-provider#83 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
oxidecomputer/skepsis#102 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
voidzero-dev/void#677 ·
メンテナーはふだん 1 日以内に返信