|
1 | 1 | # @evolu/common |
2 | 2 |
|
| 3 | +## 6.0.1-preview.26 |
| 4 | + |
| 5 | +### Patch Changes |
| 6 | + |
| 7 | +- f4a8866: Add owner usage tracking and storage improvements |
| 8 | + |
| 9 | + ### Breaking Changes |
| 10 | + - Renamed `TransportConfig` to `OwnerTransport` and `WebSocketTransportConfig` to `OwnerWebSocketTransport` for clearer naming |
| 11 | + - Renamed `SqliteStorageBase` to `BaseSqliteStorage` and `createSqliteStorageBase` to `createBaseSqliteStorage` |
| 12 | + - Extracted storage table creation into separate functions: `createBaseSqliteStorageTables` and `createRelayStorageTables` to support serverless deployments where table setup must be separate from storage operations |
| 13 | + - Removed `assertNoErrorInCatch` - it was unnecessary |
| 14 | + |
| 15 | + ### Features |
| 16 | + - **Owner usage tracking** (in progress): Added `evolu_usage` table and `OwnerUsage` interface to track data consumption metrics per owner (stored bytes, received bytes, sent bytes, first/last timestamps). Table structure is in place but not yet fully implemented |
| 17 | + - **Timestamp privacy documentation**: Added privacy considerations explaining that timestamps are metadata visible to relays, with guidance on implementing local write queues for maximum privacy |
| 18 | + - **React Native polyfills**: Added polyfills for `AbortSignal.any()` and `AbortSignal.timeout()` to support Task cancellation on React Native platforms that don't yet implement these APIs |
| 19 | + |
| 20 | + ### Performance |
| 21 | + - **isSqlMutation optimization**: Added LRU cache (10,000 entries) to `isSqlMutation` function, restoring Timestamp insert benchmark from 34k back to 57k inserts/sec. |
| 22 | + |
| 23 | +- 02e8aa0: Evolu identicons |
| 24 | + |
| 25 | + Added `createIdenticon` function for generating visually distinct SVG identicons from Evolu `Id` (including branded IDs like `OwnerId`, etc.). For user avatars, visual identity markers, and differentiating entities in UI without storing images. |
| 26 | + |
| 27 | + ### Features |
| 28 | + - **Multiple styles**: Choose from 4 styles: |
| 29 | + - `"github"` (default): 5×5 grid with horizontal mirroring, inspired by GitHub avatars |
| 30 | + - `"quadrant"`: 2×2 color block grid with direct RGB mapping |
| 31 | + - `"gradient"`: Diagonal stripe pattern with smooth color gradients |
| 32 | + - `"sutnar"`: Ladislav Sutnar-inspired compositional design with adaptive colors |
| 33 | + - **SVG output**: Returns SVG string that can be used directly |
| 34 | + |
| 35 | + ### Example |
| 36 | + |
| 37 | + ```ts |
| 38 | + import { createIdenticon } from "@evolu/common"; |
| 39 | + |
| 40 | + // Basic usage with default GitHub style |
| 41 | + const svg = createIdenticon(userId); |
| 42 | + |
| 43 | + const quadrant = createIdenticon(ownerId, "quadrant"); |
| 44 | + const gradient = createIdenticon(postId, "gradient"); |
| 45 | + const sutnar = createIdenticon(teamId, "sutnar"); |
| 46 | + ``` |
| 47 | + |
| 48 | +- 31d0d21: Add Cache module with generic cache interface and LRU cache implementation |
| 49 | + - New `Cache<K, V>` interface with `has`, `get`, `set`, `delete` methods |
| 50 | + - New `createLruCache` factory function for creating LRU caches with configurable capacity |
| 51 | + - Keys are compared by reference (standard Map semantics) |
| 52 | + - LRU cache automatically evicts least recently used entries when capacity is reached |
| 53 | + - Both `get` and `set` operations update access order |
| 54 | + - Exposes readonly `map` property for iteration and inspection |
| 55 | + |
| 56 | + Example: |
| 57 | + |
| 58 | + ```ts |
| 59 | + const cache = createLruCache<string, number>(2); |
| 60 | + cache.set("a", 1); |
| 61 | + cache.set("b", 2); |
| 62 | + cache.set("c", 3); // Evicts "a" |
| 63 | + cache.has("a"); // false |
| 64 | + ``` |
| 65 | + |
3 | 66 | ## 6.0.1-preview.25 |
4 | 67 |
|
5 | 68 | ### Patch Changes |
|
0 commit comments