@furystack/entity-sync 3.0.2 → 3.0.4

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/CHANGELOG.md CHANGED
@@ -1,203 +1,219 @@
1
- # Changelog
2
-
3
- ## [3.0.2] - 2026-08-26
4
-
5
- ### ⬆️ Dependencies
6
-
7
- - Updated dependencies
8
- - Raised dev `typescript` to `^7.0.2`. No source changes — dev-tooling bump only.
9
-
10
- ## [3.0.1] - 2026-06-05
11
-
12
- ### 👷 CI
13
-
14
- - Raised the minimum supported Node.js to `>=24.0.0` (Node 24 LTS) in `engines`, dropping Node 22.
15
-
16
- ### 🔧 Chores
17
-
18
- - Patch release to track the workspace `@furystack/core` bump. No source or direct dependency changes in this package.
19
-
20
- ## [3.0.0] - 2026-05-21
21
-
22
- ### 📚 Documentation
23
-
24
- - Rewrote JSDoc on `SyncState` and the shared transport types to follow the new value-test guidance: dropped restate-the-type narration, kept intent / trade-offs / constraints.
25
-
26
- ### 💥 Breaking Changes
27
-
28
- ### `SyncVersion.seq` and `ClientSyncMessage.lastSeq` are now opaque strings
29
-
30
- `seq` is no longer a numeric counter assigned by the server — it is now an **opaque, ordered token** assigned by the underlying `@furystack/cross-node-bus` adapter (integer counters in-process, `<ms>-<n>` Redis Stream ids, etc.). Clients **must not** compare seqs lexicographically or numerically; the only safe operations are equality and round-tripping the value back to the server via `lastSeq`.
31
-
32
- **Affected types:**
33
-
34
- ```typescript
35
- type SyncVersion = {
36
- // ❌ Before
37
- seq: number
38
- // ✅ After
39
- seq: string
40
- timestamp: string
41
- }
42
-
43
- type ClientSyncMessage =
44
- | { type: 'subscribe-entity'; /* ... */ lastSeq?: string /* was: number */ }
45
- | { type: 'subscribe-collection'; /* ... */ lastSeq?: string /* was: number */ }
46
- // ...
47
- ```
48
-
49
- **Impact:** Any code that does arithmetic on `seq` (e.g. `seq + 1`, `seq > previous`) breaks. Any persisted client-side state holding `lastSeq: number` becomes incompatible.
50
-
51
- **Migration:**
52
-
53
- 1. Replace numeric comparisons with equality checks. Adapter-specific ordering, when needed, lives behind the bus's `compareSeq(a, b)` — do not re-implement it.
54
- 2. Treat `seq` as a black-box token: store it, send it back, never inspect it.
55
- 3. Persisted client caches (e.g. `SyncCacheEntry` in `@furystack/entity-sync-client`) carry `lastSeq` typed as `number` from previous versions and will not load. Either drop the cache on upgrade or write a one-shot migration that converts numeric seqs to their string representation.
56
-
57
- ### ⬆️ Dependencies
58
-
59
- - Re-released to pick up the bumped workspace dependency `@furystack/core`. No source changes — version bump only.
60
-
61
- ## [2.0.0] - 2026-04-25
62
-
63
- ### 💥 Breaking Changes
64
-
65
- Version bumped to align with the monorepo-wide functional DI migration. See the [v7 migration guide](../../docs/migrations/v7-functional-di.md) for the full picture.
66
-
67
- - No direct API changes — this package only exports shared protocol types. Downstream consumers in `@furystack/entity-sync-service` and `@furystack/entity-sync-client` have moved to DI tokens; any code that imported types for use with those packages should check their respective changelogs.
68
-
69
- ## [1.0.11] - 2026-04-17
70
-
71
- ### ⬆️ Dependencies
72
-
73
- - Raised the `typescript` devDependency to ^6.0.3 so the package compiles with the same compiler revision as the rest of the monorepo.
74
-
75
- ## [1.0.10] - 2026-03-27
76
-
77
- ### ⬆️ Dependencies
78
-
79
- - Updated `vitest` to ^4.1.2
80
-
81
- ## [1.0.9] - 2026-03-25
82
-
83
- ### 📦 Build
84
-
85
- - Removed deprecated `baseUrl` from tsconfig.json for TypeScript 6 compatibility
86
-
87
- ### ⬆️ Dependencies
88
-
89
- - Upgraded `typescript` from ^5.9.3 to ^6.0.2
90
-
91
- ## [1.0.8] - 2026-03-19
92
-
93
- ### ⬆️ Dependencies
94
-
95
- - Upgraded `vite` from ^7.3.1 to ^8.0.0 for improved build performance and new features
96
- - Upgraded `vitest` from ^4.0.18 to ^4.1.0
97
- - Upgraded `@vitest/coverage-istanbul` from ^4.0.18 to ^4.1.0
98
- - Updated `@furystack/core` dependency to the latest major version.
99
-
100
- ## [1.0.7] - 2026-03-10
101
-
102
- ### ⬆️ Dependencies
103
-
104
- - Updated `@furystack/core` dependency to the new major version
105
-
106
- ## [1.0.6] - 2026-03-07
107
-
108
- ### ⬆️ Dependencies
109
-
110
- - Updated internal FuryStack dependencies
111
-
112
- ## [1.0.5] - 2026-03-06
113
-
114
- ### ⬆️ Dependencies
115
-
116
- - Updated internal FuryStack dependencies
117
-
118
- ## [1.0.4] - 2026-03-03
119
-
120
- ### ⬆️ Dependencies
121
-
122
- - Updated `@furystack/utils` with EventHub listener error handling
123
-
124
- ## [1.0.3] - 2026-02-26
125
-
126
- ### ⬆️ Dependencies
127
-
128
- - Updated internal `@furystack/*` dependencies
129
- - Bumped due to updated workspace dependencies
130
-
131
- ## [1.0.2] - 2026-02-26
132
-
133
- ### ⬆️ Dependencies
134
-
135
- - Updated `@furystack/rest-service` dependency
136
-
137
- ## [1.0.1] - 2026-02-22
138
-
139
- ### ⬆️ Dependencies
140
-
141
- - Updated `@furystack/core` dependency
142
-
143
- ## [1.0.0] - 2026-02-22
144
-
145
- ### 💥 Breaking Changes
146
-
147
- ### Added `collection-snapshot` variant to `ServerSyncMessage`
148
-
149
- A new `collection-snapshot` variant has been added to the `ServerSyncMessage` union type. The server now sends a full snapshot (entries + count) whenever a collection changes, instead of individual diff messages. This ensures entries and count are always delivered together as a consistent unit.
150
-
151
- Consumers that exhaustively match on `ServerSyncMessage.type` (without a `default`) must add a `collection-snapshot` case.
152
-
153
- **Examples:**
154
-
155
- ```typescript
156
- // ✅ Handle the new collection-snapshot message
157
- switch (message.type) {
158
- case 'collection-snapshot':
159
- console.log(message.data, message.totalCount)
160
- break
161
- // ... other cases
162
- }
163
- ```
164
-
165
- **Impact:** Consumers that exhaustively match on `ServerSyncMessage.type` (without a `default`) will get a compile error until the new case is handled.
166
-
167
- ### ✨ Features
168
-
169
- ### Total count support for collection sync messages
170
-
171
- - Added optional `totalCount` field to `snapshot` and `delta` server messages, reporting the total number of matching entities (ignoring `top`/`skip` pagination)
172
- - Added `collection-snapshot` message type that delivers a full re-sync (entries + count) when a collection changes
173
-
174
- ## [0.1.1] - 2026-02-19
175
-
176
- ### ⬆️ Dependencies
177
-
178
- - Updated `@furystack/core`
179
-
180
- ## [0.1.0] - 2026-02-12
181
-
182
- ### ✨ Features
183
-
184
- ### New package: shared protocol types for entity synchronization
185
-
186
- Initial release of `@furystack/entity-sync`, providing the TypeScript types for the WebSocket-based entity synchronization protocol used between `@furystack/entity-sync-client` and `@furystack/entity-sync-service`.
187
-
188
- Key types:
189
-
190
- - `SyncVersion` — sequence number and timestamp metadata for change ordering
191
- - `SyncChangeEntry` — discriminated union for added/updated/removed entity changes
192
- - `ClientSyncMessage` — messages from client to server (subscribe-entity, subscribe-collection, unsubscribe)
193
- - `ServerSyncMessage` — messages from server to client (subscribed snapshot/delta, incremental changes, errors)
194
- - `SyncState<T>` — client-side discriminated union for subscription state (connecting, cached, suspended, synced, error)
195
-
196
- ### ⬆️ Dependencies
197
-
198
- - Added `@furystack/core` (workspace:^) as a dependency
199
-
200
- All notable changes to the `@furystack/entity-sync` will be documented in this file.
201
-
202
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
203
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1
+ # Changelog
2
+
3
+ ## [3.0.4] - 2026-11-14
4
+
5
+ ### Dependencies
6
+
7
+ - Patch release to include updated FuryStack dependency versions
8
+
9
+ ### ⬆️ Dependencies
10
+
11
+ - Updated dependencies
12
+
13
+ ## [3.0.3] - 2026-09-18
14
+
15
+ ### ⬆️ Dependencies
16
+
17
+ - Updated dependencies
18
+
19
+ ## [3.0.2] - 2026-08-26
20
+
21
+ ### ⬆️ Dependencies
22
+
23
+ - Updated dependencies
24
+ - Raised dev `typescript` to `^7.0.2`. No source changes — dev-tooling bump only.
25
+
26
+ ## [3.0.1] - 2026-06-05
27
+
28
+ ### 👷 CI
29
+
30
+ - Raised the minimum supported Node.js to `>=24.0.0` (Node 24 LTS) in `engines`, dropping Node 22.
31
+
32
+ ### 🔧 Chores
33
+
34
+ - Patch release to track the workspace `@furystack/core` bump. No source or direct dependency changes in this package.
35
+
36
+ ## [3.0.0] - 2026-05-21
37
+
38
+ ### 📚 Documentation
39
+
40
+ - Rewrote JSDoc on `SyncState` and the shared transport types to follow the new value-test guidance: dropped restate-the-type narration, kept intent / trade-offs / constraints.
41
+
42
+ ### 💥 Breaking Changes
43
+
44
+ ### `SyncVersion.seq` and `ClientSyncMessage.lastSeq` are now opaque strings
45
+
46
+ `seq` is no longer a numeric counter assigned by the server — it is now an **opaque, ordered token** assigned by the underlying `@furystack/cross-node-bus` adapter (integer counters in-process, `<ms>-<n>` Redis Stream ids, etc.). Clients **must not** compare seqs lexicographically or numerically; the only safe operations are equality and round-tripping the value back to the server via `lastSeq`.
47
+
48
+ **Affected types:**
49
+
50
+ ```typescript
51
+ type SyncVersion = {
52
+ // ❌ Before
53
+ seq: number
54
+ // ✅ After
55
+ seq: string
56
+ timestamp: string
57
+ }
58
+
59
+ type ClientSyncMessage =
60
+ | { type: 'subscribe-entity'; /* ... */ lastSeq?: string /* was: number */ }
61
+ | { type: 'subscribe-collection'; /* ... */ lastSeq?: string /* was: number */ }
62
+ // ...
63
+ ```
64
+
65
+ **Impact:** Any code that does arithmetic on `seq` (e.g. `seq + 1`, `seq > previous`) breaks. Any persisted client-side state holding `lastSeq: number` becomes incompatible.
66
+
67
+ **Migration:**
68
+
69
+ 1. Replace numeric comparisons with equality checks. Adapter-specific ordering, when needed, lives behind the bus's `compareSeq(a, b)` — do not re-implement it.
70
+ 2. Treat `seq` as a black-box token: store it, send it back, never inspect it.
71
+ 3. Persisted client caches (e.g. `SyncCacheEntry` in `@furystack/entity-sync-client`) carry `lastSeq` typed as `number` from previous versions and will not load. Either drop the cache on upgrade or write a one-shot migration that converts numeric seqs to their string representation.
72
+
73
+ ### ⬆️ Dependencies
74
+
75
+ - Re-released to pick up the bumped workspace dependency `@furystack/core`. No source changes — version bump only.
76
+
77
+ ## [2.0.0] - 2026-04-25
78
+
79
+ ### 💥 Breaking Changes
80
+
81
+ Version bumped to align with the monorepo-wide functional DI migration. See the [v7 migration guide](../../docs/migrations/v7-functional-di.md) for the full picture.
82
+
83
+ - No direct API changes — this package only exports shared protocol types. Downstream consumers in `@furystack/entity-sync-service` and `@furystack/entity-sync-client` have moved to DI tokens; any code that imported types for use with those packages should check their respective changelogs.
84
+
85
+ ## [1.0.11] - 2026-04-17
86
+
87
+ ### ⬆️ Dependencies
88
+
89
+ - Raised the `typescript` devDependency to ^6.0.3 so the package compiles with the same compiler revision as the rest of the monorepo.
90
+
91
+ ## [1.0.10] - 2026-03-27
92
+
93
+ ### ⬆️ Dependencies
94
+
95
+ - Updated `vitest` to ^4.1.2
96
+
97
+ ## [1.0.9] - 2026-03-25
98
+
99
+ ### 📦 Build
100
+
101
+ - Removed deprecated `baseUrl` from tsconfig.json for TypeScript 6 compatibility
102
+
103
+ ### ⬆️ Dependencies
104
+
105
+ - Upgraded `typescript` from ^5.9.3 to ^6.0.2
106
+
107
+ ## [1.0.8] - 2026-03-19
108
+
109
+ ### ⬆️ Dependencies
110
+
111
+ - Upgraded `vite` from ^7.3.1 to ^8.0.0 for improved build performance and new features
112
+ - Upgraded `vitest` from ^4.0.18 to ^4.1.0
113
+ - Upgraded `@vitest/coverage-istanbul` from ^4.0.18 to ^4.1.0
114
+ - Updated `@furystack/core` dependency to the latest major version.
115
+
116
+ ## [1.0.7] - 2026-03-10
117
+
118
+ ### ⬆️ Dependencies
119
+
120
+ - Updated `@furystack/core` dependency to the new major version
121
+
122
+ ## [1.0.6] - 2026-03-07
123
+
124
+ ### ⬆️ Dependencies
125
+
126
+ - Updated internal FuryStack dependencies
127
+
128
+ ## [1.0.5] - 2026-03-06
129
+
130
+ ### ⬆️ Dependencies
131
+
132
+ - Updated internal FuryStack dependencies
133
+
134
+ ## [1.0.4] - 2026-03-03
135
+
136
+ ### ⬆️ Dependencies
137
+
138
+ - Updated `@furystack/utils` with EventHub listener error handling
139
+
140
+ ## [1.0.3] - 2026-02-26
141
+
142
+ ### ⬆️ Dependencies
143
+
144
+ - Updated internal `@furystack/*` dependencies
145
+ - Bumped due to updated workspace dependencies
146
+
147
+ ## [1.0.2] - 2026-02-26
148
+
149
+ ### ⬆️ Dependencies
150
+
151
+ - Updated `@furystack/rest-service` dependency
152
+
153
+ ## [1.0.1] - 2026-02-22
154
+
155
+ ### ⬆️ Dependencies
156
+
157
+ - Updated `@furystack/core` dependency
158
+
159
+ ## [1.0.0] - 2026-02-22
160
+
161
+ ### 💥 Breaking Changes
162
+
163
+ ### Added `collection-snapshot` variant to `ServerSyncMessage`
164
+
165
+ A new `collection-snapshot` variant has been added to the `ServerSyncMessage` union type. The server now sends a full snapshot (entries + count) whenever a collection changes, instead of individual diff messages. This ensures entries and count are always delivered together as a consistent unit.
166
+
167
+ Consumers that exhaustively match on `ServerSyncMessage.type` (without a `default`) must add a `collection-snapshot` case.
168
+
169
+ **Examples:**
170
+
171
+ ```typescript
172
+ // ✅ Handle the new collection-snapshot message
173
+ switch (message.type) {
174
+ case 'collection-snapshot':
175
+ console.log(message.data, message.totalCount)
176
+ break
177
+ // ... other cases
178
+ }
179
+ ```
180
+
181
+ **Impact:** Consumers that exhaustively match on `ServerSyncMessage.type` (without a `default`) will get a compile error until the new case is handled.
182
+
183
+ ### ✨ Features
184
+
185
+ ### Total count support for collection sync messages
186
+
187
+ - Added optional `totalCount` field to `snapshot` and `delta` server messages, reporting the total number of matching entities (ignoring `top`/`skip` pagination)
188
+ - Added `collection-snapshot` message type that delivers a full re-sync (entries + count) when a collection changes
189
+
190
+ ## [0.1.1] - 2026-02-19
191
+
192
+ ### ⬆️ Dependencies
193
+
194
+ - Updated `@furystack/core`
195
+
196
+ ## [0.1.0] - 2026-02-12
197
+
198
+ ### ✨ Features
199
+
200
+ ### New package: shared protocol types for entity synchronization
201
+
202
+ Initial release of `@furystack/entity-sync`, providing the TypeScript types for the WebSocket-based entity synchronization protocol used between `@furystack/entity-sync-client` and `@furystack/entity-sync-service`.
203
+
204
+ Key types:
205
+
206
+ - `SyncVersion` — sequence number and timestamp metadata for change ordering
207
+ - `SyncChangeEntry` — discriminated union for added/updated/removed entity changes
208
+ - `ClientSyncMessage` — messages from client to server (subscribe-entity, subscribe-collection, unsubscribe)
209
+ - `ServerSyncMessage` — messages from server to client (subscribed snapshot/delta, incremental changes, errors)
210
+ - `SyncState<T>` — client-side discriminated union for subscription state (connecting, cached, suspended, synced, error)
211
+
212
+ ### ⬆️ Dependencies
213
+
214
+ - Added `@furystack/core` (workspace:^) as a dependency
215
+
216
+ All notable changes to the `@furystack/entity-sync` will be documented in this file.
217
+
218
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
219
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).