Commit 98bb88b
committed
feat: add runtime deprecation warnings for handler return values
Based on external code review feedback, this commit implements a soft deprecation
strategy for mutation handler return values:
Runtime changes:
- Add console warnings when QueryCollection handlers return { refetch }
- Add console warnings when Electric handlers return { txid }
- Keep runtime functionality intact for backward compatibility
- Runtime support will be removed in v1.0 RC
Type improvements:
- Mark TReturn generic as @internal and deprecated across all mutation types
- Clarify that it exists only for backward compatibility
Documentation improvements:
- Clarify Electric JSDoc: handlers return Promise<void> but must not RESOLVE
until synchronization is complete (avoiding "void but not void" confusion)
- Add timeout error handling example showing policy choices (rollback vs
eventual consistency)
- Update changeset to clearly communicate this is a soft deprecation
This aligns with the review recommendation for a gradual migration path with
clear runtime feedback to help users migrate to the new explicit patterns.1 parent b44463f commit 98bb88b
File tree
4 files changed
+102
-17
lines changed- .changeset
- packages
- db/src
- electric-db-collection/src
- query-db-collection/src
4 files changed
+102
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
13 | | - | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
366 | 369 | | |
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
370 | 373 | | |
371 | 374 | | |
372 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
373 | 379 | | |
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
380 | 389 | | |
381 | 390 | | |
382 | 391 | | |
| |||
413 | 422 | | |
414 | 423 | | |
415 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
416 | 430 | | |
417 | 431 | | |
418 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | | - | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
157 | 179 | | |
158 | 180 | | |
159 | 181 | | |
| |||
185 | 207 | | |
186 | 208 | | |
187 | 209 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
192 | 216 | | |
193 | 217 | | |
194 | | - | |
| 218 | + | |
195 | 219 | | |
196 | 220 | | |
197 | 221 | | |
| |||
225 | 249 | | |
226 | 250 | | |
227 | 251 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
232 | 258 | | |
233 | 259 | | |
234 | | - | |
| 260 | + | |
235 | 261 | | |
236 | 262 | | |
237 | 263 | | |
| |||
584 | 610 | | |
585 | 611 | | |
586 | 612 | | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
587 | 620 | | |
588 | 621 | | |
589 | 622 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1036 | 1046 | | |
1037 | 1047 | | |
1038 | 1048 | | |
| |||
1047 | 1057 | | |
1048 | 1058 | | |
1049 | 1059 | | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1050 | 1070 | | |
1051 | 1071 | | |
1052 | 1072 | | |
| |||
1061 | 1081 | | |
1062 | 1082 | | |
1063 | 1083 | | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1064 | 1094 | | |
1065 | 1095 | | |
1066 | 1096 | | |
| |||
0 commit comments