@adobe/data 0.5.22 → 0.5.25

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.
Files changed (218) hide show
  1. package/README.md +96 -110
  2. package/dist/blob/blob-handle.d.ts +53 -2
  3. package/dist/blob/blob-handle.js +48 -4
  4. package/dist/blob/blob-handle.js.map +1 -1
  5. package/dist/blob/blob-meta.d.ts +26 -1
  6. package/dist/blob/blob-meta.js +14 -1
  7. package/dist/blob/blob-meta.js.map +1 -1
  8. package/dist/blob/index.d.ts +0 -2
  9. package/dist/blob/index.js +21 -2
  10. package/dist/blob/index.js.map +1 -1
  11. package/dist/cache/functions/hashing/blob-to-hash.js +7 -5
  12. package/dist/cache/functions/hashing/blob-to-hash.js.map +1 -1
  13. package/dist/ecs/database/create-database.js +54 -50
  14. package/dist/ecs/database/create-database.js.map +1 -1
  15. package/dist/ecs/database/create-database.test.js +2 -1
  16. package/dist/ecs/database/create-database.test.js.map +1 -1
  17. package/dist/ecs/database/database-schema/create-database-schema-test.js +1 -1
  18. package/dist/ecs/database/database-schema/create-database-schema-test.js.map +1 -1
  19. package/dist/ecs/database/database-schema/create-database-schema.js +0 -2
  20. package/dist/ecs/database/database-schema/create-database-schema.js.map +1 -1
  21. package/dist/ecs/database/transactional-store/apply-operations.js.map +1 -1
  22. package/dist/ecs/database/transactional-store/coalesce-transactions.js +2 -2
  23. package/dist/ecs/database/transactional-store/coalesce-transactions.js.map +1 -1
  24. package/dist/ecs/database/transactional-store/patch-entity-values.js.map +1 -1
  25. package/dist/ecs/store/core/select-entities.js +2 -2
  26. package/dist/ecs/store/core/select-entities.js.map +1 -1
  27. package/dist/ecs/store/create-store-schema-test.d.ts +1 -0
  28. package/dist/ecs/store/create-store-schema-test.js +33 -0
  29. package/dist/ecs/store/create-store-schema-test.js.map +1 -0
  30. package/dist/ecs/store/create-store.d.ts +2 -6
  31. package/dist/ecs/store/create-store.js.map +1 -1
  32. package/dist/ecs/store/index.d.ts +0 -1
  33. package/dist/ecs/store/index.js +0 -1
  34. package/dist/ecs/store/index.js.map +1 -1
  35. package/dist/ecs/store/store.d.ts +25 -4
  36. package/dist/ecs/store/store.js +17 -1
  37. package/dist/ecs/store/store.js.map +1 -1
  38. package/dist/functions/merge-patch.js.map +1 -1
  39. package/dist/functions/merge-patch.test.js +21 -0
  40. package/dist/functions/merge-patch.test.js.map +1 -1
  41. package/dist/functions/serialization/index.js +21 -0
  42. package/dist/functions/serialization/index.js.map +1 -1
  43. package/dist/functions/serialization/register-blob-codecs.js.map +1 -1
  44. package/dist/functions/serialization/register-typed-array-codecs.js.map +1 -1
  45. package/dist/functions/serialization/serialize-to-blobs.js +21 -0
  46. package/dist/functions/serialization/serialize-to-blobs.js.map +1 -1
  47. package/dist/functions/serialization/serialize-to-blobs.test.js +21 -0
  48. package/dist/functions/serialization/serialize-to-blobs.test.js.map +1 -1
  49. package/dist/functions/serialization/serialize-to-storage.js +21 -0
  50. package/dist/functions/serialization/serialize-to-storage.js.map +1 -1
  51. package/dist/functions/serialization/serialize-to-storage.test.js +21 -0
  52. package/dist/functions/serialization/serialize-to-storage.test.js.map +1 -1
  53. package/dist/functions/serialization/serialize.js +21 -0
  54. package/dist/functions/serialization/serialize.js.map +1 -1
  55. package/dist/internal/array-buffer-like/copy.js +0 -420
  56. package/dist/internal/array-buffer-like/copy.js.map +1 -1
  57. package/dist/internal/array-buffer-like/is-array-buffer.js +0 -420
  58. package/dist/internal/array-buffer-like/is-array-buffer.js.map +1 -1
  59. package/dist/internal/array-buffer-like/is-shared-array-buffer.js +0 -420
  60. package/dist/internal/array-buffer-like/is-shared-array-buffer.js.map +1 -1
  61. package/dist/internal/data-view-32/data-view-32.js +0 -21
  62. package/dist/internal/data-view-32/data-view-32.js.map +1 -1
  63. package/dist/lit/hooks/index.d.ts +1 -0
  64. package/dist/lit/hooks/index.js +1 -0
  65. package/dist/lit/hooks/index.js.map +1 -1
  66. package/dist/lit/hooks/use-debounce.d.ts +8 -0
  67. package/dist/lit/hooks/use-debounce.js +41 -0
  68. package/dist/lit/hooks/use-debounce.js.map +1 -0
  69. package/dist/lit/hooks/use-drag-observe.d.ts +6 -5
  70. package/dist/lit/hooks/use-drag-observe.js +2 -2
  71. package/dist/lit/hooks/use-drag-observe.js.map +1 -1
  72. package/dist/lit/hooks/use-drag-transaction.d.ts +1 -1
  73. package/dist/lit/hooks/use-drag-transaction.js +1 -2
  74. package/dist/lit/hooks/use-drag-transaction.js.map +1 -1
  75. package/dist/lit/hooks/use-draggable.d.ts +5 -6
  76. package/dist/lit/hooks/use-draggable.js +23 -31
  77. package/dist/lit/hooks/use-draggable.js.map +1 -1
  78. package/dist/lit/hooks/use-effect.js +1 -1
  79. package/dist/lit/hooks/use-effect.js.map +1 -1
  80. package/dist/lit/hooks/use-resize-observer.d.ts +2 -0
  81. package/dist/lit/hooks/use-resize-observer.js +2 -0
  82. package/dist/lit/hooks/use-resize-observer.js.map +1 -1
  83. package/dist/lit/hooks/use-updated.js +21 -0
  84. package/dist/lit/hooks/use-updated.js.map +1 -1
  85. package/dist/math/aabb/aabb.js +1 -0
  86. package/dist/math/aabb/aabb.js.map +1 -1
  87. package/dist/math/aabb-face/aabb-face.d.ts +14 -19
  88. package/dist/math/aabb-face/aabb-face.js +31 -19
  89. package/dist/math/aabb-face/aabb-face.js.map +1 -1
  90. package/dist/math/f32/f32.js +1 -0
  91. package/dist/math/f32/f32.js.map +1 -1
  92. package/dist/math/i32/i32.js +1 -0
  93. package/dist/math/i32/i32.js.map +1 -1
  94. package/dist/math/line2/line2.js +1 -0
  95. package/dist/math/line2/line2.js.map +1 -1
  96. package/dist/math/line3/line3.js +1 -0
  97. package/dist/math/line3/line3.js.map +1 -1
  98. package/dist/math/mat4x4/mat4x4.js +1 -0
  99. package/dist/math/mat4x4/mat4x4.js.map +1 -1
  100. package/dist/math/plane/plane.js +1 -0
  101. package/dist/math/plane/plane.js.map +1 -1
  102. package/dist/math/quat/quat.js +1 -0
  103. package/dist/math/quat/quat.js.map +1 -1
  104. package/dist/math/u32/u32.js +1 -0
  105. package/dist/math/u32/u32.js.map +1 -1
  106. package/dist/math/vec2/vec2.js +1 -0
  107. package/dist/math/vec2/vec2.js.map +1 -1
  108. package/dist/math/vec3/vec3.d.ts +1 -0
  109. package/dist/math/vec3/vec3.js +2 -0
  110. package/dist/math/vec3/vec3.js.map +1 -1
  111. package/dist/math/vec4/vec4.d.ts +1 -0
  112. package/dist/math/vec4/vec4.js +7 -0
  113. package/dist/math/vec4/vec4.js.map +1 -1
  114. package/dist/observe/to-async-generator.test.js +5 -8
  115. package/dist/observe/to-async-generator.test.js.map +1 -1
  116. package/dist/observe/with-default.js +0 -1
  117. package/dist/observe/with-default.js.map +1 -1
  118. package/dist/samples/todo/elements/todo-list/todo-list-presentation.d.ts +0 -17
  119. package/dist/samples/todo/elements/todo-list/todo-list-presentation.js.map +1 -1
  120. package/dist/samples/todo/elements/todo-list/todo-list.css.d.ts +0 -17
  121. package/dist/samples/todo/elements/todo-list/todo-list.css.js +21 -17
  122. package/dist/samples/todo/elements/todo-list/todo-list.css.js.map +1 -1
  123. package/dist/samples/todo/elements/todo-list/todo-list.js +21 -17
  124. package/dist/samples/todo/elements/todo-list/todo-list.js.map +1 -1
  125. package/dist/samples/todo/elements/todo-row/index.d.ts +0 -17
  126. package/dist/samples/todo/elements/todo-row/index.js +21 -17
  127. package/dist/samples/todo/elements/todo-row/index.js.map +1 -1
  128. package/dist/samples/todo/elements/todo-row/todo-row-presentation.js +23 -19
  129. package/dist/samples/todo/elements/todo-row/todo-row-presentation.js.map +1 -1
  130. package/dist/samples/todo/elements/todo-row/todo-row.css.js +21 -17
  131. package/dist/samples/todo/elements/todo-row/todo-row.css.js.map +1 -1
  132. package/dist/samples/todo/elements/todo-row/todo-row.js +21 -17
  133. package/dist/samples/todo/elements/todo-row/todo-row.js.map +1 -1
  134. package/dist/samples/todo/elements/todo-toolbar/index.d.ts +0 -17
  135. package/dist/samples/todo/elements/todo-toolbar/index.js +21 -17
  136. package/dist/samples/todo/elements/todo-toolbar/index.js.map +1 -1
  137. package/dist/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js +21 -17
  138. package/dist/samples/todo/elements/todo-toolbar/todo-toolbar-presentation.js.map +1 -1
  139. package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.css.js +21 -17
  140. package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.css.js.map +1 -1
  141. package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.js +21 -17
  142. package/dist/samples/todo/elements/todo-toolbar/todo-toolbar.js.map +1 -1
  143. package/dist/samples/todo/elements/todo-undo-redo/index.d.ts +0 -17
  144. package/dist/samples/todo/elements/todo-undo-redo/index.js +21 -17
  145. package/dist/samples/todo/elements/todo-undo-redo/index.js.map +1 -1
  146. package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js +21 -17
  147. package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo-presentation.js.map +1 -1
  148. package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js +21 -17
  149. package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.css.js.map +1 -1
  150. package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.js +21 -17
  151. package/dist/samples/todo/elements/todo-undo-redo/todo-undo-redo.js.map +1 -1
  152. package/dist/samples/todo/services/dependent-state-service/create-dependent-state-service.js +21 -17
  153. package/dist/samples/todo/services/dependent-state-service/create-dependent-state-service.js.map +1 -1
  154. package/dist/samples/todo/services/dependent-state-service/dependent-state/all-todos.d.ts +0 -17
  155. package/dist/samples/todo/services/dependent-state-service/dependent-state/all-todos.js.map +1 -1
  156. package/dist/samples/todo/services/dependent-state-service/dependent-state/complete-todos.d.ts +0 -17
  157. package/dist/samples/todo/services/dependent-state-service/dependent-state/complete-todos.js.map +1 -1
  158. package/dist/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.d.ts +0 -17
  159. package/dist/samples/todo/services/dependent-state-service/dependent-state/incomplete-todos.js.map +1 -1
  160. package/dist/samples/todo/services/dependent-state-service/dependent-state/index.d.ts +0 -17
  161. package/dist/samples/todo/services/dependent-state-service/dependent-state/index.js +21 -17
  162. package/dist/samples/todo/services/dependent-state-service/dependent-state/index.js.map +1 -1
  163. package/dist/samples/todo/services/dependent-state-service/dependent-state-service.d.ts +0 -17
  164. package/dist/samples/todo/services/main-service/create-main-service.d.ts +0 -17
  165. package/dist/samples/todo/services/main-service/create-main-service.js.map +1 -1
  166. package/dist/samples/todo/services/main-service/todo-main-service.d.ts +0 -17
  167. package/dist/samples/todo/services/state-service/create-todo-database.d.ts +33 -10
  168. package/dist/samples/todo/services/state-service/create-todo-database.js +21 -17
  169. package/dist/samples/todo/services/state-service/create-todo-database.js.map +1 -1
  170. package/dist/samples/todo/services/state-service/create-todo-store.d.ts +33 -10
  171. package/dist/samples/todo/services/state-service/create-todo-store.js +21 -17
  172. package/dist/samples/todo/services/state-service/create-todo-store.js.map +1 -1
  173. package/dist/samples/todo/services/state-service/todo-state-service.d.ts +0 -17
  174. package/dist/samples/todo/services/state-service/transactions/create-bulk-todos.js +21 -17
  175. package/dist/samples/todo/services/state-service/transactions/create-bulk-todos.js.map +1 -1
  176. package/dist/samples/todo/services/state-service/transactions/create-todo.d.ts +0 -17
  177. package/dist/samples/todo/services/state-service/transactions/create-todo.js.map +1 -1
  178. package/dist/samples/todo/services/state-service/transactions/create-todo.test.js +21 -17
  179. package/dist/samples/todo/services/state-service/transactions/create-todo.test.js.map +1 -1
  180. package/dist/samples/todo/services/state-service/transactions/delete-all-todos.d.ts +0 -17
  181. package/dist/samples/todo/services/state-service/transactions/delete-all-todos.js.map +1 -1
  182. package/dist/samples/todo/services/state-service/transactions/delete-todo.js +21 -17
  183. package/dist/samples/todo/services/state-service/transactions/delete-todo.js.map +1 -1
  184. package/dist/samples/todo/services/state-service/transactions/delete-todo.test.js +21 -17
  185. package/dist/samples/todo/services/state-service/transactions/delete-todo.test.js.map +1 -1
  186. package/dist/samples/todo/services/state-service/transactions/drag-todo.js +21 -17
  187. package/dist/samples/todo/services/state-service/transactions/drag-todo.js.map +1 -1
  188. package/dist/samples/todo/services/state-service/transactions/index.d.ts +0 -17
  189. package/dist/samples/todo/services/state-service/transactions/index.js +21 -17
  190. package/dist/samples/todo/services/state-service/transactions/index.js.map +1 -1
  191. package/dist/samples/todo/services/state-service/transactions/reorder-todos.d.ts +0 -17
  192. package/dist/samples/todo/services/state-service/transactions/reorder-todos.js.map +1 -1
  193. package/dist/samples/todo/services/state-service/transactions/toggle-complete.d.ts +0 -17
  194. package/dist/samples/todo/services/state-service/transactions/toggle-complete.js.map +1 -1
  195. package/dist/samples/todo/services/state-service/transactions/toggle-complete.test.js +21 -17
  196. package/dist/samples/todo/services/state-service/transactions/toggle-complete.test.js.map +1 -1
  197. package/dist/samples/todo/todo-element.d.ts +0 -17
  198. package/dist/samples/todo/todo-element.js.map +1 -1
  199. package/dist/samples/todo/todo-main-element.d.ts +0 -17
  200. package/dist/samples/todo/todo-main-element.js +21 -17
  201. package/dist/samples/todo/todo-main-element.js.map +1 -1
  202. package/dist/schema/schema.d.ts +1 -1
  203. package/dist/table/table.js +1 -0
  204. package/dist/table/table.js.map +1 -1
  205. package/dist/tsconfig.tsbuildinfo +1 -1
  206. package/dist/typed-buffer/create-struct-buffer.js +0 -1
  207. package/dist/typed-buffer/create-struct-buffer.js.map +1 -1
  208. package/dist/typed-buffer/create-struct-buffer.test.js +5 -3
  209. package/dist/typed-buffer/create-struct-buffer.test.js.map +1 -1
  210. package/dist/typed-buffer/is-typed-buffer.js +21 -0
  211. package/dist/typed-buffer/is-typed-buffer.js.map +1 -1
  212. package/dist/typed-buffer/is-typed-buffer.test.js +21 -0
  213. package/dist/typed-buffer/is-typed-buffer.test.js.map +1 -1
  214. package/dist/typed-buffer/typed-buffer-equals.js +21 -0
  215. package/dist/typed-buffer/typed-buffer-equals.js.map +1 -1
  216. package/dist/types/replace.d.ts +0 -4
  217. package/dist/types/replace.js.map +1 -1
  218. package/package.json +1 -1
package/README.md CHANGED
@@ -11,6 +11,11 @@ Adobe Data Oriented Programming Library
11
11
 
12
12
  Until we reach 1.0.0, minor version changes may be API breaking.
13
13
 
14
+ ## Data Oriented Programming
15
+
16
+ This library is built using a data oriented and functional programming paradigm.
17
+ We prefer composition over inheritance, avoid classes when possible and emphasize separation of concerns.
18
+
14
19
  ## Data
15
20
 
16
21
  This library uses data oriented design paradigm and prefers pure functional interfaces whenever practical.
@@ -156,7 +161,7 @@ The `memoize` function can be used to cache expensive, deterministic, asynchrono
156
161
 
157
162
  ### BlobStore
158
163
 
159
- It is important to handle `Blob`s correctly within an application. Retaining references to a large number of them can cause memory problems depending upon their size.
164
+ It is important to handle `Blob`s correctly within an application.
160
165
 
161
166
  The `BlobStore` interface and corresponding `blobStore` exported instance provide a convenient way to convert `Blob`s into small JSON handles to them called `BlobRef`s. Those `BlobRef`s can later be converted back into a `Blob`.
162
167
 
@@ -165,7 +170,6 @@ The `BlobStore` interface and corresponding `blobStore` exported instance provid
165
170
  `BlobRef`s have a number of advantages over directly using blobs.
166
171
  `BlobRef`s are:
167
172
  - small json objects
168
- - use negligible memory since the `Blob` is stored on disc till needed.
169
173
  - deterministic for each `Blob` based on mime type and content.
170
174
  - suitable for persistence to locations with limited size.
171
175
  - suitable for use as a cache key
@@ -179,132 +183,114 @@ Contains some standard data type schemas in JSON Schema format for convenience.
179
183
 
180
184
  This ECS database is a high performance, strongly typed typescript implementation inspired by the Sanders Mertens C++ based [Flecs](https://www.flecs.dev/flecs/md_docs_2Docs.html).
181
185
 
182
- This library provides three different high performance ECS interfaces. They each share the same basic read API but differ in their interface for writing and observability of changes.
183
-
184
- - [ECS](./docs/api/interfaces/ecs.ECS.html)
185
- - allows direct write access to the data.
186
- - no changes are observability.
187
- - [Transaction ECS](./docs/api/interfaces/ecs.TransactionECS.html)
188
- - requires transactions for writing changes.
189
- - all changes are observable.
190
- - [Action ECS](./docs/api/interfaces/ecs.ActionECS.html)
191
- - requires pre-defined actions for writing changes.
192
- - actions are implemented using transactions.
193
- - action functions must be synchronous and may never throw.
194
- - all changes are observable.
195
- - provides Operational Transform to resolve concurrent multi player edits.
196
-
197
- ### What is an ECS?
186
+ This library provides two main interfaces for ECS operations: **Store** and **Database**. They share the same read API but differ significantly in their approach to writing and observability.
198
187
 
199
- Sanders Mertens also covers this thoroughly in his ECS FAQ:
188
+ ### Store Interface
200
189
 
201
- [https://github.com/SanderMertens/ecs-faq?tab=readme-ov-file#what-is-ecs](https://github.com/SanderMertens/ecs-faq?tab=readme-ov-file#what-is-ecs)
190
+ The **Store** is the foundational, low-level interface for direct ECS data operations.
202
191
 
203
- In addition to the Entity, Component and System definitions which are standard, we also use the term Resource. A Resource is just a value which is defined globally on the ECS itself and not attached to any specific Entity.
192
+ **Key Characteristics:**
193
+ - **Direct Access**: Provides immediate, synchronous read/write access to entities, components, and resources
194
+ - **No Transaction Control**: Changes are applied directly without transaction boundaries
195
+ - **No Observability**: Changes are not automatically observable or trackable
196
+ - **High Performance**: Minimal overhead for direct operations using Structure of Arrays (SoA) with linear memory layout of numeric types for optimal cache performance
197
+ - **Core ECS Operations**: Includes entity creation, component updates, archetype querying, and resource management
204
198
 
205
- ### Action ECS Usage
199
+ **Usage**: Ideal for scenarios requiring fast, direct ECS manipulation where you don't need change tracking or transactional safety.
206
200
 
207
201
  ```typescript
208
- // create an action ecs
209
- const ecs = createActionECS()
210
- // define components with schemas
211
- .withComponents({
212
- position: Vector3Schema,
213
- velocity: Vector3Schema,
214
- color: Vector4Schema,
215
- size: { type: "number" },
202
+ // Create a store with components, resources, and archetypes
203
+ const store = createStore(
204
+ {
205
+ position: Vec3.schema,
216
206
  health: { type: "number" },
217
- player: { const: true },
218
- } as const)
219
- // define archetypes with component names
220
- .withArchetypes({
221
- particle: ["position", "velocity", "color", "size"],
222
- player: ["position", "health", "player"],
223
- })
224
- // define resources with initial values
225
- .withResources({
226
- gravity: 9.8,
227
- })
228
- // define actions with transactional functions
229
- .withActions({
230
- createParticle(t, props: { position: Vector3, velocity: Vector3, color: Vector4, size: number }) {
231
- t.createEntity(t.ecs.archetypes.particle, props);
232
- },
233
- deleteParticle(t, entity: number) {
234
- t.deleteEntity(entity);
235
- },
236
- createPlayer(t, position: Vector3) {
237
- t.createEntity(t.ecs.archetypes.player, { position, health: 100, player: true });
238
- },
239
- movePlayer(t, entity: number, position: Vector3) {
240
- t.setComponentValue(entity, "position", position);
241
- },
242
- setGravity(t, gravity: number) {
243
- t.resources.gravity = gravity;
244
- },
245
- })
246
-
247
- // call some actions to modify the ECS
248
- ecs.actions.createParticle({ position: [0, 0, 0], velocity: [1, 0, 0], color: [1, 1, 1, 1], size: 1 });
249
- ecs.actions.createParticle({ position: [1, 1, 1], velocity: [1, 1, 1], color: [1, 1, 1, 1], size: 2 });
250
- ecs.actions.createPlayer([10, 20, 0]);
251
- ecs.actions.movePlayer(1, [10, 20, 0]);
252
-
253
- // read some values from the ECS
254
- const players = ecs.selectEntities(ecs.archetypes.player);
255
- const particles = ecs.selectEntities(ecs.archetypes.particle);
256
-
257
- // observe changes to the ECS
258
- ecs.observe.archetypeEntities(ecs.archetypes.player)((playerEntities) => {
259
- for (const playerEntity of playerEntities) {
260
- const player = ecs.getEntityValues(playerEntity);
261
- console.log("Player entity changed", player);
207
+ player: { const: true }
208
+ },
209
+ {
210
+ gravity: { default: 9.8 as number }
211
+ },
212
+ {
213
+ Player: ["position", "health", "player"],
214
+ Particle: ["position"]
262
215
  }
263
- });
216
+ );
264
217
 
218
+ // Direct operations
219
+ const playerId = store.archetypes.Player.insert({
220
+ position: [0, 0, 0],
221
+ health: 100,
222
+ player: true
223
+ });
224
+ store.update(playerId, { position: [1, 1, 1] });
225
+ store.resources.gravity = 10.0;
265
226
  ```
266
227
 
267
- ### ECS Persistence
228
+ ### Database Interface
229
+
230
+ The **Database** wraps a Store to provide **transaction-based operations** with **full observability**.
231
+
232
+ **Key Characteristics:**
233
+ - **Transaction-Based**: All changes must occur within predefined atomic transactions that can be undone.
234
+ - **Full Observability**: Every change is observable through the `observe` API
235
+ - **Predefined Operations**: Uses predefined transaction functions rather than direct mutations
236
+ - **Undo/Redo Support**: Transactions generate undo/redo operations automatically
237
+ - **Change Tracking**: Tracks which entities, components, and archetypes changed
238
+ - **Event Notifications**: Automatically notifies observers of changes
268
239
 
269
- The ECS can be converted to JSON and from JSON.
240
+ **Usage**: Ideal for applications requiring change history, multiplayer synchronization, undo/redo functionality, or reactive UI updates.
270
241
 
271
- The persistence format is logically consistent with the internal ECS data format so studying it may help you understand how an ECS is structured:
242
+ **Important Note**: Even when using a Database, transaction functions are written as direct modifications to the underlying Store interface. The Database wraps these operations to provide transactional guarantees and observability.
272
243
 
273
244
  ```typescript
274
- {
275
- ecs: true,
276
- version: 2,
277
- components: {
278
- id: { type: 'integer', minimum: +0, maximum: 4294967295 },
279
- position: { type: 'array', items: { type: 'number', precision: 1 }, minItems: 3, maxItems: 3 },
280
- velocity: { type: 'array', items: { type: 'number', precision: 1 }, minItems: 3, maxItems: 3 },
281
- color: { type: 'array', items: { type: 'number', precision: 1 }, minItems: 3, maxItems: 3 },
282
- size: { type: 'number' }, health: { type: 'number' }, player: { const: true },
283
- gravity: {}
245
+ // Create a database with predefined transactions
246
+ const database = createDatabase(store, {
247
+ createPlayer(t, args: { position: Vector3, health: number }) {
248
+ // Transaction function receives Store interface for direct operations
249
+ return t.archetypes.Player.insert({
250
+ ...args,
251
+ player: true
252
+ });
284
253
  },
285
- // The main entities table has two entries for each entity.
286
- // The first value is the index of the tables array and represents the entities archetype.
287
- // The second value is the row of the entity within the archetype table.
288
- entities: [ 3, +0, 1, +0, 1, +1, 2, +0 ],
289
- tables: [
290
- { rows: +0, columns: { id: [] } }, // the empty archetype contains only an id component
291
- {
292
- rows: 2,
293
- columns: {
294
- // component data is stored as Structure of Arrays (SoA)
295
- id: [ 1, 2 ],
296
- color: [ [1, 0, 0, 0], [1, 1, 1, 1] ],
297
- position: [ [0, 0, 0, 0], [1, 1, 1, 1] ],
298
- size: [ 1, 2 ],
299
- velocity: [ [0, 0, 0], [1, 1, 1] ]
300
- }
301
- },
302
- { rows: 1, columns: { id: [ 3 ], health: [ 100 ], player: true, position: [ [ 10, 20, +0 ] ] } },
303
- { rows: 1, columns: { gravity: [ 9.8 ], id: [ +0 ] } } // resources are stored internally as components
304
- ]
305
- }
254
+ movePlayer(t, args: { entity: Entity, position: Vector3 }) {
255
+ // Direct Store operations within transaction context
256
+ t.update(args.entity, { position: args.position });
257
+ },
258
+ setGravity(t, gravity: number) {
259
+ // Direct resource modification within transaction
260
+ t.resources.gravity = gravity;
261
+ }
262
+ });
263
+
264
+ // Execute transactions (these provide observability and undo/redo)
265
+ const playerId = database.transactions.createPlayer({
266
+ position: [10, 20, 0],
267
+ health: 100
268
+ });
269
+ database.transactions.movePlayer({ entity: playerId, position: [15, 25, 5] });
270
+
271
+ // Observe all changes
272
+ database.observe.transactions((result) => {
273
+ console.log('Transaction applied:', result);
274
+ console.log('Changed entities:', result.changedEntities);
275
+ console.log('Undo operations:', result.undo);
276
+ });
277
+
278
+ // Observe specific entities
279
+ database.observe.entity(playerId)((entityData) => {
280
+ if (entityData) {
281
+ console.log('Player moved to:', entityData.position);
282
+ }
283
+ });
306
284
  ```
307
285
 
286
+ ### What is an ECS?
287
+
288
+ Sanders Mertens also covers this thoroughly in his ECS FAQ:
289
+
290
+ [https://github.com/SanderMertens/ecs-faq?tab=readme-ov-file#what-is-ecs](https://github.com/SanderMertens/ecs-faq?tab=readme-ov-file#what-is-ecs)
291
+
292
+ In addition to the Entity, Component and System definitions which are standard, we also use the term Resource. A Resource is just a value which is defined globally on the ECS itself and not attached to any specific Entity. You can think of them as a singleton Component.
293
+
308
294
  ## Performance Test
309
295
 
310
296
  [Performance Test](https://git.corp.adobe.com/pages/neuralfiltersplatform/firefly-data/docs/perftest.html)
@@ -1,5 +1,5 @@
1
1
  import { FromSchema } from "../schema/schema.js";
2
- export declare const BlobHandleSchema: {
2
+ declare const BlobHandleSchema: {
3
3
  readonly type: "object";
4
4
  readonly properties: {
5
5
  readonly handle: {
@@ -8,6 +8,12 @@ export declare const BlobHandleSchema: {
8
8
  readonly expires: {
9
9
  readonly type: "string";
10
10
  };
11
+ readonly upload: {
12
+ readonly type: "boolean";
13
+ };
14
+ readonly download: {
15
+ readonly type: "boolean";
16
+ };
11
17
  readonly type: {
12
18
  readonly type: "string";
13
19
  };
@@ -24,6 +30,51 @@ export declare const BlobHandleSchema: {
24
30
  readonly type: "number";
25
31
  };
26
32
  };
27
- readonly required: readonly ["type", "size", "handle"];
33
+ readonly required: readonly ["type", "size", "handle", "expires"];
28
34
  };
29
35
  export type BlobHandle = FromSchema<typeof BlobHandleSchema>;
36
+ export type UploadHandle = BlobHandle & {
37
+ upload: true;
38
+ };
39
+ export type DownloadHandle = BlobHandle & {
40
+ download: true;
41
+ };
42
+ export declare namespace BlobHandle {
43
+ const schema: {
44
+ readonly type: "object";
45
+ readonly properties: {
46
+ readonly handle: {
47
+ readonly type: "string";
48
+ };
49
+ readonly expires: {
50
+ readonly type: "string";
51
+ };
52
+ readonly upload: {
53
+ readonly type: "boolean";
54
+ };
55
+ readonly download: {
56
+ readonly type: "boolean";
57
+ };
58
+ readonly type: {
59
+ readonly type: "string";
60
+ };
61
+ readonly size: {
62
+ readonly type: "number";
63
+ };
64
+ readonly width: {
65
+ readonly type: "number";
66
+ };
67
+ readonly height: {
68
+ readonly type: "number";
69
+ };
70
+ readonly duration: {
71
+ readonly type: "number";
72
+ };
73
+ };
74
+ readonly required: readonly ["type", "size", "handle", "expires"];
75
+ };
76
+ function is(value: unknown): value is BlobHandle;
77
+ function isUpload(value: unknown): value is UploadHandle;
78
+ function isDownload(value: unknown): value is DownloadHandle;
79
+ }
80
+ export {};
@@ -1,11 +1,55 @@
1
- import { BlobMetaSchema } from "./blob-meta.js";
2
- export const BlobHandleSchema = {
1
+ /*MIT License
2
+
3
+ © Copyright 2025 Adobe. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.*/
22
+ import { BlobMeta } from "./blob-meta.js";
23
+ const BlobHandleSchema = {
3
24
  type: 'object',
4
25
  properties: {
5
- ...BlobMetaSchema.properties,
26
+ ...BlobMeta.schema.properties,
6
27
  handle: { type: 'string' },
7
28
  expires: { type: 'string' },
29
+ upload: { type: 'boolean' },
30
+ download: { type: 'boolean' },
8
31
  },
9
- required: [...BlobMetaSchema.required, 'handle'],
32
+ required: [...BlobMeta.schema.required, 'handle', 'expires'],
10
33
  };
34
+ export var BlobHandle;
35
+ (function (BlobHandle) {
36
+ BlobHandle.schema = BlobHandleSchema;
37
+ function is(value) {
38
+ return (typeof value === 'object' &&
39
+ value !== null &&
40
+ 'handle' in value &&
41
+ 'expires' in value &&
42
+ typeof value.handle === 'string' &&
43
+ typeof value.expires === 'string');
44
+ }
45
+ BlobHandle.is = is;
46
+ function isUpload(value) {
47
+ return is(value) && 'upload' in value && value.upload === true;
48
+ }
49
+ BlobHandle.isUpload = isUpload;
50
+ function isDownload(value) {
51
+ return is(value) && 'download' in value && value.download === true;
52
+ }
53
+ BlobHandle.isDownload = isDownload;
54
+ })(BlobHandle || (BlobHandle = {}));
11
55
  //# sourceMappingURL=blob-handle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"blob-handle.js","sourceRoot":"","sources":["../../src/blob/blob-handle.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAI1D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,GAAG,cAAc,CAAC,UAAU;QAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC9B;IACD,QAAQ,EAAE,CAAC,GAAG,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"blob-handle.js","sourceRoot":"","sources":["../../src/blob/blob-handle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAGX,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,gBAAgB,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAChC;IACD,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;CACrC,CAAC;AAK5B,MAAM,KAAW,UAAU,CAkB1B;AAlBD,WAAiB,UAAU;IACV,iBAAM,GAAG,gBAAgB,CAAC;IACvC,SAAgB,EAAE,CAAC,KAAc;QAC7B,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,KAAK,IAAI;YACd,QAAQ,IAAI,KAAK;YACjB,SAAS,IAAI,KAAK;YAClB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAChC,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CACpC,CAAC;IACN,CAAC;IATe,aAAE,KASjB,CAAA;IACD,SAAgB,QAAQ,CAAC,KAAc;QACnC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;IACnE,CAAC;IAFe,mBAAQ,WAEvB,CAAA;IACD,SAAgB,UAAU,CAAC,KAAc;QACrC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,UAAU,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;IACvE,CAAC;IAFe,qBAAU,aAEzB,CAAA;AACL,CAAC,EAlBgB,UAAU,KAAV,UAAU,QAkB1B"}
@@ -1,5 +1,5 @@
1
1
  import { FromSchema } from "../schema/schema.js";
2
- export declare const BlobMetaSchema: {
2
+ declare const BlobMetaSchema: {
3
3
  readonly type: "object";
4
4
  readonly properties: {
5
5
  readonly type: {
@@ -21,3 +21,28 @@ export declare const BlobMetaSchema: {
21
21
  readonly required: readonly ["type", "size"];
22
22
  };
23
23
  export type BlobMeta = FromSchema<typeof BlobMetaSchema>;
24
+ export declare namespace BlobMeta {
25
+ const schema: {
26
+ readonly type: "object";
27
+ readonly properties: {
28
+ readonly type: {
29
+ readonly type: "string";
30
+ };
31
+ readonly size: {
32
+ readonly type: "number";
33
+ };
34
+ readonly width: {
35
+ readonly type: "number";
36
+ };
37
+ readonly height: {
38
+ readonly type: "number";
39
+ };
40
+ readonly duration: {
41
+ readonly type: "number";
42
+ };
43
+ };
44
+ readonly required: readonly ["type", "size"];
45
+ };
46
+ function is(value: unknown): value is BlobMeta;
47
+ }
48
+ export {};
@@ -1,4 +1,4 @@
1
- export const BlobMetaSchema = {
1
+ const BlobMetaSchema = {
2
2
  type: 'object',
3
3
  properties: {
4
4
  type: { type: 'string' },
@@ -9,4 +9,17 @@ export const BlobMetaSchema = {
9
9
  },
10
10
  required: ['type', 'size'],
11
11
  };
12
+ export var BlobMeta;
13
+ (function (BlobMeta) {
14
+ BlobMeta.schema = BlobMetaSchema;
15
+ function is(value) {
16
+ return (typeof value === 'object' &&
17
+ value !== null &&
18
+ 'type' in value &&
19
+ 'size' in value &&
20
+ typeof value.type === 'string' &&
21
+ typeof value.size === 'number');
22
+ }
23
+ BlobMeta.is = is;
24
+ })(BlobMeta || (BlobMeta = {}));
12
25
  //# sourceMappingURL=blob-meta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"blob-meta.js","sourceRoot":"","sources":["../../src/blob/blob-meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"blob-meta.js","sourceRoot":"","sources":["../../src/blob/blob-meta.ts"],"names":[],"mappings":"AAuBA,MAAM,cAAc,GAAG;IACnB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;CACH,CAAC;AAG5B,MAAM,KAAW,QAAQ,CAYxB;AAZD,WAAiB,QAAQ;IACR,eAAM,GAAG,cAAc,CAAC;IACrC,SAAgB,EAAE,CAAC,KAAc;QAC7B,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,KAAK,IAAI;YACd,MAAM,IAAI,KAAK;YACf,MAAM,IAAI,KAAK;YACf,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;YAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CACjC,CAAC;IACN,CAAC;IATe,WAAE,KASjB,CAAA;AACL,CAAC,EAZgB,QAAQ,KAAR,QAAQ,QAYxB"}
@@ -1,4 +1,2 @@
1
1
  export * from "./blob-handle.js";
2
2
  export * from "./blob-meta.js";
3
- export * from "./download-handle.js";
4
- export * from "./upload-handle.js";
@@ -1,5 +1,24 @@
1
+ /*MIT License
2
+
3
+ © Copyright 2025 Adobe. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.*/
1
22
  export * from "./blob-handle.js";
2
23
  export * from "./blob-meta.js";
3
- export * from "./download-handle.js";
4
- export * from "./upload-handle.js";
5
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/blob/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/blob/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
@@ -42,11 +42,13 @@ export async function blobToHash(blob) {
42
42
  const writer = digestStream.writable.getWriter();
43
43
  await writer.write(tBytes);
44
44
  const reader = blob.stream().getReader();
45
- while (true) {
46
- const { value, done } = await reader.read();
47
- if (done)
48
- break;
49
- await writer.write(value);
45
+ let done = false;
46
+ while (!done) {
47
+ const result = await reader.read();
48
+ done = result.done;
49
+ if (!done) {
50
+ await writer.write(result.value);
51
+ }
50
52
  }
51
53
  await writer.close();
52
54
  const hashBuf = await digestStream.digest;
@@ -1 +1 @@
1
- {"version":3,"file":"blob-to-hash.js","sourceRoot":"","sources":["../../../../src/cache/functions/hashing/blob-to-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY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