Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ Adobe Data Oriented Programming Library

Until we reach 1.0.0, minor version changes may be API breaking.

### 0.9.77

**`ephemeral` fully removed — use `nonPersistent`**

The `ephemeral` name (deprecated in 0.9.70) is gone entirely: `Schema.ephemeral`, the `"ephemeral"` component alias, and `Entity.isEphemeral`. Use `nonPersistent` / `Entity.isNonPersistent`.

```ts
// before
{ ..., ephemeral: true }
ensureArchetype(["id", "cursor", "ephemeral"])
// after
{ ..., nonPersistent: true }
ensureArchetype(["id", "cursor", "nonPersistent"])
```

**Store snapshot format changed and is now versioned**

`db.toData()` / `store.toData()` output is now stamped with `version: ECS_SNAPSHOT_VERSION` (currently `1`), and `fromData` ignores any snapshot whose version does not match. Two consequences:

- nonPersistent resources/entities are correctly excluded from snapshots (previously a nonPersistent resource could deserialize to `undefined`).
- Snapshots produced by earlier versions (which carried no `version` field) are no longer loaded — `fromData` logs a `console.warn` and silently keeps the current (freshly-constructed) state instead of reconstructing incorrectly. Discard and regenerate persisted snapshots.

This only affects the `toData`/`fromData` snapshot path (e.g. `createStoragePersistenceService`). The `@adobe/data-persistence` incremental journal format is unaffected.

### 0.9.70

**`TransactionResult.ephemeral` → `TransactionResult.persistent` (inverted)**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-monorepo",
"version": "0.9.76",
"version": "0.9.77",
"private": true,
"scripts": {
"build": "pnpm -r run build",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-ai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-ai",
"version": "0.9.76",
"version": "0.9.77",
"description": "Cross-agent architecture skills for @adobe/data — installable as a Claude Code plugin or copied into any Agent-Skills-compatible agent (Cursor, Codex).",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-gpu-samples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-gpu-samples",
"version": "0.9.76",
"version": "0.9.77",
"description": "WebGPU samples built on @adobe/data-gpu",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-gpu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-gpu",
"version": "0.9.76",
"version": "0.9.77",
"description": "Adobe data WebGPU plugins and types for graphics and compute",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit-tictactoe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-lit-tictactoe",
"version": "0.9.76",
"version": "0.9.77",
"description": "Tic-Tac-Toe sample - Lit web components with @adobe/data-lit and AgenticService",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit-todo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-lit-todo",
"version": "0.9.76",
"version": "0.9.77",
"description": "Todo sample app demonstrating @adobe/data with Lit",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-lit",
"version": "0.9.76",
"version": "0.9.77",
"description": "Adobe data Lit bindings - hooks, elements, decorators",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-p2p-tictactoe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-p2p-tictactoe",
"version": "0.9.76",
"version": "0.9.77",
"description": "Serverless P2P tic-tac-toe — WebRTC DataChannel + @adobe/data-sync",
"type": "module",
"private": true,
Expand Down
26 changes: 13 additions & 13 deletions packages/data-p2p-tictactoe/src/state/negotiation-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export type ConnectionState = "idle" | "connecting" | "connected" | "disconnecte

/**
* Negotiation-only ECS state — resources + transactions. All resources are
* `ephemeral: true` so they are never replicated to peers (the negotiation DB
* itself is always local-only, but the ephemeral flag is good documentation).
* `nonPersistent: true` so they are never replicated to peers (the negotiation DB
* itself is always local-only, but the flag is good documentation).
*
* The game role (userId) lives in the synced game DB referenced by the
* `gameDb` resource. Once the WebRTC handshake completes, the negotiation
Expand All @@ -21,23 +21,23 @@ export type ConnectionState = "idle" | "connecting" | "connected" | "disconnecte
*/
export const negotiationStatePlugin = Database.Plugin.create({
resources: {
phase: { default: "idle" as Phase, ephemeral: true },
connection: { default: "idle" as ConnectionState, ephemeral: true },
role: { default: null as "host" | "joiner" | null, ephemeral: true },
sessionId: { default: null as string | null, ephemeral: true },
offerCode: { default: "" as string, ephemeral: true },
answerCode: { default: "" as string, ephemeral: true },
bannerText: { default: "" as string, ephemeral: true },
bannerError: { default: false as boolean, ephemeral: true },
phase: { default: "idle" as Phase, nonPersistent: true },
connection: { default: "idle" as ConnectionState, nonPersistent: true },
role: { default: null as "host" | "joiner" | null, nonPersistent: true },
sessionId: { default: null as string | null, nonPersistent: true },
offerCode: { default: "" as string, nonPersistent: true },
answerCode: { default: "" as string, nonPersistent: true },
bannerText: { default: "" as string, nonPersistent: true },
bannerError: { default: false as boolean, nonPersistent: true },
// Live values of the two paste textareas. Backing them with
// resources keeps the textareas controlled and avoids touching
// the DOM from action callbacks.
hostAnswerInput: { default: "" as string, ephemeral: true },
joinerOfferInput: { default: "" as string, ephemeral: true },
hostAnswerInput: { default: "" as string, nonPersistent: true },
joinerOfferInput: { default: "" as string, nonPersistent: true },
// The synced game database, populated by the negotiation service
// after the WebRTC channel opens. `unknown` so the plugin stays
// game-agnostic; consumers cast at the render boundary.
gameDb: { default: null as unknown, ephemeral: true },
gameDb: { default: null as unknown, nonPersistent: true },
},
transactions: {
startHostSignaling(t) {
Expand Down
2 changes: 1 addition & 1 deletion packages/data-persistence/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-persistence",
"version": "0.9.76",
"version": "0.9.77",
"description": "Worker-based incremental persistence layer for @adobe/data ECS over OPFS (browser) and node:fs (server).",
"type": "module",
"sideEffects": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// © 2026 Adobe. MIT License. See /LICENSE for details.

import type { Archetype } from "@adobe/data/ecs";
import { ECS_SNAPSHOT_VERSION, type Archetype } from "@adobe/data/ecs";
import { createColumnEncoder } from "../encoder/create-column-encoder.js";
import {
decodeJournalSnapshot,
Expand Down Expand Up @@ -980,6 +980,7 @@ export const createIncrementalPersistenceService = async (
}

store.fromData({
version: ECS_SNAPSHOT_VERSION,
componentSchemas: {},
entityLocationTableData: { entities, freeListHead, nextIndex, capacity },
archetypesData: [],
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react-hello/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-react-hello",
"version": "0.9.76",
"version": "0.9.77",
"description": "Hello World sample - click counter using @adobe/data-react",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react-pixie/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-react-pixie",
"version": "0.9.76",
"version": "0.9.77",
"description": "PixiJS React sample - ECS sprites (bunny, fox) with @adobe/data-react",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-react",
"version": "0.9.76",
"version": "0.9.77",
"description": "Adobe data React bindings — hooks and context for ECS database",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-solid-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-solid-dashboard",
"version": "0.9.76",
"version": "0.9.77",
"description": "Mini dashboard sample — multiple components sharing one @adobe/data ECS database with SolidJS",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-solid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-solid",
"version": "0.9.76",
"version": "0.9.77",
"description": "Adobe data SolidJS bindings — context and provider for ECS database",
"type": "module",
"private": false,
Expand Down
12 changes: 6 additions & 6 deletions packages/data-sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ db.transactions.movePresence(async function* () {
The transaction never commits; every yield is a transient envelope; sync
forwards each to peers; peers see continuously-updated presence state.

### Ephemeral resources stay local
### nonPersistent resources stay local

Resources marked `ephemeral: true` in their schema (or entities allocated
with the built-in `ephemeral` component) produce transactions whose
`TransactionResult.ephemeral === true`. The sync service skips those
Resources marked `nonPersistent: true` in their schema (or entities allocated
with the built-in `nonPersistent` component) produce transactions whose
`TransactionResult.persistent === false`. The sync service skips those
envelopes entirely — they never reach the wire. Use this for per-tab UI
state (selection, panel positions, signaling intermediaries, etc.) without
inventing a second database.
Expand Down Expand Up @@ -405,7 +405,7 @@ default.

### Pattern: per-user state archetypes

Model user-specific ephemeral state (cursors, selections, presence) as its
Model user-specific nonPersistent state (cursors, selections, presence) as its
own archetype keyed by `userId`. This avoids all contention: each user only
ever writes to their own row.

Expand Down Expand Up @@ -642,5 +642,5 @@ expect(db.select(["x"]).length).toBe(1);
```

See `src/sync.test.ts` for the full soundness suite, including concurrent
insert ordering, late-join convergence, ephemeral-no-replicate, and
insert ordering, late-join convergence, nonPersistent-no-replicate, and
compound `(userId, id)` isolation.
2 changes: 1 addition & 1 deletion packages/data-sync/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-sync",
"version": "0.9.76",
"version": "0.9.77",
"description": "Multi-user real-time synchronisation for @adobe/data ECS — server, client, and in-process loopback.",
"type": "module",
"sideEffects": false,
Expand Down
16 changes: 8 additions & 8 deletions packages/data-sync/src/sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const plugin = Database.Plugin.create({
resources: {
// Synced resource — replicates to peers.
score: { default: 0 as number },
// Local-only resource — never replicates because of `ephemeral: true`.
// (Verified by the "ephemeral resource never replicates" test below.)
bannerText: { default: "" as string, ephemeral: true },
// Local-only resource — never replicates because of `nonPersistent: true`.
// (Verified by the "nonPersistent resource never replicates" test below.)
bannerText: { default: "" as string, nonPersistent: true },
},
archetypes: {
Point: ["x", "y", "label"],
Expand Down Expand Up @@ -188,13 +188,13 @@ describe("sync soundness", () => {
});

// -----------------------------------------------------------------------
// 5. Ephemeral resource never replicates.
// Red-green: this is the semantic guarantee that ephemeral: true
// 5. NonPersistent resource never replicates.
// Red-green: this is the semantic guarantee that nonPersistent: true
// resources stay local. Sync service skips envelopes whose
// TransactionResult.ephemeral === true.
// TransactionResult.nonPersistent === true.
// -----------------------------------------------------------------------

it("ephemeral resource mutations are never replicated to peers", () => {
it("nonPersistent resource mutations are never replicated to peers", () => {
const server = createSyncServer();
const { client: c1t, server: s1t } = createLoopbackTransport();
const { client: c2t, server: s2t } = createLoopbackTransport();
Expand All @@ -215,7 +215,7 @@ describe("sync soundness", () => {
// Peer 2 must NOT see it.
expect(db2.resources.bannerText).toBe("");

// Sanity check: a non-ephemeral mutation in the same session DOES replicate.
// Sanity check: a non-nonPersistent mutation in the same session DOES replicate.
db1.transactions.bumpScore({ delta: 5 });
expect(db1.resources.score).toBe(5);
expect(db2.resources.score).toBe(5);
Expand Down
2 changes: 1 addition & 1 deletion packages/data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data",
"version": "0.9.76",
"version": "0.9.77",
"description": "Adobe data oriented programming library",
"type": "module",
"sideEffects": false,
Expand Down
Loading