@adobe/data 0.9.81 → 0.9.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ecs/archetype/archetype.d.ts +23 -0
- package/dist/ecs/archetype/archetype.js.map +1 -1
- package/dist/ecs/database/create-plugin.d.ts +2 -1
- package/dist/ecs/database/create-plugin.js.map +1 -1
- package/dist/ecs/database/database-read.type-test.js +25 -0
- package/dist/ecs/database/database-read.type-test.js.map +1 -1
- package/dist/ecs/database/database.d.ts +26 -7
- package/dist/ecs/database/database.js.map +1 -1
- package/dist/ecs/database/database.partition.test.d.ts +1 -0
- package/dist/ecs/database/database.partition.test.js +45 -0
- package/dist/ecs/database/database.partition.test.js.map +1 -0
- package/dist/ecs/database/database.partition.type-test.d.ts +1 -0
- package/dist/ecs/database/database.partition.type-test.js +41 -0
- package/dist/ecs/database/database.partition.type-test.js.map +1 -0
- package/dist/ecs/database/deep-extends-chain.type-test.d.ts +255 -255
- package/dist/ecs/database/index.d.ts +0 -1
- package/dist/ecs/database/index.js +0 -1
- package/dist/ecs/database/index.js.map +1 -1
- package/dist/ecs/database/observe-derive.d.ts +4 -1
- package/dist/ecs/database/observe-derive.js +66 -35
- package/dist/ecs/database/observe-derive.js.map +1 -1
- package/dist/ecs/database/observe-derive.test.js +124 -0
- package/dist/ecs/database/observe-derive.test.js.map +1 -1
- package/dist/ecs/database/observed/observed-database.d.ts +3 -0
- package/dist/ecs/database/transactional-store/transactional-store.d.ts +6 -5
- package/dist/ecs/store/core/core.d.ts +33 -8
- package/dist/ecs/store/core/create-core.d.ts +12 -2
- package/dist/ecs/store/core/create-core.js +141 -22
- package/dist/ecs/store/core/create-core.js.map +1 -1
- package/dist/ecs/store/core/create-core.partition.test.d.ts +1 -0
- package/dist/ecs/store/core/create-core.partition.test.js +229 -0
- package/dist/ecs/store/core/create-core.partition.test.js.map +1 -0
- package/dist/ecs/store/core/select-entities.js +87 -21
- package/dist/ecs/store/core/select-entities.js.map +1 -1
- package/dist/ecs/store/core/select-entities.partition.test.d.ts +1 -0
- package/dist/ecs/store/core/select-entities.partition.test.js +93 -0
- package/dist/ecs/store/core/select-entities.partition.test.js.map +1 -0
- package/dist/ecs/store/entity-select-options.d.ts +5 -1
- package/dist/ecs/store/partition.d.ts +63 -0
- package/dist/ecs/store/partition.js +3 -0
- package/dist/ecs/store/partition.js.map +1 -0
- package/dist/ecs/store/partition.type-test.d.ts +1 -0
- package/dist/ecs/store/partition.type-test.js +15 -0
- package/dist/ecs/store/partition.type-test.js.map +1 -0
- package/dist/ecs/store/public/create-store.d.ts +3 -1
- package/dist/ecs/store/public/create-store.js +19 -50
- package/dist/ecs/store/public/create-store.js.map +1 -1
- package/dist/ecs/store/public/create-store.partition.test.d.ts +1 -0
- package/dist/ecs/store/public/create-store.partition.test.js +111 -0
- package/dist/ecs/store/public/create-store.partition.test.js.map +1 -0
- package/dist/ecs/store/public/create-store.partition.type-test.d.ts +1 -0
- package/dist/ecs/store/public/create-store.partition.type-test.js +61 -0
- package/dist/ecs/store/public/create-store.partition.type-test.js.map +1 -0
- package/dist/ecs/store/store.d.ts +15 -10
- package/dist/ecs/store/store.js.map +1 -1
- package/dist/ecs/store/transaction-functions.d.ts +3 -3
- package/dist/schema/schema.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/references/data-lit/package.json +1 -1
- package/references/data-lit-tictactoe/package.json +1 -1
- package/references/data-react/package.json +1 -1
- package/references/data-react-hello/package.json +1 -1
- package/references/data-react-pixie/package.json +1 -1
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import { selectRows } from "../../../table/select-rows.js";
|
|
3
3
|
import { compare } from "../../../functions/compare.js";
|
|
4
4
|
export const selectEntities = (core, include, options) => {
|
|
5
|
-
|
|
5
|
+
// Pass only archetype-level options (exclude) to queryArchetypes. `options.where`
|
|
6
|
+
// here is a row-level Filter and is applied per-row below via selectRows — it
|
|
7
|
+
// must NOT be forwarded as queryArchetypes' partition-equality `where`.
|
|
8
|
+
const archetypes = core.queryArchetypes(include, options?.exclude ? { exclude: options.exclude } : undefined);
|
|
6
9
|
let length = 0;
|
|
7
10
|
for (const archetype of archetypes) {
|
|
8
11
|
length += archetype.rowCount;
|
|
@@ -30,32 +33,95 @@ export const selectEntities = (core, include, options) => {
|
|
|
30
33
|
}
|
|
31
34
|
return entities;
|
|
32
35
|
}
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
// ── Ordered results ─────────────────────────────────────────────────────
|
|
37
|
+
// When the *leading run* of order keys are partition components, each
|
|
38
|
+
// archetype holds a constant value for them, so the archetypes already
|
|
39
|
+
// bucket the rows on that leading key. We can then sort the buckets by
|
|
40
|
+
// value, sort only the *remaining* keys within each bucket, and concatenate
|
|
41
|
+
// in bucket order — turning an O(N log N) sort into O(N log(N/K)), and O(N)
|
|
42
|
+
// when a partition key is the sole order key. When no leading order key is a
|
|
43
|
+
// partition component (leadCount === 0) this falls back to one full sort,
|
|
44
|
+
// matching the previous behaviour exactly.
|
|
45
|
+
const order = options.order;
|
|
46
|
+
const schemas = core.componentSchemas;
|
|
47
|
+
// Keys of `order` are, by OrderClause<Pick<…, Include>>, exactly the picked
|
|
48
|
+
// component keys — safe to view as Include[].
|
|
49
|
+
const orderKeys = Object.keys(order);
|
|
50
|
+
let leadCount = 0;
|
|
51
|
+
while (leadCount < orderKeys.length && schemas[orderKeys[leadCount]]?.partition === true) {
|
|
52
|
+
leadCount++;
|
|
45
53
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
for (const order in options.order) {
|
|
54
|
+
const compareByKeys = (keys, a, b) => {
|
|
55
|
+
for (const key of keys) {
|
|
49
56
|
// `compare` (code-point for strings, numeric for numbers) — not
|
|
50
57
|
// `a - b`, which is NaN for string order keys, and never locale.
|
|
51
|
-
const cmp = compare(a[
|
|
52
|
-
if (cmp !== 0)
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
const cmp = compare(a[key], b[key]);
|
|
59
|
+
if (cmp !== 0)
|
|
60
|
+
return order[key] ? cmp : -cmp;
|
|
61
|
+
}
|
|
62
|
+
return 0;
|
|
63
|
+
};
|
|
64
|
+
// Gather ids for `archs`, sorted by `sortKeys` (empty → left in archetype +
|
|
65
|
+
// row order). `where` is applied per row. A stable sort over the same gather
|
|
66
|
+
// order keeps tie-ordering identical to the single full sort.
|
|
67
|
+
const collect = (archs, sortKeys) => {
|
|
68
|
+
if (sortKeys.length === 0) {
|
|
69
|
+
const ids = [];
|
|
70
|
+
for (const archetype of archs) {
|
|
71
|
+
const idTypedArray = archetype.columns.id.getTypedArray();
|
|
72
|
+
for (const row of selectRows(archetype, options.where)) {
|
|
73
|
+
ids.push(idTypedArray[row]);
|
|
74
|
+
}
|
|
55
75
|
}
|
|
76
|
+
return ids;
|
|
77
|
+
}
|
|
78
|
+
const rows = [];
|
|
79
|
+
for (const archetype of archs) {
|
|
80
|
+
const idTypedArray = archetype.columns.id.getTypedArray();
|
|
81
|
+
for (const row of selectRows(archetype, options.where)) {
|
|
82
|
+
const value = { id: idTypedArray[row] };
|
|
83
|
+
for (const key of sortKeys)
|
|
84
|
+
value[key] = archetype.columns[key].get(row);
|
|
85
|
+
rows.push(value);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
rows.sort((a, b) => compareByKeys(sortKeys, a, b));
|
|
89
|
+
return rows.map((r) => r.id);
|
|
90
|
+
};
|
|
91
|
+
if (leadCount === 0) {
|
|
92
|
+
return collect(archetypes, orderKeys);
|
|
93
|
+
}
|
|
94
|
+
// Bucket archetypes by their leading partition-value tuple, preserving
|
|
95
|
+
// archetype iteration order within a bucket (so tie-ordering matches the
|
|
96
|
+
// full sort). A bucket can span multiple archetypes (shape fan-out).
|
|
97
|
+
const leadKeys = orderKeys.slice(0, leadCount);
|
|
98
|
+
const restKeys = orderKeys.slice(leadCount);
|
|
99
|
+
const buckets = new Map();
|
|
100
|
+
for (const archetype of archetypes) {
|
|
101
|
+
const values = leadKeys.map((key) => archetype.columns[key].get(0));
|
|
102
|
+
// JSON is an unambiguous key for a primitive tuple: it distinguishes
|
|
103
|
+
// 1 from "1" and never collides across tuple boundaries.
|
|
104
|
+
const bucketKey = JSON.stringify(values);
|
|
105
|
+
let bucket = buckets.get(bucketKey);
|
|
106
|
+
if (!bucket) {
|
|
107
|
+
bucket = { values, archs: [] };
|
|
108
|
+
buckets.set(bucketKey, bucket);
|
|
109
|
+
}
|
|
110
|
+
bucket.archs.push(archetype);
|
|
111
|
+
}
|
|
112
|
+
const orderedBuckets = [...buckets.values()].sort((a, b) => {
|
|
113
|
+
for (let i = 0; i < leadKeys.length; i++) {
|
|
114
|
+
const cmp = compare(a.values[i], b.values[i]);
|
|
115
|
+
if (cmp !== 0)
|
|
116
|
+
return order[leadKeys[i]] ? cmp : -cmp;
|
|
56
117
|
}
|
|
57
118
|
return 0;
|
|
58
119
|
});
|
|
59
|
-
|
|
120
|
+
const result = [];
|
|
121
|
+
for (const bucket of orderedBuckets) {
|
|
122
|
+
for (const id of collect(bucket.archs, restKeys))
|
|
123
|
+
result.push(id);
|
|
124
|
+
}
|
|
125
|
+
return result;
|
|
60
126
|
};
|
|
61
127
|
//# sourceMappingURL=select-entities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-entities.js","sourceRoot":"","sources":["../../../../src/ecs/store/core/select-entities.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAQxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAI1B,IAAa,EACb,OAAiD,EACjD,OAAiH,EAChG,EAAE;IACnB,MAAM,UAAU,GAAG,IAAI,CAAC,eA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;QAChF,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IACD,MAAM,cAAc,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,GAAG,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAC1D,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;IACH,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;QAClC,KAAK,MAAM,EAAE,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
import { describe, it, expect } from "vitest";
|
|
3
|
+
import { createStore } from "../public/create-store.js";
|
|
4
|
+
import { compare } from "../../../functions/compare.js";
|
|
5
|
+
// `cell` and `region` partition; `rank` does not. The partition-aware sort in
|
|
6
|
+
// selectEntities must produce output identical to a naive full sort.
|
|
7
|
+
const schema = {
|
|
8
|
+
components: {
|
|
9
|
+
cell: { type: "integer", partition: true },
|
|
10
|
+
region: { type: "integer", partition: true },
|
|
11
|
+
rank: { type: "integer" },
|
|
12
|
+
},
|
|
13
|
+
resources: {},
|
|
14
|
+
archetypes: { E: ["cell", "region", "rank"] },
|
|
15
|
+
};
|
|
16
|
+
const makeStore = (rows) => {
|
|
17
|
+
const store = createStore(schema);
|
|
18
|
+
const ids = rows.map((r) => store.archetypes.E.insert(r));
|
|
19
|
+
return { store, ids };
|
|
20
|
+
};
|
|
21
|
+
// Independent reference: read every row and sort by the order keys with the
|
|
22
|
+
// same `compare` semantics selectEntities uses.
|
|
23
|
+
const referenceSort = (store, ids, order, where) => {
|
|
24
|
+
const keys = Object.keys(order);
|
|
25
|
+
const withVals = ids
|
|
26
|
+
.map((id) => ({ id, r: store.read(id) }))
|
|
27
|
+
.filter((x) => (where ? where(x.r) : true));
|
|
28
|
+
withVals.sort((a, b) => {
|
|
29
|
+
for (const k of keys) {
|
|
30
|
+
const c = compare(a.r[k], b.r[k]);
|
|
31
|
+
if (c !== 0)
|
|
32
|
+
return order[k] ? c : -c;
|
|
33
|
+
}
|
|
34
|
+
return 0;
|
|
35
|
+
});
|
|
36
|
+
return withVals.map((x) => x.id);
|
|
37
|
+
};
|
|
38
|
+
// Rows with a globally-unique `rank` so every order that ends in `rank` is a
|
|
39
|
+
// total order (no ties → the reference comparison is unambiguous).
|
|
40
|
+
const uniqueRows = (n) => Array.from({ length: n }, (_, i) => ({
|
|
41
|
+
cell: i % 5,
|
|
42
|
+
region: i % 3,
|
|
43
|
+
rank: (i * 7) % n, // a permutation of 0..n-1 (7 and n=100 are coprime)
|
|
44
|
+
}));
|
|
45
|
+
describe("selectEntities partition-aware ordering", () => {
|
|
46
|
+
const orders = [
|
|
47
|
+
["sole partition key (cell asc) + rank tiebreak", { cell: true, rank: true }],
|
|
48
|
+
["partition key descending (cell desc) + rank", { cell: false, rank: true }],
|
|
49
|
+
["compound partition keys (cell, region) + rank", { cell: true, region: true, rank: true }],
|
|
50
|
+
["partition then descending secondary (cell asc, rank desc)", { cell: true, rank: false }],
|
|
51
|
+
["non-partition leading key (rank asc) — fallback path", { rank: true }],
|
|
52
|
+
["non-partition leading then partition (rank asc, cell asc) — fallback", { rank: true, cell: true }],
|
|
53
|
+
];
|
|
54
|
+
for (const [name, order] of orders) {
|
|
55
|
+
it(`matches a naive full sort: ${name}`, () => {
|
|
56
|
+
const rows = uniqueRows(100);
|
|
57
|
+
const { store, ids } = makeStore(rows);
|
|
58
|
+
const got = store.select(["cell", "region", "rank"], { order });
|
|
59
|
+
const expected = referenceSort(store, ids, order);
|
|
60
|
+
expect(got).toEqual(expected);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
it("matches a naive full sort with a where filter (cell asc, rank asc)", () => {
|
|
64
|
+
const rows = uniqueRows(100);
|
|
65
|
+
const { store, ids } = makeStore(rows);
|
|
66
|
+
const order = { cell: true, rank: true };
|
|
67
|
+
const got = store.select(["cell", "region", "rank"], { where: { rank: { ">=": 50 } }, order });
|
|
68
|
+
const expected = referenceSort(store, ids, order, (r) => r.rank >= 50);
|
|
69
|
+
expect(got).toEqual(expected);
|
|
70
|
+
});
|
|
71
|
+
it("large K (many distinct partition values) still matches — exercises bucketing at scale", () => {
|
|
72
|
+
// Distinct cell per entity → one bucket each; sole partition order key is
|
|
73
|
+
// the O(N) path (no within-bucket sort).
|
|
74
|
+
const rows = Array.from({ length: 200 }, (_, i) => ({ cell: i, region: 0, rank: i }));
|
|
75
|
+
const { store, ids } = makeStore(rows);
|
|
76
|
+
const order = { cell: true };
|
|
77
|
+
expect(store.select(["cell", "region", "rank"], { order })).toEqual(referenceSort(store, ids, order));
|
|
78
|
+
});
|
|
79
|
+
it("with ties on the sole partition key, output is correctly ordered and a permutation of the input", () => {
|
|
80
|
+
// Many entities share each cell value → ties the reference can't
|
|
81
|
+
// disambiguate; assert the weaker invariants instead.
|
|
82
|
+
const rows = Array.from({ length: 60 }, (_, i) => ({ cell: i % 4, region: 0, rank: i }));
|
|
83
|
+
const { store, ids } = makeStore(rows);
|
|
84
|
+
const got = store.select(["cell", "region", "rank"], { order: { cell: true } });
|
|
85
|
+
// Non-decreasing by cell.
|
|
86
|
+
for (let i = 1; i < got.length; i++) {
|
|
87
|
+
expect(store.get(got[i - 1], "cell") <= store.get(got[i], "cell")).toBe(true);
|
|
88
|
+
}
|
|
89
|
+
// Same set of entities, none lost or duplicated.
|
|
90
|
+
expect([...got].sort((a, b) => a - b)).toEqual([...ids].sort((a, b) => a - b));
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=select-entities.partition.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-entities.partition.test.js","sourceRoot":"","sources":["../../../../src/ecs/store/core/select-entities.partition.test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAGxD,8EAA8E;AAC9E,qEAAqE;AACrE,MAAM,MAAM,GAAG;IACX,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE;QAC1C,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE;QAC5C,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC5B;IACD,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE;CACvC,CAAC;AAKX,MAAM,SAAS,GAAG,CAAC,IAAoB,EAAE,EAAE;IACvC,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,I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AE,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,CAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpF,CAAC;QACD,iDAAiD;QACjD,MAAM,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -3,9 +3,13 @@ import { ArchetypeQueryOptions } from "./core/core.js";
|
|
|
3
3
|
export type OrderClause<T extends object> = {
|
|
4
4
|
[K in keyof T]?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export type EntitySelectOptions<C extends object, T extends object> = ArchetypeQueryOptions<C> & {
|
|
6
|
+
export type EntitySelectOptions<C extends object, T extends object> = Omit<ArchetypeQueryOptions<C>, "where"> & {
|
|
7
7
|
/**
|
|
8
8
|
* Filter the results by the given condition using a declarative where clause.
|
|
9
|
+
* This is a *row-level* {@link Filter} (supports comparison operators),
|
|
10
|
+
* distinct from `ArchetypeQueryOptions.where`, which is archetype-level
|
|
11
|
+
* partition-value equality. Select owns row filtering, so it replaces the
|
|
12
|
+
* inherited partition `where` rather than intersecting with it.
|
|
9
13
|
*/
|
|
10
14
|
where?: Filter<T>;
|
|
11
15
|
/**
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { StringKeyof } from "../../types/types.js";
|
|
2
|
+
import { ComponentSchemas } from "../component-schemas.js";
|
|
3
|
+
import { RequiredComponents } from "../required-components.js";
|
|
4
|
+
import { Archetype } from "../archetype/archetype.js";
|
|
5
|
+
/**
|
|
6
|
+
* The component keys of a schema map that are declared `partition: true`.
|
|
7
|
+
*
|
|
8
|
+
* Detection is at the *schema* level, where the marker survives — the resolved
|
|
9
|
+
* component value map (`FromSchemas<CS>`) has already dropped it. Requires the
|
|
10
|
+
* schema literal to be `as const` so `partition` is the literal `true`, not
|
|
11
|
+
* `boolean` (the project's `... as const satisfies Schema` idiom guarantees it).
|
|
12
|
+
*/
|
|
13
|
+
export type PartitionKeysOf<CS extends ComponentSchemas> = {
|
|
14
|
+
[K in StringKeyof<CS>]: CS[K] extends {
|
|
15
|
+
partition: true;
|
|
16
|
+
} ? K : never;
|
|
17
|
+
}[StringKeyof<CS>];
|
|
18
|
+
/**
|
|
19
|
+
* Whether a component-key set intersects the store's partition keys.
|
|
20
|
+
*
|
|
21
|
+
* The `[PK] extends [never]` guard is load-bearing: when a store declares no
|
|
22
|
+
* partition components (`PK = never` — the default everywhere), this collapses
|
|
23
|
+
* to `false` *without* inspecting `Keys`. That matters because `Keys` is often a
|
|
24
|
+
* generic indexed access (`A[K][number]` inside a `TransactionContext<C,R,A>`);
|
|
25
|
+
* `Extract<GenericKeys, never>` would otherwise stay a *deferred* conditional,
|
|
26
|
+
* leaving `store.archetypes.<K>` as the unresolved union `Archetype.Router | Archetype`
|
|
27
|
+
* and breaking assignability in every generic store context. Short-circuiting
|
|
28
|
+
* on `PK` keeps non-partition stores paying nothing and resolving eagerly.
|
|
29
|
+
*/
|
|
30
|
+
type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
|
|
31
|
+
export type HasPartitionKey<Keys extends string, PK extends string> = [
|
|
32
|
+
PK
|
|
33
|
+
] extends [never] ? false : IsAny<PK> extends true ? boolean : [Extract<Keys, PK>] extends [never] ? false : true;
|
|
34
|
+
/**
|
|
35
|
+
* The `store.archetypes.<Name>` handle for one declared archetype: a
|
|
36
|
+
* {@link Archetype.Router} when it includes a partition component, else the
|
|
37
|
+
* `Concrete` archetype type (`Archetype` or `ReadonlyArchetype`, supplied by the
|
|
38
|
+
* caller). `Has` is a *naked* type parameter so a `boolean` (from `PK = any`)
|
|
39
|
+
* distributes to `Archetype.Router<C> | Concrete`.
|
|
40
|
+
*/
|
|
41
|
+
export type ArchetypeOrRouter<Has extends boolean, C extends RequiredComponents, Concrete> = Has extends true ? Archetype.Router<C> : Concrete;
|
|
42
|
+
/**
|
|
43
|
+
* Return type of `ensureArchetype(keys, values?)`:
|
|
44
|
+
* - a value is supplied → a concrete {@link Archetype} (the resolved member),
|
|
45
|
+
* regardless of partitioning — this is the same-value fast path;
|
|
46
|
+
* - else the key set includes a partition component → a {@link Archetype.Router} that
|
|
47
|
+
* routes each `insert` by the row's partition value;
|
|
48
|
+
* - else → a concrete {@link Archetype} (today's behavior, unchanged).
|
|
49
|
+
*
|
|
50
|
+
* When `Keys` is not statically known to include or exclude a partition
|
|
51
|
+
* component, `HasPartitionKey` stays a union and the result widens to
|
|
52
|
+
* `Archetype<C> | Archetype.Router<C>` — which still exposes `.insert` (both branches
|
|
53
|
+
* share it); only dense column access requires narrowing to `Archetype`.
|
|
54
|
+
*/
|
|
55
|
+
export type EnsureArchetypeResult<C extends RequiredComponents, Keys extends string, PK extends string, ValueProvided extends boolean> = ValueProvided extends true ? Archetype<C> : HasPartitionKey<Keys, PK> extends true ? Archetype.Router<C> : Archetype<C>;
|
|
56
|
+
/**
|
|
57
|
+
* Type of `store.archetypes.<Name>`: a {@link Archetype.Router} when the declared archetype
|
|
58
|
+
* includes a partition component, else a concrete {@link Archetype}. The keys are
|
|
59
|
+
* statically known here (from the schema's `archetypes` map), so this never
|
|
60
|
+
* widens to a union — the discrimination is exact per declared name.
|
|
61
|
+
*/
|
|
62
|
+
export type StoreArchetypeHandle<C extends RequiredComponents, Keys extends string, PK extends string> = HasPartitionKey<Keys, PK> extends true ? Archetype.Router<C> : Archetype<C>;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partition.js","sourceRoot":"","sources":["../../../src/ecs/store/partition.ts"],"names":[],"mappings":"AAAA,uDAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
// A Router can insert (routing write) ...
|
|
3
|
+
router.insert({ cell: 1, position: 2 });
|
|
4
|
+
// ... but exposes no dense view:
|
|
5
|
+
// @ts-expect-error - a family has no single dense column view
|
|
6
|
+
router.columns;
|
|
7
|
+
// @ts-expect-error - a family has no row count
|
|
8
|
+
router.rowCount;
|
|
9
|
+
handle.insert({ cell: 1, position: 2 });
|
|
10
|
+
// ... while dense access is correctly gated behind resolving to a concrete
|
|
11
|
+
// archetype (supply a value, or narrow):
|
|
12
|
+
// @ts-expect-error - .columns requires a concrete Archetype, not a possible family
|
|
13
|
+
handle.columns;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=partition.type-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partition.type-test.js","sourceRoot":"","sources":["../../../src/ecs/store/partition.type-test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAwFvD,0CAA0C;AAC1C,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;AACxC,iCAAiC;AACjC,8DAA8D;AAC9D,MAAM,CAAC,OAAO,CAAC;AACf,+CAA+C;AAC/C,MAAM,CAAC,QAAQ,CAAC;AAKhB,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;AACxC,2EAA2E;AAC3E,yCAAyC;AACzC,mFAAmF;AACnF,MAAM,CAAC,OAAO,CAAC"}
|
|
@@ -4,4 +4,6 @@ import { Store } from "../store.js";
|
|
|
4
4
|
import { FromSchemas } from "../../../schema/from-schemas.js";
|
|
5
5
|
import { ResourceSchemas } from "../../resource-schemas.js";
|
|
6
6
|
import { ArchetypeComponents } from "../archetype-components.js";
|
|
7
|
-
|
|
7
|
+
import { PartitionKeysOf } from "../partition.js";
|
|
8
|
+
import { IndexDeclarations } from "../index-types.js";
|
|
9
|
+
export declare function createStore<CS extends ComponentSchemas = {}, RS extends ResourceSchemas = {}, A extends ArchetypeComponents<StringKeyof<CS>> = {}, IX extends IndexDeclarations<FromSchemas<CS>, A> = {}>(schema?: Store.Schema<CS, RS, A, IX>): Store<FromSchemas<CS>, FromSchemas<RS>, A, IX, PartitionKeysOf<CS>>;
|
|
@@ -21,7 +21,7 @@ export function createStore(schema) {
|
|
|
21
21
|
const resourceSchemas = {};
|
|
22
22
|
const archetypeComponentNames = {};
|
|
23
23
|
const componentAndResourceSchemas = {};
|
|
24
|
-
const core = createCore(componentAndResourceSchemas);
|
|
24
|
+
const core = createCore(componentAndResourceSchemas, (archetype) => decorateArchetypeForIndexes(archetype));
|
|
25
25
|
// Index registry. Owned at the Store layer because index state is
|
|
26
26
|
// *derived* from store data, and every mutation that needs to keep
|
|
27
27
|
// indexes in sync flows through Store methods (insert / update /
|
|
@@ -165,57 +165,25 @@ export function createStore(schema) {
|
|
|
165
165
|
return selectEntities(core, include, options);
|
|
166
166
|
};
|
|
167
167
|
const archetypes = {};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
* (`store.archetypes.X`, `store.ensureArchetype([...])`) all return the
|
|
176
|
-
* same wrapper reference — code that uses `===` to compare archetypes
|
|
177
|
-
* keeps working.
|
|
178
|
-
*/
|
|
179
|
-
const archetypeWrapCache = new WeakMap();
|
|
180
|
-
const wrapArchetypeForIndexes = (archetype) => {
|
|
181
|
-
const cached = archetypeWrapCache.get(archetype);
|
|
182
|
-
if (cached)
|
|
183
|
-
return cached;
|
|
168
|
+
// Decorate an archetype's `insert` in place with index maintenance. The core
|
|
169
|
+
// calls this (via `onArchetypeCreated`) the moment any archetype is created —
|
|
170
|
+
// direct or a lazily-created partition value-child — so every write path
|
|
171
|
+
// (direct insert, router routing, migration target) shares one maintained
|
|
172
|
+
// insert. No Proxy and no forwarding wrapper: the archetype you hold *is* the
|
|
173
|
+
// index-maintaining one, and `===` identity is preserved for free.
|
|
174
|
+
const decorateArchetypeForIndexes = (archetype) => {
|
|
184
175
|
const rawInsert = archetype.insert.bind(archetype);
|
|
185
|
-
|
|
186
|
-
//
|
|
187
|
-
//
|
|
176
|
+
archetype.insert = (values) => {
|
|
177
|
+
// Pre-check unique constraints before the column mutation so a
|
|
178
|
+
// collision throws without partially mutating the store. The
|
|
179
|
+
// archetype's id + component set let the registry dispatch to only
|
|
180
|
+
// the applicable indexes.
|
|
188
181
|
indexRegistry.checkUniqueAvailableForInsert(archetype, values);
|
|
189
182
|
const entity = rawInsert(values);
|
|
190
183
|
indexRegistry.applyInsert(entity, archetype, values);
|
|
191
184
|
return entity;
|
|
192
185
|
};
|
|
193
|
-
const wrapped = new Proxy(archetype, {
|
|
194
|
-
get(target, prop, receiver) {
|
|
195
|
-
if (prop === "insert")
|
|
196
|
-
return wrappedInsert;
|
|
197
|
-
return Reflect.get(target, prop, receiver);
|
|
198
|
-
},
|
|
199
|
-
});
|
|
200
|
-
archetypeWrapCache.set(archetype, wrapped);
|
|
201
|
-
return wrapped;
|
|
202
186
|
};
|
|
203
|
-
const ensureArchetype = ((componentNames) => {
|
|
204
|
-
return wrapArchetypeForIndexes(core.ensureArchetype(componentNames));
|
|
205
|
-
});
|
|
206
|
-
// `queryArchetypes` and `locate` also surface archetypes — wrap them
|
|
207
|
-
// so `===` comparisons against `store.archetypes.X` continue to hold.
|
|
208
|
-
// Cached wrappers guarantee identity stability per raw archetype.
|
|
209
|
-
const queryArchetypes = ((include, options) => {
|
|
210
|
-
const raw = core.queryArchetypes(include, options);
|
|
211
|
-
return raw.map((a) => wrapArchetypeForIndexes(a));
|
|
212
|
-
});
|
|
213
|
-
const locate = ((entity) => {
|
|
214
|
-
const loc = core.locate(entity);
|
|
215
|
-
if (loc === null)
|
|
216
|
-
return null;
|
|
217
|
-
return { archetype: wrapArchetypeForIndexes(loc.archetype), row: loc.row };
|
|
218
|
-
});
|
|
219
187
|
const updateEntity = (entity, values) => {
|
|
220
188
|
indexRegistry.checkUniqueAvailableForUpdate(entity, values);
|
|
221
189
|
// `update` can move the entity to a different archetype (when it
|
|
@@ -269,8 +237,9 @@ export function createStore(schema) {
|
|
|
269
237
|
continue;
|
|
270
238
|
}
|
|
271
239
|
archetypeComponentNames[name] = newComponents;
|
|
272
|
-
|
|
273
|
-
|
|
240
|
+
// Insert is already index-maintaining (decorated at creation), and a
|
|
241
|
+
// partitioned archetype resolves to a Router — both surfaced directly.
|
|
242
|
+
archetypes[name] = core.ensureArchetype(["id", ...newComponents]);
|
|
274
243
|
}
|
|
275
244
|
// indexes: registry enforces (===)-or-throw on same name and
|
|
276
245
|
// structural duplicate detection across names. A new RuntimeIndex
|
|
@@ -288,10 +257,10 @@ export function createStore(schema) {
|
|
|
288
257
|
return store;
|
|
289
258
|
};
|
|
290
259
|
const store = {
|
|
260
|
+
// `ensureArchetype` / `queryArchetypes` / `locate` come straight from
|
|
261
|
+
// `core`: inserts are decorated at creation, so no Store-layer wrapping
|
|
262
|
+
// is needed and `===` identity holds (the raw archetype is the handle).
|
|
291
263
|
...core,
|
|
292
|
-
ensureArchetype,
|
|
293
|
-
queryArchetypes,
|
|
294
|
-
locate,
|
|
295
264
|
update: updateEntity,
|
|
296
265
|
delete: deleteEntity,
|
|
297
266
|
resources,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store.js","sourceRoot":"","sources":["../../../../src/ecs/store/public/create-store.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAQvD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EACH,mBAAmB,GAGtB,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":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