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.
- package/data/dist/index.cjs +99 -79
- package/data/dist/index.js +3 -3
- package/data/package.json +1 -1
- package/data/src/join.ts +67 -50
- package/dist/{chunk-YDOGCZ53.js → chunk-ATKDGVTV.js} +29 -29
- package/dist/{chunk-7VCCW45K.js → chunk-CC7IF7QF.js} +4 -3
- package/dist/{chunk-U2IICNHQ.js → chunk-F2X4B4VY.js} +5 -1
- package/dist/{chunk-WX2NCOZR.js → chunk-FTONNX2R.js} +8 -8
- package/dist/{chunk-7ZR244C2.js → chunk-MSCJWACE.js} +92 -72
- package/dist/index.cjs +14 -7
- package/dist/index.d.ts +23 -35
- package/dist/index.js +15 -8
- package/eslint-plugin/dist/index.cjs +180 -0
- package/eslint-plugin/dist/index.js +171 -0
- package/eslint-plugin/package.json +16 -0
- package/eslint-plugin/src/index.ts +11 -0
- package/eslint-plugin/src/rules/index.ts +1 -0
- package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +190 -0
- package/internal/dist/index.cjs +55 -43
- package/internal/dist/index.d.ts +20 -20
- package/internal/dist/index.js +49 -37
- package/internal/package.json +1 -1
- package/internal/src/atom/create-regular-atom.ts +7 -5
- package/internal/src/atom/delete-atom.ts +2 -2
- package/internal/src/families/create-readonly-selector-family.ts +2 -2
- package/internal/src/families/create-regular-atom-family.ts +1 -1
- package/internal/src/families/create-writable-selector-family.ts +1 -1
- package/internal/src/future.ts +4 -2
- package/internal/src/lineage.ts +1 -0
- package/internal/src/mutable/create-mutable-atom-family.ts +1 -1
- package/internal/src/mutable/create-mutable-atom.ts +7 -5
- package/internal/src/mutable/tracker.ts +3 -3
- package/internal/src/mutable/transceiver.ts +2 -2
- package/internal/src/selector/delete-selector.ts +1 -1
- package/internal/src/set-state/copy-mutable-if-needed.ts +1 -1
- package/internal/src/store/deposit.ts +5 -5
- package/internal/src/store/store.ts +5 -5
- package/internal/src/store/withdraw.ts +4 -5
- package/internal/src/subject.ts +3 -1
- package/internal/src/subscribe/subscribe-to-transaction.ts +4 -4
- package/internal/src/timeline/add-atom-to-timeline.ts +13 -8
- package/internal/src/timeline/create-timeline.ts +3 -4
- package/internal/src/transaction/act-upon-store.ts +5 -5
- package/internal/src/transaction/apply-transaction.ts +4 -4
- package/internal/src/transaction/build-transaction.ts +9 -6
- package/internal/src/transaction/create-transaction.ts +10 -10
- package/internal/src/transaction/index.ts +3 -3
- package/internal/src/transaction/is-root-store.ts +2 -2
- package/introspection/dist/index.d.ts +3 -3
- package/introspection/dist/index.js +1 -1
- package/introspection/package.json +1 -1
- package/introspection/src/attach-introspection-states.ts +3 -3
- package/introspection/src/attach-transaction-index.ts +4 -4
- package/introspection/src/attach-transaction-logs.ts +8 -4
- package/json/dist/index.cjs +6 -2
- package/json/dist/index.js +7 -3
- package/json/package.json +1 -1
- package/json/src/select-json-family.ts +3 -2
- package/json/src/select-json.ts +3 -1
- package/package.json +258 -241
- package/react/dist/index.cjs +9 -3
- package/react/dist/index.js +10 -4
- package/react/package.json +1 -1
- package/react/src/use-i.ts +3 -1
- package/react/src/use-tl.ts +6 -2
- package/react-devtools/dist/index.cjs +205 -155
- package/react-devtools/dist/index.d.ts +3 -5
- package/react-devtools/dist/index.js +182 -133
- package/react-devtools/package.json +1 -1
- package/react-devtools/src/AtomIODevtools.tsx +3 -1
- package/react-devtools/src/Button.tsx +3 -1
- package/react-devtools/src/StateIndex.tsx +6 -2
- package/react-devtools/src/TimelineIndex.tsx +6 -2
- package/react-devtools/src/TransactionIndex.tsx +3 -3
- package/react-devtools/src/Updates.tsx +24 -13
- package/realtime/dist/index.cjs +1 -0
- package/realtime/dist/index.d.ts +2 -2
- package/realtime/dist/index.js +2 -1
- package/realtime/package.json +1 -1
- package/realtime/src/realtime-continuity.ts +4 -3
- package/realtime-client/dist/index.cjs +29 -29
- package/realtime-client/dist/index.d.ts +2 -2
- package/realtime-client/dist/index.js +2 -2
- package/realtime-client/package.json +1 -1
- package/realtime-client/src/server-action.ts +2 -2
- package/realtime-client/src/sync-continuity.ts +23 -23
- package/realtime-react/dist/index.cjs +29 -29
- package/realtime-react/dist/index.d.ts +2 -2
- package/realtime-react/dist/index.js +2 -2
- package/realtime-react/package.json +1 -1
- package/realtime-react/src/use-server-action.ts +3 -3
- package/realtime-server/dist/index.cjs +54 -44
- package/realtime-server/dist/index.d.ts +5 -5
- package/realtime-server/dist/index.js +35 -25
- package/realtime-server/package.json +1 -1
- package/realtime-server/src/ipc-sockets/child-socket.ts +6 -6
- package/realtime-server/src/ipc-sockets/custom-socket.ts +4 -8
- package/realtime-server/src/ipc-sockets/parent-socket.ts +13 -7
- package/realtime-server/src/realtime-action-receiver.ts +7 -5
- package/realtime-server/src/realtime-continuity-synchronizer.ts +3 -3
- package/realtime-server/src/realtime-state-receiver.ts +3 -1
- package/realtime-testing/dist/index.cjs +15 -13
- package/realtime-testing/dist/index.js +10 -8
- package/realtime-testing/package.json +1 -1
- package/realtime-testing/src/setup-realtime-test.tsx +6 -4
- package/src/atom.ts +4 -8
- package/src/dispose.ts +1 -0
- package/src/index.ts +2 -9
- package/src/selector.ts +4 -8
- package/src/silo.ts +9 -3
- package/src/subscribe.ts +6 -6
- package/src/timeline.ts +4 -4
- package/src/transaction.ts +24 -24
- package/transceivers/set-rtx/dist/index.cjs +11 -12
- package/transceivers/set-rtx/dist/index.js +12 -13
- package/transceivers/set-rtx/package.json +1 -1
- package/transceivers/set-rtx/src/set-rtx.ts +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../../dist/chunk-
|
|
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
|
|
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
|
-
|
|
103
|
-
|
|
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
|
|
125
|
-
this.doStep(
|
|
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
|
|
158
|
+
const u = this.cache[this.cacheIdx];
|
|
160
159
|
this.cacheIdx--;
|
|
161
|
-
if (!
|
|
160
|
+
if (!u) {
|
|
162
161
|
return `OUT_OF_RANGE`;
|
|
163
162
|
}
|
|
164
|
-
this.undo(
|
|
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
|
|
189
|
-
this.add(
|
|
187
|
+
for (const v of values)
|
|
188
|
+
this.add(v);
|
|
190
189
|
break;
|
|
191
190
|
}
|
|
192
191
|
case `tx`: {
|
|
@@ -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
|
|
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
|
|
158
|
-
this.doStep(
|
|
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
|
|
194
|
+
const u = this.cache[this.cacheIdx]
|
|
195
195
|
this.cacheIdx--
|
|
196
|
-
if (!
|
|
196
|
+
if (!u) {
|
|
197
197
|
return `OUT_OF_RANGE`
|
|
198
198
|
}
|
|
199
|
-
this.undo(
|
|
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
|
|
224
|
+
for (const v of values) this.add(v)
|
|
225
225
|
break
|
|
226
226
|
}
|
|
227
227
|
case `tx`: {
|