@furystack/entity-sync 3.0.3 → 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,209 +1,219 @@
1
- # Changelog
2
-
3
- ## [3.0.3] - 2026-09-18
4
-
5
- ### ⬆️ Dependencies
6
-
7
- - Updated dependencies
8
-
9
- ## [3.0.2] - 2026-08-26
10
-
11
- ### ⬆️ Dependencies
12
-
13
- - Updated dependencies
14
- - Raised dev `typescript` to `^7.0.2`. No source changes — dev-tooling bump only.
15
-
16
- ## [3.0.1] - 2026-06-05
17
-
18
- ### 👷 CI
19
-
20
- - Raised the minimum supported Node.js to `>=24.0.0` (Node 24 LTS) in `engines`, dropping Node 22.
21
-
22
- ### 🔧 Chores
23
-
24
- - Patch release to track the workspace `@furystack/core` bump. No source or direct dependency changes in this package.
25
-
26
- ## [3.0.0] - 2026-05-21
27
-
28
- ### 📚 Documentation
29
-
30
- - 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.
31
-
32
- ### 💥 Breaking Changes
33
-
34
- ### `SyncVersion.seq` and `ClientSyncMessage.lastSeq` are now opaque strings
35
-
36
- `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`.
37
-
38
- **Affected types:**
39
-
40
- ```typescript
41
- type SyncVersion = {
42
- // ❌ Before
43
- seq: number
44
- // ✅ After
45
- seq: string
46
- timestamp: string
47
- }
48
-
49
- type ClientSyncMessage =
50
- | { type: 'subscribe-entity'; /* ... */ lastSeq?: string /* was: number */ }
51
- | { type: 'subscribe-collection'; /* ... */ lastSeq?: string /* was: number */ }
52
- // ...
53
- ```
54
-
55
- **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.
56
-
57
- **Migration:**
58
-
59
- 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.
60
- 2. Treat `seq` as a black-box token: store it, send it back, never inspect it.
61
- 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.
62
-
63
- ### ⬆️ Dependencies
64
-
65
- - Re-released to pick up the bumped workspace dependency `@furystack/core`. No source changes — version bump only.
66
-
67
- ## [2.0.0] - 2026-04-25
68
-
69
- ### 💥 Breaking Changes
70
-
71
- 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.
72
-
73
- - 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.
74
-
75
- ## [1.0.11] - 2026-04-17
76
-
77
- ### ⬆️ Dependencies
78
-
79
- - Raised the `typescript` devDependency to ^6.0.3 so the package compiles with the same compiler revision as the rest of the monorepo.
80
-
81
- ## [1.0.10] - 2026-03-27
82
-
83
- ### ⬆️ Dependencies
84
-
85
- - Updated `vitest` to ^4.1.2
86
-
87
- ## [1.0.9] - 2026-03-25
88
-
89
- ### 📦 Build
90
-
91
- - Removed deprecated `baseUrl` from tsconfig.json for TypeScript 6 compatibility
92
-
93
- ### ⬆️ Dependencies
94
-
95
- - Upgraded `typescript` from ^5.9.3 to ^6.0.2
96
-
97
- ## [1.0.8] - 2026-03-19
98
-
99
- ### ⬆️ Dependencies
100
-
101
- - Upgraded `vite` from ^7.3.1 to ^8.0.0 for improved build performance and new features
102
- - Upgraded `vitest` from ^4.0.18 to ^4.1.0
103
- - Upgraded `@vitest/coverage-istanbul` from ^4.0.18 to ^4.1.0
104
- - Updated `@furystack/core` dependency to the latest major version.
105
-
106
- ## [1.0.7] - 2026-03-10
107
-
108
- ### ⬆️ Dependencies
109
-
110
- - Updated `@furystack/core` dependency to the new major version
111
-
112
- ## [1.0.6] - 2026-03-07
113
-
114
- ### ⬆️ Dependencies
115
-
116
- - Updated internal FuryStack dependencies
117
-
118
- ## [1.0.5] - 2026-03-06
119
-
120
- ### ⬆️ Dependencies
121
-
122
- - Updated internal FuryStack dependencies
123
-
124
- ## [1.0.4] - 2026-03-03
125
-
126
- ### ⬆️ Dependencies
127
-
128
- - Updated `@furystack/utils` with EventHub listener error handling
129
-
130
- ## [1.0.3] - 2026-02-26
131
-
132
- ### ⬆️ Dependencies
133
-
134
- - Updated internal `@furystack/*` dependencies
135
- - Bumped due to updated workspace dependencies
136
-
137
- ## [1.0.2] - 2026-02-26
138
-
139
- ### ⬆️ Dependencies
140
-
141
- - Updated `@furystack/rest-service` dependency
142
-
143
- ## [1.0.1] - 2026-02-22
144
-
145
- ### ⬆️ Dependencies
146
-
147
- - Updated `@furystack/core` dependency
148
-
149
- ## [1.0.0] - 2026-02-22
150
-
151
- ### 💥 Breaking Changes
152
-
153
- ### Added `collection-snapshot` variant to `ServerSyncMessage`
154
-
155
- 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.
156
-
157
- Consumers that exhaustively match on `ServerSyncMessage.type` (without a `default`) must add a `collection-snapshot` case.
158
-
159
- **Examples:**
160
-
161
- ```typescript
162
- // ✅ Handle the new collection-snapshot message
163
- switch (message.type) {
164
- case 'collection-snapshot':
165
- console.log(message.data, message.totalCount)
166
- break
167
- // ... other cases
168
- }
169
- ```
170
-
171
- **Impact:** Consumers that exhaustively match on `ServerSyncMessage.type` (without a `default`) will get a compile error until the new case is handled.
172
-
173
- ### ✨ Features
174
-
175
- ### Total count support for collection sync messages
176
-
177
- - Added optional `totalCount` field to `snapshot` and `delta` server messages, reporting the total number of matching entities (ignoring `top`/`skip` pagination)
178
- - Added `collection-snapshot` message type that delivers a full re-sync (entries + count) when a collection changes
179
-
180
- ## [0.1.1] - 2026-02-19
181
-
182
- ### ⬆️ Dependencies
183
-
184
- - Updated `@furystack/core`
185
-
186
- ## [0.1.0] - 2026-02-12
187
-
188
- ### ✨ Features
189
-
190
- ### New package: shared protocol types for entity synchronization
191
-
192
- 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`.
193
-
194
- Key types:
195
-
196
- - `SyncVersion` — sequence number and timestamp metadata for change ordering
197
- - `SyncChangeEntry` — discriminated union for added/updated/removed entity changes
198
- - `ClientSyncMessage` — messages from client to server (subscribe-entity, subscribe-collection, unsubscribe)
199
- - `ServerSyncMessage` — messages from server to client (subscribed snapshot/delta, incremental changes, errors)
200
- - `SyncState<T>` — client-side discriminated union for subscription state (connecting, cached, suspended, synced, error)
201
-
202
- ### ⬆️ Dependencies
203
-
204
- - Added `@furystack/core` (workspace:^) as a dependency
205
-
206
- All notable changes to the `@furystack/entity-sync` will be documented in this file.
207
-
208
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
209
- 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).