atom.io 0.19.1 → 0.19.3

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 (117) hide show
  1. package/data/dist/index.cjs +99 -79
  2. package/data/dist/index.js +3 -3
  3. package/data/package.json +1 -1
  4. package/data/src/join.ts +67 -50
  5. package/dist/{chunk-YDOGCZ53.js → chunk-ATKDGVTV.js} +29 -29
  6. package/dist/{chunk-7VCCW45K.js → chunk-CC7IF7QF.js} +4 -3
  7. package/dist/{chunk-U2IICNHQ.js → chunk-F2X4B4VY.js} +5 -1
  8. package/dist/{chunk-WX2NCOZR.js → chunk-FTONNX2R.js} +8 -8
  9. package/dist/{chunk-7ZR244C2.js → chunk-MSCJWACE.js} +92 -72
  10. package/dist/index.cjs +14 -7
  11. package/dist/index.d.ts +23 -35
  12. package/dist/index.js +15 -8
  13. package/eslint-plugin/dist/index.cjs +180 -0
  14. package/eslint-plugin/dist/index.js +171 -0
  15. package/eslint-plugin/package.json +16 -0
  16. package/eslint-plugin/src/index.ts +11 -0
  17. package/eslint-plugin/src/rules/index.ts +1 -0
  18. package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +190 -0
  19. package/internal/dist/index.cjs +55 -43
  20. package/internal/dist/index.d.ts +20 -20
  21. package/internal/dist/index.js +49 -37
  22. package/internal/package.json +1 -1
  23. package/internal/src/atom/create-regular-atom.ts +7 -5
  24. package/internal/src/atom/delete-atom.ts +2 -2
  25. package/internal/src/families/create-readonly-selector-family.ts +2 -2
  26. package/internal/src/families/create-regular-atom-family.ts +1 -1
  27. package/internal/src/families/create-writable-selector-family.ts +1 -1
  28. package/internal/src/future.ts +4 -2
  29. package/internal/src/lineage.ts +1 -0
  30. package/internal/src/mutable/create-mutable-atom-family.ts +1 -1
  31. package/internal/src/mutable/create-mutable-atom.ts +7 -5
  32. package/internal/src/mutable/tracker.ts +3 -3
  33. package/internal/src/mutable/transceiver.ts +2 -2
  34. package/internal/src/selector/delete-selector.ts +1 -1
  35. package/internal/src/set-state/copy-mutable-if-needed.ts +1 -1
  36. package/internal/src/store/deposit.ts +5 -5
  37. package/internal/src/store/store.ts +5 -5
  38. package/internal/src/store/withdraw.ts +4 -5
  39. package/internal/src/subject.ts +3 -1
  40. package/internal/src/subscribe/subscribe-to-transaction.ts +4 -4
  41. package/internal/src/timeline/add-atom-to-timeline.ts +13 -8
  42. package/internal/src/timeline/create-timeline.ts +3 -4
  43. package/internal/src/transaction/act-upon-store.ts +5 -5
  44. package/internal/src/transaction/apply-transaction.ts +4 -4
  45. package/internal/src/transaction/build-transaction.ts +9 -6
  46. package/internal/src/transaction/create-transaction.ts +10 -10
  47. package/internal/src/transaction/index.ts +3 -3
  48. package/internal/src/transaction/is-root-store.ts +2 -2
  49. package/introspection/dist/index.d.ts +3 -3
  50. package/introspection/dist/index.js +1 -1
  51. package/introspection/package.json +1 -1
  52. package/introspection/src/attach-introspection-states.ts +3 -3
  53. package/introspection/src/attach-transaction-index.ts +4 -4
  54. package/introspection/src/attach-transaction-logs.ts +8 -4
  55. package/json/dist/index.cjs +6 -2
  56. package/json/dist/index.js +7 -3
  57. package/json/package.json +1 -1
  58. package/json/src/select-json-family.ts +3 -2
  59. package/json/src/select-json.ts +3 -1
  60. package/package.json +258 -241
  61. package/react/dist/index.cjs +9 -3
  62. package/react/dist/index.js +10 -4
  63. package/react/package.json +1 -1
  64. package/react/src/use-i.ts +3 -1
  65. package/react/src/use-tl.ts +6 -2
  66. package/react-devtools/dist/index.cjs +205 -155
  67. package/react-devtools/dist/index.d.ts +3 -5
  68. package/react-devtools/dist/index.js +182 -133
  69. package/react-devtools/package.json +1 -1
  70. package/react-devtools/src/AtomIODevtools.tsx +3 -1
  71. package/react-devtools/src/Button.tsx +3 -1
  72. package/react-devtools/src/StateIndex.tsx +6 -2
  73. package/react-devtools/src/TimelineIndex.tsx +6 -2
  74. package/react-devtools/src/TransactionIndex.tsx +3 -3
  75. package/react-devtools/src/Updates.tsx +24 -13
  76. package/realtime/dist/index.cjs +1 -0
  77. package/realtime/dist/index.d.ts +2 -2
  78. package/realtime/dist/index.js +2 -1
  79. package/realtime/package.json +1 -1
  80. package/realtime/src/realtime-continuity.ts +4 -3
  81. package/realtime-client/dist/index.cjs +29 -29
  82. package/realtime-client/dist/index.d.ts +2 -2
  83. package/realtime-client/dist/index.js +2 -2
  84. package/realtime-client/package.json +1 -1
  85. package/realtime-client/src/server-action.ts +2 -2
  86. package/realtime-client/src/sync-continuity.ts +23 -23
  87. package/realtime-react/dist/index.cjs +29 -29
  88. package/realtime-react/dist/index.d.ts +2 -2
  89. package/realtime-react/dist/index.js +2 -2
  90. package/realtime-react/package.json +1 -1
  91. package/realtime-react/src/use-server-action.ts +3 -3
  92. package/realtime-server/dist/index.cjs +54 -44
  93. package/realtime-server/dist/index.d.ts +5 -5
  94. package/realtime-server/dist/index.js +35 -25
  95. package/realtime-server/package.json +1 -1
  96. package/realtime-server/src/ipc-sockets/child-socket.ts +6 -6
  97. package/realtime-server/src/ipc-sockets/custom-socket.ts +4 -8
  98. package/realtime-server/src/ipc-sockets/parent-socket.ts +13 -7
  99. package/realtime-server/src/realtime-action-receiver.ts +7 -5
  100. package/realtime-server/src/realtime-continuity-synchronizer.ts +3 -3
  101. package/realtime-server/src/realtime-state-receiver.ts +3 -1
  102. package/realtime-testing/dist/index.cjs +15 -13
  103. package/realtime-testing/dist/index.js +10 -8
  104. package/realtime-testing/package.json +1 -1
  105. package/realtime-testing/src/setup-realtime-test.tsx +6 -4
  106. package/src/atom.ts +4 -8
  107. package/src/dispose.ts +1 -0
  108. package/src/index.ts +2 -9
  109. package/src/selector.ts +4 -8
  110. package/src/silo.ts +9 -3
  111. package/src/subscribe.ts +6 -6
  112. package/src/timeline.ts +4 -4
  113. package/src/transaction.ts +24 -24
  114. package/transceivers/set-rtx/dist/index.cjs +11 -12
  115. package/transceivers/set-rtx/dist/index.js +12 -13
  116. package/transceivers/set-rtx/package.json +1 -1
  117. package/transceivers/set-rtx/src/set-rtx.ts +10 -10
@@ -1,4 +1,4 @@
1
- import '../../../dist/chunk-U2IICNHQ.js';
1
+ import '../../../dist/chunk-F2X4B4VY.js';
2
2
  import { Subject } from 'atom.io/internal';
3
3
  import { stringifyJson, parseJson } from 'atom.io/json';
4
4
 
@@ -85,7 +85,7 @@ var SetRTX = class _SetRTX extends Set {
85
85
  this.emit(`tx:${this.transactionUpdates.join(`;`)}`);
86
86
  }
87
87
  } catch (thrown) {
88
- console.error(`Failed to apply transaction to SetRTX: ${thrown}`);
88
+ console.error(`Failed to apply transaction to SetRTX:`, thrown);
89
89
  throw thrown;
90
90
  } finally {
91
91
  unsubscribe();
@@ -98,10 +98,9 @@ var SetRTX = class _SetRTX extends Set {
98
98
  return this.subject.subscribe(key, fn);
99
99
  }
100
100
  subscribe(key, fn) {
101
- return this.subject.subscribe(
102
- key,
103
- (update) => fn(`${this.cacheUpdateNumber}=${update}`)
104
- );
101
+ return this.subject.subscribe(key, (update) => {
102
+ fn(`${this.cacheUpdateNumber}=${update}`);
103
+ });
105
104
  }
106
105
  emit(update) {
107
106
  this.subject.next(update);
@@ -121,8 +120,8 @@ var SetRTX = class _SetRTX extends Set {
121
120
  this.delete(parseJson(value));
122
121
  break;
123
122
  case `tx`:
124
- for (const update2 of value.split(`;`)) {
125
- this.doStep(update2);
123
+ for (const subUpdate of value.split(`;`)) {
124
+ this.doStep(subUpdate);
126
125
  }
127
126
  }
128
127
  }
@@ -156,12 +155,12 @@ var SetRTX = class _SetRTX extends Set {
156
155
  let done = false;
157
156
  while (!done) {
158
157
  this.cacheIdx %= this.cacheLimit;
159
- const update2 = this.cache[this.cacheIdx];
158
+ const u = this.cache[this.cacheIdx];
160
159
  this.cacheIdx--;
161
- if (!update2) {
160
+ if (!u) {
162
161
  return `OUT_OF_RANGE`;
163
162
  }
164
- this.undo(update2);
163
+ this.undo(u);
165
164
  done = this.cacheIdx === eventIdx - 1;
166
165
  }
167
166
  const innerUpdate = update.substring(breakpoint + 1);
@@ -185,8 +184,8 @@ var SetRTX = class _SetRTX extends Set {
185
184
  break;
186
185
  case `clear`: {
187
186
  const values = JSON.parse(value);
188
- for (const value2 of values)
189
- this.add(value2);
187
+ for (const v of values)
188
+ this.add(v);
190
189
  break;
191
190
  }
192
191
  case `tx`: {
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "private": true,
5
5
  "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
6
+ "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
@@ -110,7 +110,7 @@ export class SetRTX<P extends primitive>
110
110
  this.emit(`tx:${this.transactionUpdates.join(`;`)}`)
111
111
  }
112
112
  } catch (thrown) {
113
- console.error(`Failed to apply transaction to SetRTX: ${thrown}`)
113
+ console.error(`Failed to apply transaction to SetRTX:`, thrown)
114
114
  throw thrown
115
115
  } finally {
116
116
  unsubscribe()
@@ -130,9 +130,9 @@ export class SetRTX<P extends primitive>
130
130
  key: string,
131
131
  fn: (update: NumberedSetUpdate) => void,
132
132
  ): () => void {
133
- return this.subject.subscribe(key, (update) =>
134
- fn(`${this.cacheUpdateNumber}=${update}`),
135
- )
133
+ return this.subject.subscribe(key, (update) => {
134
+ fn(`${this.cacheUpdateNumber}=${update}`)
135
+ })
136
136
  }
137
137
 
138
138
  public emit(update: SetUpdate): void {
@@ -154,8 +154,8 @@ export class SetRTX<P extends primitive>
154
154
  this.delete(parseJson(value as Stringified<P>))
155
155
  break
156
156
  case `tx`:
157
- for (const update of value.split(`;`)) {
158
- this.doStep(update as SetUpdate)
157
+ for (const subUpdate of value.split(`;`)) {
158
+ this.doStep(subUpdate as SetUpdate)
159
159
  }
160
160
  }
161
161
  }
@@ -191,12 +191,12 @@ export class SetRTX<P extends primitive>
191
191
  let done = false
192
192
  while (!done) {
193
193
  this.cacheIdx %= this.cacheLimit
194
- const update = this.cache[this.cacheIdx]
194
+ const u = this.cache[this.cacheIdx]
195
195
  this.cacheIdx--
196
- if (!update) {
196
+ if (!u) {
197
197
  return `OUT_OF_RANGE`
198
198
  }
199
- this.undo(update)
199
+ this.undo(u)
200
200
  done = this.cacheIdx === eventIdx - 1
201
201
  }
202
202
  const innerUpdate = update.substring(breakpoint + 1) as SetUpdate
@@ -221,7 +221,7 @@ export class SetRTX<P extends primitive>
221
221
  break
222
222
  case `clear`: {
223
223
  const values = JSON.parse(value) as P[]
224
- for (const value of values) this.add(value)
224
+ for (const v of values) this.add(v)
225
225
  break
226
226
  }
227
227
  case `tx`: {