atom.io 0.19.0 → 0.19.2

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.
Files changed (110) hide show
  1. package/data/dist/index.cjs +99 -79
  2. package/data/dist/index.js +2 -2
  3. package/data/src/join.ts +91 -74
  4. package/dist/{chunk-YDOGCZ53.js → chunk-ATKDGVTV.js} +29 -29
  5. package/dist/{chunk-CVBEVTM5.js → chunk-CC7IF7QF.js} +5 -42
  6. package/dist/{chunk-WX2NCOZR.js → chunk-FTONNX2R.js} +8 -8
  7. package/dist/{chunk-7ZR244C2.js → chunk-MSCJWACE.js} +92 -72
  8. package/dist/index.cjs +15 -7
  9. package/dist/index.d.ts +24 -35
  10. package/dist/index.js +15 -7
  11. package/internal/dist/index.cjs +56 -44
  12. package/internal/dist/index.d.ts +21 -21
  13. package/internal/dist/index.js +49 -37
  14. package/internal/src/atom/create-regular-atom.ts +7 -5
  15. package/internal/src/atom/delete-atom.ts +2 -2
  16. package/internal/src/families/create-readonly-selector-family.ts +2 -2
  17. package/internal/src/families/create-regular-atom-family.ts +1 -1
  18. package/internal/src/families/create-writable-selector-family.ts +1 -1
  19. package/internal/src/future.ts +4 -2
  20. package/internal/src/lineage.ts +1 -0
  21. package/internal/src/mutable/create-mutable-atom-family.ts +1 -1
  22. package/internal/src/mutable/create-mutable-atom.ts +7 -5
  23. package/internal/src/mutable/tracker.ts +4 -4
  24. package/internal/src/mutable/transceiver.ts +2 -2
  25. package/internal/src/selector/delete-selector.ts +1 -1
  26. package/internal/src/set-state/become.ts +1 -1
  27. package/internal/src/set-state/copy-mutable-if-needed.ts +1 -1
  28. package/internal/src/store/deposit.ts +5 -5
  29. package/internal/src/store/store.ts +5 -5
  30. package/internal/src/store/withdraw.ts +4 -5
  31. package/internal/src/subject.ts +3 -1
  32. package/internal/src/subscribe/subscribe-to-state.ts +2 -2
  33. package/internal/src/subscribe/subscribe-to-transaction.ts +4 -4
  34. package/internal/src/timeline/add-atom-to-timeline.ts +16 -11
  35. package/internal/src/timeline/create-timeline.ts +3 -4
  36. package/internal/src/transaction/act-upon-store.ts +5 -5
  37. package/internal/src/transaction/apply-transaction.ts +4 -4
  38. package/internal/src/transaction/build-transaction.ts +10 -7
  39. package/internal/src/transaction/create-transaction.ts +10 -10
  40. package/internal/src/transaction/index.ts +3 -3
  41. package/internal/src/transaction/is-root-store.ts +2 -2
  42. package/introspection/dist/index.cjs +3 -2
  43. package/introspection/dist/index.d.ts +6 -6
  44. package/introspection/dist/index.js +3 -2
  45. package/introspection/src/attach-atom-index.ts +5 -4
  46. package/introspection/src/attach-introspection-states.ts +3 -3
  47. package/introspection/src/attach-transaction-index.ts +4 -4
  48. package/introspection/src/attach-transaction-logs.ts +8 -4
  49. package/introspection/src/index.ts +3 -3
  50. package/json/dist/index.cjs +6 -2
  51. package/json/dist/index.d.ts +1 -1
  52. package/json/dist/index.js +8 -4
  53. package/json/src/select-json-family.ts +3 -2
  54. package/json/src/select-json.ts +3 -1
  55. package/package.json +243 -242
  56. package/react/dist/index.cjs +9 -3
  57. package/react/dist/index.js +9 -3
  58. package/react/src/use-i.ts +3 -1
  59. package/react/src/use-tl.ts +6 -2
  60. package/react-devtools/dist/index.cjs +332 -978
  61. package/react-devtools/dist/index.css +0 -18
  62. package/react-devtools/dist/index.d.ts +7 -9
  63. package/react-devtools/dist/index.js +291 -881
  64. package/react-devtools/src/AtomIODevtools.tsx +5 -2
  65. package/react-devtools/src/Button.tsx +6 -2
  66. package/react-devtools/src/StateEditor.tsx +13 -16
  67. package/react-devtools/src/StateIndex.tsx +28 -21
  68. package/react-devtools/src/TimelineIndex.tsx +17 -6
  69. package/react-devtools/src/TransactionIndex.tsx +13 -6
  70. package/react-devtools/src/Updates.tsx +24 -9
  71. package/realtime/dist/index.cjs +1 -0
  72. package/realtime/dist/index.d.ts +2 -2
  73. package/realtime/dist/index.js +1 -0
  74. package/realtime/src/realtime-continuity.ts +4 -3
  75. package/realtime-client/dist/index.cjs +29 -29
  76. package/realtime-client/dist/index.d.ts +2 -2
  77. package/realtime-client/dist/index.js +1 -1
  78. package/realtime-client/src/server-action.ts +2 -2
  79. package/realtime-client/src/sync-continuity.ts +23 -23
  80. package/realtime-react/dist/index.cjs +30 -30
  81. package/realtime-react/dist/index.d.ts +2 -2
  82. package/realtime-react/dist/index.js +2 -2
  83. package/realtime-react/src/use-server-action.ts +3 -3
  84. package/realtime-react/src/use-single-effect.ts +1 -1
  85. package/realtime-server/dist/index.cjs +54 -44
  86. package/realtime-server/dist/index.d.ts +6 -6
  87. package/realtime-server/dist/index.js +34 -24
  88. package/realtime-server/src/ipc-sockets/child-socket.ts +7 -7
  89. package/realtime-server/src/ipc-sockets/custom-socket.ts +4 -8
  90. package/realtime-server/src/ipc-sockets/parent-socket.ts +13 -7
  91. package/realtime-server/src/realtime-action-receiver.ts +7 -5
  92. package/realtime-server/src/realtime-continuity-synchronizer.ts +3 -3
  93. package/realtime-server/src/realtime-server-stores/server-room-external-store.ts +2 -2
  94. package/realtime-server/src/realtime-state-receiver.ts +3 -1
  95. package/realtime-testing/dist/index.cjs +15 -13
  96. package/realtime-testing/dist/index.js +9 -7
  97. package/realtime-testing/src/setup-realtime-test.tsx +7 -5
  98. package/src/atom.ts +4 -8
  99. package/src/dispose.ts +1 -0
  100. package/src/index.ts +2 -9
  101. package/src/selector.ts +4 -8
  102. package/src/silo.ts +13 -3
  103. package/src/subscribe.ts +6 -6
  104. package/src/timeline.ts +4 -4
  105. package/src/transaction.ts +24 -24
  106. package/src/validators.ts +2 -2
  107. package/transceivers/set-rtx/dist/index.cjs +11 -12
  108. package/transceivers/set-rtx/dist/index.js +11 -12
  109. package/transceivers/set-rtx/src/set-rtx.ts +10 -10
  110. /package/dist/{chunk-VAE5OCKN.js → chunk-BF4MVQF6.js} +0 -0
@@ -26,8 +26,8 @@ declare const myUsernameState: AtomIO.RegularAtomToken<string | null>;
26
26
  declare const optimisticUpdateQueue: AtomIO.RegularAtomToken<AtomIO.TransactionUpdate<any>[]>;
27
27
  declare const confirmedUpdateQueue: AtomIO.RegularAtomToken<AtomIO.TransactionUpdate<any>[]>;
28
28
 
29
- declare function serverAction extends AtomIO.ƒn>(token: AtomIO.TransactionToken<ƒ>, socket: Socket, store: Internal.Store): () => void;
29
+ declare function serverAction<F extends AtomIO.Func>(token: AtomIO.TransactionToken<F>, socket: Socket, store: Internal.Store): () => void;
30
30
 
31
- declare function syncContinuity extends AtomIO.ƒn>(continuity: ContinuityToken, socket: Socket, store: Store): () => void;
31
+ declare function syncContinuity<F extends AtomIO.Func>(continuity: ContinuityToken, socket: Socket, store: Store): () => void;
32
32
 
33
33
  export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue, pullAtom, pullAtomFamilyMember, pullMutableAtom, pullMutableAtomFamilyMember, pullSelector, pullSelectorFamilyMember, pushState, serverAction, syncContinuity };
@@ -1,4 +1,4 @@
1
- export { syncContinuity } from '../../dist/chunk-YDOGCZ53.js';
1
+ export { syncContinuity } from '../../dist/chunk-ATKDGVTV.js';
2
2
  export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue } from '../../dist/chunk-O47EQUM6.js';
3
3
  import '../../dist/chunk-BWWVY5O5.js';
4
4
  import '../../dist/chunk-U2IICNHQ.js';
@@ -2,8 +2,8 @@ import type * as AtomIO from "atom.io"
2
2
  import * as Internal from "atom.io/internal"
3
3
  import type { Socket } from "socket.io-client"
4
4
 
5
- export function serverAction extends AtomIO.ƒn>(
6
- token: AtomIO.TransactionToken<ƒ>,
5
+ export function serverAction<F extends AtomIO.Func>(
6
+ token: AtomIO.TransactionToken<F>,
7
7
  socket: Socket,
8
8
  store: Internal.Store,
9
9
  ): () => void {
@@ -21,7 +21,7 @@ import {
21
21
  } from "atom.io/realtime-client"
22
22
  import type { Socket } from "socket.io-client"
23
23
 
24
- export function syncContinuity extends AtomIO.ƒn>(
24
+ export function syncContinuity<F extends AtomIO.Func>(
25
25
  continuity: ContinuityToken,
26
26
  socket: Socket,
27
27
  store: Store,
@@ -54,7 +54,7 @@ export function syncContinuity<ƒ extends AtomIO.ƒn>(
54
54
  socket.on(`continuity-init:${continuityKey}`, initializeContinuity)
55
55
 
56
56
  const registerAndAttemptConfirmedUpdate = (
57
- confirmedUpdate: AtomIO.TransactionUpdate<ƒ>,
57
+ confirmed: AtomIO.TransactionUpdate<F>,
58
58
  ) => {
59
59
  function reconcileEpoch(
60
60
  optimisticUpdate: AtomIO.TransactionUpdate<any>,
@@ -155,7 +155,7 @@ export function syncContinuity<ƒ extends AtomIO.ƒn>(
155
155
  `continuity`,
156
156
  continuityKey,
157
157
  `integrating confirmed update`,
158
- { confirmedUpdate, confirmedUpdates, optimisticUpdates },
158
+ { confirmedUpdate: confirmed, confirmedUpdates, optimisticUpdates },
159
159
  )
160
160
  const zerothOptimisticUpdate = optimisticUpdates[0]
161
161
  if (zerothOptimisticUpdate) {
@@ -165,14 +165,14 @@ export function syncContinuity<ƒ extends AtomIO.ƒn>(
165
165
  continuityKey,
166
166
  `has optimistic updates to reconcile`,
167
167
  )
168
- if (confirmedUpdate.epoch === zerothOptimisticUpdate.epoch) {
168
+ if (confirmed.epoch === zerothOptimisticUpdate.epoch) {
169
169
  store.logger.info(
170
170
  `🧑‍⚖️`,
171
171
  `continuity`,
172
172
  continuityKey,
173
- `epoch of confirmed update #${confirmedUpdate.epoch} matches zeroth optimistic update`,
173
+ `epoch of confirmed update #${confirmed.epoch} matches zeroth optimistic update`,
174
174
  )
175
- reconcileEpoch(zerothOptimisticUpdate, confirmedUpdate)
175
+ reconcileEpoch(zerothOptimisticUpdate, confirmed)
176
176
  for (const nextConfirmed of confirmedUpdates) {
177
177
  const nextOptimistic = optimisticUpdates[0]
178
178
  if (nextConfirmed.epoch === nextOptimistic?.epoch) {
@@ -187,10 +187,10 @@ export function syncContinuity<ƒ extends AtomIO.ƒn>(
187
187
  `🧑‍⚖️`,
188
188
  `continuity`,
189
189
  continuityKey,
190
- `epoch of confirmed update #${confirmedUpdate.epoch} does not match zeroth optimistic update #${zerothOptimisticUpdate.epoch}`,
190
+ `epoch of confirmed update #${confirmed.epoch} does not match zeroth optimistic update #${zerothOptimisticUpdate.epoch}`,
191
191
  )
192
192
  const confirmedUpdateIsAlreadyEnqueued = confirmedUpdates.some(
193
- (update) => update.epoch === confirmedUpdate.epoch,
193
+ (update) => update.epoch === confirmed.epoch,
194
194
  )
195
195
  if (!confirmedUpdateIsAlreadyEnqueued) {
196
196
  store.logger.info(
@@ -198,12 +198,12 @@ export function syncContinuity<ƒ extends AtomIO.ƒn>(
198
198
  `continuity`,
199
199
  continuityKey,
200
200
  `pushing confirmed update to queue`,
201
- confirmedUpdate,
201
+ confirmed,
202
202
  )
203
203
  setIntoStore(
204
204
  confirmedUpdateQueue,
205
205
  (queue) => {
206
- queue.push(confirmedUpdate)
206
+ queue.push(confirmed)
207
207
  queue.sort((a, b) => a.epoch - b.epoch)
208
208
  return queue
209
209
  },
@@ -221,50 +221,50 @@ export function syncContinuity<ƒ extends AtomIO.ƒn>(
221
221
  const continuityEpoch = getEpochNumberOfContinuity(continuityKey, store)
222
222
  const isRoot = isRootStore(store)
223
223
 
224
- if (isRoot && continuityEpoch === confirmedUpdate.epoch - 1) {
224
+ if (isRoot && continuityEpoch === confirmed.epoch - 1) {
225
225
  store.logger.info(
226
226
  `✅`,
227
227
  `continuity`,
228
228
  continuityKey,
229
- `integrating update #${confirmedUpdate.epoch} (${confirmedUpdate.key} ${confirmedUpdate.id})`,
229
+ `integrating update #${confirmed.epoch} (${confirmed.key} ${confirmed.id})`,
230
230
  )
231
- ingestTransactionUpdate(`newValue`, confirmedUpdate, store)
232
- socket.emit(`ack:${continuityKey}`, confirmedUpdate.epoch)
233
- setEpochNumberOfContinuity(continuityKey, confirmedUpdate.epoch, store)
231
+ ingestTransactionUpdate(`newValue`, confirmed, store)
232
+ socket.emit(`ack:${continuityKey}`, confirmed.epoch)
233
+ setEpochNumberOfContinuity(continuityKey, confirmed.epoch, store)
234
234
  } else if (isRoot && continuityEpoch !== undefined) {
235
235
  store.logger.info(
236
236
  `🧑‍⚖️`,
237
237
  `continuity`,
238
238
  continuityKey,
239
- `received update #${
240
- confirmedUpdate.epoch
241
- } but still waiting for update #${continuityEpoch + 1}`,
239
+ `received update #${confirmed.epoch} but still waiting for update #${
240
+ continuityEpoch + 1
241
+ }`,
242
242
  {
243
243
  clientEpoch: continuityEpoch,
244
- serverEpoch: confirmedUpdate.epoch,
244
+ serverEpoch: confirmed.epoch,
245
245
  },
246
246
  )
247
247
  const confirmedUpdateIsAlreadyEnqueued = confirmedUpdates.some(
248
- (update) => update.epoch === confirmedUpdate.epoch,
248
+ (update) => update.epoch === confirmed.epoch,
249
249
  )
250
250
  if (confirmedUpdateIsAlreadyEnqueued) {
251
251
  store.logger.info(
252
252
  `👍`,
253
253
  `continuity`,
254
254
  continuityKey,
255
- `confirmed update #${confirmedUpdate.epoch} is already enqueued`,
255
+ `confirmed update #${confirmed.epoch} is already enqueued`,
256
256
  )
257
257
  } else {
258
258
  store.logger.info(
259
259
  `👈`,
260
260
  `continuity`,
261
261
  continuityKey,
262
- `pushing confirmed update #${confirmedUpdate.epoch} to queue`,
262
+ `pushing confirmed update #${confirmed.epoch} to queue`,
263
263
  )
264
264
  setIntoStore(
265
265
  confirmedUpdateQueue,
266
266
  (queue) => {
267
- queue.push(confirmedUpdate)
267
+ queue.push(confirmed)
268
268
  queue.sort((a, b) => a.epoch - b.epoch)
269
269
  return queue
270
270
  },
@@ -47,7 +47,7 @@ var RealtimeProvider = ({ children, socket }) => {
47
47
  return /* @__PURE__ */ jsxRuntime.jsx(RealtimeContext.Provider, { value: { socket, services }, children });
48
48
  };
49
49
  var { NODE_ENV } = process.env;
50
- var IN_DEV = NODE_ENV === `development` || NODE_ENV === `test`;
50
+ var IN_DEV = NODE_ENV === `development`;
51
51
  function noop() {
52
52
  }
53
53
  function useSingleEffect(effect, deps) {
@@ -194,8 +194,8 @@ function syncContinuity(continuity, socket, store) {
194
194
  };
195
195
  socket.off(`continuity-init:${continuityKey}`);
196
196
  socket.on(`continuity-init:${continuityKey}`, initializeContinuity);
197
- const registerAndAttemptConfirmedUpdate = (confirmedUpdate) => {
198
- function reconcileEpoch(optimisticUpdate, confirmedUpdate2) {
197
+ const registerAndAttemptConfirmedUpdate = (confirmed) => {
198
+ function reconcileEpoch(optimisticUpdate, confirmedUpdate) {
199
199
  store.logger.info(
200
200
  `\u{1F9D1}\u200D\u2696\uFE0F`,
201
201
  `continuity`,
@@ -210,9 +210,9 @@ function syncContinuity(continuity, socket, store) {
210
210
  },
211
211
  store
212
212
  );
213
- if (optimisticUpdate.id === confirmedUpdate2.id) {
213
+ if (optimisticUpdate.id === confirmedUpdate.id) {
214
214
  const clientResult = JSON.stringify(optimisticUpdate.updates);
215
- const serverResult = JSON.stringify(confirmedUpdate2.updates);
215
+ const serverResult = JSON.stringify(confirmedUpdate.updates);
216
216
  if (clientResult === serverResult) {
217
217
  store.logger.info(
218
218
  `\u2705`,
@@ -220,7 +220,7 @@ function syncContinuity(continuity, socket, store) {
220
220
  continuityKey,
221
221
  `results for ${optimisticUpdate.id} match between client and server`
222
222
  );
223
- socket.emit(`ack:${continuityKey}`, confirmedUpdate2.epoch);
223
+ socket.emit(`ack:${continuityKey}`, confirmedUpdate.epoch);
224
224
  return;
225
225
  }
226
226
  } else {
@@ -228,7 +228,7 @@ function syncContinuity(continuity, socket, store) {
228
228
  `\u274C`,
229
229
  `continuity`,
230
230
  continuityKey,
231
- `thought update #${confirmedUpdate2.epoch} was ${optimisticUpdate.key}:${optimisticUpdate.id}, but it was actually ${confirmedUpdate2.key}:${confirmedUpdate2.id}`
231
+ `thought update #${confirmedUpdate.epoch} was ${optimisticUpdate.key}:${optimisticUpdate.id}, but it was actually ${confirmedUpdate.key}:${confirmedUpdate.id}`
232
232
  );
233
233
  }
234
234
  store.logger.info(
@@ -237,7 +237,7 @@ function syncContinuity(continuity, socket, store) {
237
237
  continuityKey,
238
238
  `updates do not match`,
239
239
  optimisticUpdate,
240
- confirmedUpdate2
240
+ confirmedUpdate
241
241
  );
242
242
  const reversedOptimisticUpdates = optimisticUpdates.toReversed();
243
243
  for (const subsequentOptimistic of reversedOptimisticUpdates) {
@@ -258,15 +258,15 @@ function syncContinuity(continuity, socket, store) {
258
258
  `undid zeroth optimistic update`,
259
259
  optimisticUpdate
260
260
  );
261
- internal.ingestTransactionUpdate(`newValue`, confirmedUpdate2, store);
261
+ internal.ingestTransactionUpdate(`newValue`, confirmedUpdate, store);
262
262
  store.logger.info(
263
263
  `\u23E9`,
264
264
  `continuity`,
265
265
  continuityKey,
266
266
  `applied confirmed update`,
267
- confirmedUpdate2
267
+ confirmedUpdate
268
268
  );
269
- socket.emit(`ack:${continuityKey}`, confirmedUpdate2.epoch);
269
+ socket.emit(`ack:${continuityKey}`, confirmedUpdate.epoch);
270
270
  for (const subsequentOptimistic of optimisticUpdates) {
271
271
  const token = {
272
272
  type: `transaction`,
@@ -288,7 +288,7 @@ function syncContinuity(continuity, socket, store) {
288
288
  `continuity`,
289
289
  continuityKey,
290
290
  `integrating confirmed update`,
291
- { confirmedUpdate, confirmedUpdates, optimisticUpdates }
291
+ { confirmedUpdate: confirmed, confirmedUpdates, optimisticUpdates }
292
292
  );
293
293
  const zerothOptimisticUpdate = optimisticUpdates[0];
294
294
  if (zerothOptimisticUpdate) {
@@ -298,14 +298,14 @@ function syncContinuity(continuity, socket, store) {
298
298
  continuityKey,
299
299
  `has optimistic updates to reconcile`
300
300
  );
301
- if (confirmedUpdate.epoch === zerothOptimisticUpdate.epoch) {
301
+ if (confirmed.epoch === zerothOptimisticUpdate.epoch) {
302
302
  store.logger.info(
303
303
  `\u{1F9D1}\u200D\u2696\uFE0F`,
304
304
  `continuity`,
305
305
  continuityKey,
306
- `epoch of confirmed update #${confirmedUpdate.epoch} matches zeroth optimistic update`
306
+ `epoch of confirmed update #${confirmed.epoch} matches zeroth optimistic update`
307
307
  );
308
- reconcileEpoch(zerothOptimisticUpdate, confirmedUpdate);
308
+ reconcileEpoch(zerothOptimisticUpdate, confirmed);
309
309
  for (const nextConfirmed of confirmedUpdates) {
310
310
  const nextOptimistic = optimisticUpdates[0];
311
311
  if (nextConfirmed.epoch === (nextOptimistic == null ? void 0 : nextOptimistic.epoch)) {
@@ -319,10 +319,10 @@ function syncContinuity(continuity, socket, store) {
319
319
  `\u{1F9D1}\u200D\u2696\uFE0F`,
320
320
  `continuity`,
321
321
  continuityKey,
322
- `epoch of confirmed update #${confirmedUpdate.epoch} does not match zeroth optimistic update #${zerothOptimisticUpdate.epoch}`
322
+ `epoch of confirmed update #${confirmed.epoch} does not match zeroth optimistic update #${zerothOptimisticUpdate.epoch}`
323
323
  );
324
324
  const confirmedUpdateIsAlreadyEnqueued = confirmedUpdates.some(
325
- (update) => update.epoch === confirmedUpdate.epoch
325
+ (update) => update.epoch === confirmed.epoch
326
326
  );
327
327
  if (!confirmedUpdateIsAlreadyEnqueued) {
328
328
  store.logger.info(
@@ -330,12 +330,12 @@ function syncContinuity(continuity, socket, store) {
330
330
  `continuity`,
331
331
  continuityKey,
332
332
  `pushing confirmed update to queue`,
333
- confirmedUpdate
333
+ confirmed
334
334
  );
335
335
  internal.setIntoStore(
336
336
  RTC.confirmedUpdateQueue,
337
337
  (queue) => {
338
- queue.push(confirmedUpdate);
338
+ queue.push(confirmed);
339
339
  queue.sort((a, b) => a.epoch - b.epoch);
340
340
  return queue;
341
341
  },
@@ -352,48 +352,48 @@ function syncContinuity(continuity, socket, store) {
352
352
  );
353
353
  const continuityEpoch = internal.getEpochNumberOfContinuity(continuityKey, store);
354
354
  const isRoot = internal.isRootStore(store);
355
- if (isRoot && continuityEpoch === confirmedUpdate.epoch - 1) {
355
+ if (isRoot && continuityEpoch === confirmed.epoch - 1) {
356
356
  store.logger.info(
357
357
  `\u2705`,
358
358
  `continuity`,
359
359
  continuityKey,
360
- `integrating update #${confirmedUpdate.epoch} (${confirmedUpdate.key} ${confirmedUpdate.id})`
360
+ `integrating update #${confirmed.epoch} (${confirmed.key} ${confirmed.id})`
361
361
  );
362
- internal.ingestTransactionUpdate(`newValue`, confirmedUpdate, store);
363
- socket.emit(`ack:${continuityKey}`, confirmedUpdate.epoch);
364
- internal.setEpochNumberOfContinuity(continuityKey, confirmedUpdate.epoch, store);
362
+ internal.ingestTransactionUpdate(`newValue`, confirmed, store);
363
+ socket.emit(`ack:${continuityKey}`, confirmed.epoch);
364
+ internal.setEpochNumberOfContinuity(continuityKey, confirmed.epoch, store);
365
365
  } else if (isRoot && continuityEpoch !== void 0) {
366
366
  store.logger.info(
367
367
  `\u{1F9D1}\u200D\u2696\uFE0F`,
368
368
  `continuity`,
369
369
  continuityKey,
370
- `received update #${confirmedUpdate.epoch} but still waiting for update #${continuityEpoch + 1}`,
370
+ `received update #${confirmed.epoch} but still waiting for update #${continuityEpoch + 1}`,
371
371
  {
372
372
  clientEpoch: continuityEpoch,
373
- serverEpoch: confirmedUpdate.epoch
373
+ serverEpoch: confirmed.epoch
374
374
  }
375
375
  );
376
376
  const confirmedUpdateIsAlreadyEnqueued = confirmedUpdates.some(
377
- (update) => update.epoch === confirmedUpdate.epoch
377
+ (update) => update.epoch === confirmed.epoch
378
378
  );
379
379
  if (confirmedUpdateIsAlreadyEnqueued) {
380
380
  store.logger.info(
381
381
  `\u{1F44D}`,
382
382
  `continuity`,
383
383
  continuityKey,
384
- `confirmed update #${confirmedUpdate.epoch} is already enqueued`
384
+ `confirmed update #${confirmed.epoch} is already enqueued`
385
385
  );
386
386
  } else {
387
387
  store.logger.info(
388
388
  `\u{1F448}`,
389
389
  `continuity`,
390
390
  continuityKey,
391
- `pushing confirmed update #${confirmedUpdate.epoch} to queue`
391
+ `pushing confirmed update #${confirmed.epoch} to queue`
392
392
  );
393
393
  internal.setIntoStore(
394
394
  RTC.confirmedUpdateQueue,
395
395
  (queue) => {
396
- queue.push(confirmedUpdate);
396
+ queue.push(confirmed);
397
397
  queue.sort((a, b) => a.epoch - b.epoch);
398
398
  return queue;
399
399
  },
@@ -32,9 +32,9 @@ declare function usePullSelectorFamilyMember<T, K extends Json.Serializable, Key
32
32
 
33
33
  declare function usePush<J extends Json.Serializable>(token: AtomIO.WritableToken<J>): <New extends J>(next: New | ((old: J) => New)) => void;
34
34
 
35
- declare function useServerAction extends AtomIO.ƒn>(token: AtomIO.TransactionToken<ƒ>): (...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
35
+ declare function useServerAction<F extends AtomIO.Func>(token: AtomIO.TransactionToken<F>): (...parameters: Parameters<F>) => ReturnType<F>;
36
36
 
37
- type PerspectiveToken<F extends AtomFamilyToken<any>, T extends F extends AtomFamilyToken<infer T, any> ? T : never> = {
37
+ type PerspectiveToken<F extends AtomFamilyToken<any>, T extends F extends AtomFamilyToken<infer U, any> ? U : never> = {
38
38
  type: `realtime_perspective`;
39
39
  resourceAtoms: F;
40
40
  viewAtoms: ReadableFamilyToken<ReadableToken<T>[], string>;
@@ -1,4 +1,4 @@
1
- import { syncContinuity } from '../../dist/chunk-YDOGCZ53.js';
1
+ import { syncContinuity } from '../../dist/chunk-ATKDGVTV.js';
2
2
  import '../../dist/chunk-U2IICNHQ.js';
3
3
  import { useI, StoreContext, useO } from 'atom.io/react';
4
4
  import * as RTC from 'atom.io/realtime-client';
@@ -25,7 +25,7 @@ var RealtimeProvider = ({ children, socket }) => {
25
25
  return /* @__PURE__ */ jsx(RealtimeContext.Provider, { value: { socket, services }, children });
26
26
  };
27
27
  var { NODE_ENV } = process.env;
28
- var IN_DEV = NODE_ENV === `development` || NODE_ENV === `test`;
28
+ var IN_DEV = NODE_ENV === `development`;
29
29
  function noop() {
30
30
  }
31
31
  function useSingleEffect(effect, deps) {
@@ -6,9 +6,9 @@ import * as React from "react"
6
6
 
7
7
  import { useRealtimeService } from "./use-realtime-service"
8
8
 
9
- export function useServerAction extends AtomIO.ƒn>(
10
- token: AtomIO.TransactionToken<ƒ>,
11
- ): (...parameters: Parameters<ƒ>) => ReturnType<ƒ> {
9
+ export function useServerAction<F extends AtomIO.Func>(
10
+ token: AtomIO.TransactionToken<F>,
11
+ ): (...parameters: Parameters<F>) => ReturnType<F> {
12
12
  const store = React.useContext(StoreContext)
13
13
 
14
14
  useRealtimeService(`tx:${token.key}`, (socket) =>
@@ -1,7 +1,7 @@
1
1
  import * as React from "react"
2
2
 
3
3
  const { NODE_ENV } = process.env
4
- const IN_DEV = NODE_ENV === `development` || NODE_ENV === `test`
4
+ const IN_DEV = NODE_ENV === `development`
5
5
 
6
6
  function noop() {}
7
7