atom.io 0.19.3 → 0.20.0
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.js +1 -1
- package/data/src/dict.ts +1 -1
- package/data/src/join.ts +1 -1
- package/data/src/struct-family.ts +1 -1
- package/data/src/struct.ts +5 -3
- package/eslint-plugin/dist/index.cjs +53 -0
- package/eslint-plugin/dist/index.js +52 -0
- package/eslint-plugin/src/index.ts +1 -0
- package/eslint-plugin/src/rules/explicit-state-types.ts +55 -0
- package/eslint-plugin/src/rules/index.ts +1 -0
- package/internal/dist/index.cjs +127 -92
- package/internal/dist/index.d.ts +13 -9
- package/internal/dist/index.js +127 -92
- package/internal/src/atom/index.ts +1 -1
- package/internal/src/caching.ts +13 -9
- package/internal/src/families/create-atom-family.ts +1 -1
- package/internal/src/families/find-in-store.ts +2 -2
- package/internal/src/families/index.ts +1 -1
- package/internal/src/future.ts +52 -15
- package/internal/src/index.ts +2 -2
- package/internal/src/mutable/create-mutable-atom-family.ts +2 -3
- package/internal/src/mutable/create-mutable-atom.ts +3 -3
- package/internal/src/mutable/get-update-token.ts +1 -0
- package/internal/src/selector/delete-selector.ts +1 -1
- package/internal/src/selector/register-selector.ts +1 -1
- package/internal/src/store/deposit.ts +1 -1
- package/internal/src/store/store.ts +2 -2
- package/internal/src/store/withdraw-new-family-member.ts +1 -1
- package/internal/src/store/withdraw.ts +2 -3
- package/internal/src/subscribe/subscribe-to-state.ts +1 -0
- package/internal/src/subscribe/subscribe-to-timeline.ts +1 -0
- package/internal/src/subscribe/subscribe-to-transaction.ts +2 -1
- package/internal/src/timeline/add-atom-to-timeline.ts +2 -2
- package/internal/src/timeline/create-timeline.ts +1 -1
- package/internal/src/transaction/act-upon-store.ts +1 -1
- package/internal/src/transaction/apply-transaction.ts +1 -1
- package/internal/src/transaction/build-transaction.ts +2 -2
- package/internal/src/transaction/create-transaction.ts +2 -2
- package/internal/src/transaction/index.ts +1 -1
- package/internal/src/transaction/is-root-store.ts +1 -1
- package/introspection/src/attach-atom-index.ts +1 -1
- package/introspection/src/attach-introspection-states.ts +2 -2
- package/introspection/src/attach-selector-index.ts +1 -1
- package/introspection/src/attach-timeline-family.ts +2 -2
- package/introspection/src/attach-timeline-index.ts +1 -1
- package/introspection/src/attach-transaction-index.ts +2 -2
- package/introspection/src/attach-transaction-logs.ts +2 -2
- package/json/dist/index.cjs +35 -33
- package/json/dist/index.d.ts +5 -5
- package/json/dist/index.js +5 -5
- package/json/src/index.ts +2 -3
- package/json/src/select-json-family.ts +6 -6
- package/json/src/select-json.ts +1 -2
- package/package.json +18 -15
- package/react/src/use-tl.ts +1 -1
- package/react-devtools/dist/index.cjs +99 -99
- package/react-devtools/dist/index.css +0 -3
- package/react-devtools/dist/index.d.ts +2 -2
- package/react-devtools/dist/index.js +77 -77
- package/react-devtools/src/AtomIODevtools.tsx +2 -2
- package/react-devtools/src/TransactionIndex.tsx +2 -2
- package/react-devtools/src/Updates.tsx +1 -1
- package/react-devtools/src/devtools.scss +0 -3
- package/react-devtools/src/index.ts +1 -1
- package/realtime/src/realtime-continuity.ts +1 -1
- package/realtime/src/shared-room-store.ts +1 -1
- package/realtime-client/dist/index.js +1 -1
- package/realtime-client/src/pull-atom-family-member.ts +1 -1
- package/realtime-client/src/pull-atom.ts +1 -1
- package/realtime-client/src/pull-mutable-atom-family-member.ts +2 -2
- package/realtime-client/src/sync-continuity.ts +1 -1
- package/realtime-react/dist/index.js +1 -1
- package/realtime-react/src/use-realtime-service.ts +1 -0
- package/realtime-react/src/use-sync-continuity.ts +2 -1
- package/realtime-server/dist/index.cjs +98 -98
- package/realtime-server/dist/index.d.ts +17 -18
- package/realtime-server/dist/index.js +100 -100
- package/realtime-server/src/index.ts +5 -5
- package/realtime-server/src/ipc-sockets/parent-socket.ts +3 -3
- package/realtime-server/src/realtime-action-receiver.ts +1 -1
- package/realtime-server/src/realtime-continuity-synchronizer.ts +2 -3
- package/realtime-server/src/realtime-family-provider.ts +1 -1
- package/realtime-server/src/realtime-mutable-family-provider.ts +1 -1
- package/realtime-server/src/realtime-mutable-provider.ts +2 -2
- package/realtime-server/src/realtime-server-stores/realtime-continuity-store.ts +2 -2
- package/realtime-server/src/realtime-server-stores/server-room-external-actions.ts +1 -1
- package/realtime-server/src/realtime-server-stores/server-room-external-store.ts +1 -0
- package/realtime-server/src/realtime-server-stores/server-user-store.ts +3 -2
- package/realtime-server/src/realtime-state-provider.ts +1 -1
- package/realtime-server/src/realtime-state-synchronizer.ts +1 -1
- package/realtime-testing/dist/index.js +2 -2
- package/realtime-testing/src/setup-realtime-test.tsx +3 -2
- package/src/atom.ts +1 -1
- package/src/find-state.ts +1 -1
- package/src/index.ts +1 -0
- package/src/selector.ts +1 -1
- package/src/silo.ts +4 -4
- package/src/subscribe.ts +2 -2
- package/src/timeline.ts +1 -1
- package/src/transaction.ts +3 -3
- package/transceivers/set-rtx/src/set-rtx.ts +1 -1
- package/dist/{chunk-ATKDGVTV.js → chunk-2AIFLP2B.js} +0 -0
- package/dist/{chunk-CC7IF7QF.js → chunk-3V3VWQ7X.js} +6 -6
- /package/dist/{chunk-MSCJWACE.js → chunk-SMZRGPN6.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { findRelationsInStore } from '../../dist/chunk-
|
|
1
|
+
import { findRelationsInStore } from '../../dist/chunk-SMZRGPN6.js';
|
|
2
2
|
import '../../dist/chunk-FTONNX2R.js';
|
|
3
3
|
import { __spreadProps, __spreadValues } from '../../dist/chunk-F2X4B4VY.js';
|
|
4
4
|
import { parseJson, stringifyJson } from 'atom.io/json';
|
|
5
|
-
import { getUpdateToken, IMPLICIT, Subject, getFromStore, subscribeToState, findInStore, getJsonToken, isRootStore, subscribeToTransaction,
|
|
5
|
+
import { getUpdateToken, IMPLICIT, Subject, getFromStore, subscribeToState, findInStore, getJsonToken, actUponStore, isRootStore, subscribeToTransaction, setIntoStore } from 'atom.io/internal';
|
|
6
6
|
import { SetRTX } from 'atom.io/transceivers/set-rtx';
|
|
7
7
|
import * as AtomIO from 'atom.io';
|
|
8
8
|
import { selectorFamily, atomFamily, atom } from 'atom.io';
|
|
@@ -306,6 +306,31 @@ var ParentSocket = class extends CustomSocket {
|
|
|
306
306
|
this.relayServices.push(attachServices);
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
|
+
function realtimeActionReceiver({
|
|
310
|
+
socket,
|
|
311
|
+
store = IMPLICIT.STORE
|
|
312
|
+
}) {
|
|
313
|
+
return function actionReceiver(tx) {
|
|
314
|
+
const fillTransactionRequest = (update) => {
|
|
315
|
+
const performanceKey = `tx-run:${tx.key}:${update.id}`;
|
|
316
|
+
const performanceKeyStart = `${performanceKey}:start`;
|
|
317
|
+
const performanceKeyEnd = `${performanceKey}:end`;
|
|
318
|
+
performance.mark(performanceKeyStart);
|
|
319
|
+
actUponStore(tx, update.id, store)(...update.params);
|
|
320
|
+
performance.mark(performanceKeyEnd);
|
|
321
|
+
const metric = performance.measure(
|
|
322
|
+
performanceKey,
|
|
323
|
+
performanceKeyStart,
|
|
324
|
+
performanceKeyEnd
|
|
325
|
+
);
|
|
326
|
+
store == null ? void 0 : store.logger.info(`\u{1F680}`, `transaction`, tx.key, update.id, metric.duration);
|
|
327
|
+
};
|
|
328
|
+
socket.on(`tx-run:${tx.key}`, fillTransactionRequest);
|
|
329
|
+
return () => {
|
|
330
|
+
socket.off(`tx-run:${tx.key}`, fillTransactionRequest);
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
}
|
|
309
334
|
selectorFamily({
|
|
310
335
|
key: `perspectiveRedactor`,
|
|
311
336
|
get: ({ userId, syncGroupKey }) => ({ get, find }) => {
|
|
@@ -743,55 +768,6 @@ function realtimeContinuitySynchronizer({
|
|
|
743
768
|
};
|
|
744
769
|
};
|
|
745
770
|
}
|
|
746
|
-
function realtimeStateProvider({
|
|
747
|
-
socket,
|
|
748
|
-
store = IMPLICIT.STORE
|
|
749
|
-
}) {
|
|
750
|
-
return function stateProvider(token) {
|
|
751
|
-
let unsubscribeFromStateUpdates;
|
|
752
|
-
const fillSubRequest = () => {
|
|
753
|
-
socket.emit(`serve:${token.key}`, getFromStore(token, store));
|
|
754
|
-
unsubscribeFromStateUpdates = subscribeToState(
|
|
755
|
-
token,
|
|
756
|
-
({ newValue }) => {
|
|
757
|
-
socket.emit(`serve:${token.key}`, newValue);
|
|
758
|
-
},
|
|
759
|
-
`expose-single:${socket.id}`,
|
|
760
|
-
store
|
|
761
|
-
);
|
|
762
|
-
const fillUnsubRequest = () => {
|
|
763
|
-
socket.off(`unsub:${token.key}`, fillUnsubRequest);
|
|
764
|
-
if (unsubscribeFromStateUpdates) {
|
|
765
|
-
unsubscribeFromStateUpdates();
|
|
766
|
-
unsubscribeFromStateUpdates = void 0;
|
|
767
|
-
}
|
|
768
|
-
};
|
|
769
|
-
socket.on(`unsub:${token.key}`, fillUnsubRequest);
|
|
770
|
-
};
|
|
771
|
-
socket.on(`sub:${token.key}`, fillSubRequest);
|
|
772
|
-
return () => {
|
|
773
|
-
socket.off(`sub:${token.key}`, fillSubRequest);
|
|
774
|
-
if (unsubscribeFromStateUpdates) {
|
|
775
|
-
unsubscribeFromStateUpdates();
|
|
776
|
-
unsubscribeFromStateUpdates = void 0;
|
|
777
|
-
}
|
|
778
|
-
};
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
function realtimeStateSynchronizer({
|
|
782
|
-
socket,
|
|
783
|
-
store = IMPLICIT.STORE
|
|
784
|
-
}) {
|
|
785
|
-
return function stateSynchronizer(token) {
|
|
786
|
-
const fillGetRequest = () => {
|
|
787
|
-
socket.emit(`value:${token.key}`, getFromStore(token, store));
|
|
788
|
-
};
|
|
789
|
-
socket.on(`get:${token.key}`, fillGetRequest);
|
|
790
|
-
return () => {
|
|
791
|
-
socket.off(`get:${token.key}`, fillGetRequest);
|
|
792
|
-
};
|
|
793
|
-
};
|
|
794
|
-
}
|
|
795
771
|
function realtimeAtomFamilyProvider({
|
|
796
772
|
socket,
|
|
797
773
|
store = IMPLICIT.STORE
|
|
@@ -838,38 +814,6 @@ function realtimeAtomFamilyProvider({
|
|
|
838
814
|
};
|
|
839
815
|
};
|
|
840
816
|
}
|
|
841
|
-
function realtimeMutableProvider({
|
|
842
|
-
socket,
|
|
843
|
-
store = IMPLICIT.STORE
|
|
844
|
-
}) {
|
|
845
|
-
return function mutableProvider(token) {
|
|
846
|
-
let unsubscribeFromStateUpdates = null;
|
|
847
|
-
const jsonToken = getJsonToken(token);
|
|
848
|
-
const trackerToken = getUpdateToken(token);
|
|
849
|
-
const fillUnsubRequest = () => {
|
|
850
|
-
socket.off(`unsub:${token.key}`, fillUnsubRequest);
|
|
851
|
-
unsubscribeFromStateUpdates == null ? void 0 : unsubscribeFromStateUpdates();
|
|
852
|
-
unsubscribeFromStateUpdates = null;
|
|
853
|
-
};
|
|
854
|
-
const fillSubRequest = () => {
|
|
855
|
-
socket.emit(`init:${token.key}`, getFromStore(jsonToken, store));
|
|
856
|
-
unsubscribeFromStateUpdates = subscribeToState(
|
|
857
|
-
trackerToken,
|
|
858
|
-
({ newValue }) => {
|
|
859
|
-
socket.emit(`next:${token.key}`, newValue);
|
|
860
|
-
},
|
|
861
|
-
`expose-single:${socket.id}`,
|
|
862
|
-
store
|
|
863
|
-
);
|
|
864
|
-
socket.on(`unsub:${token.key}`, fillUnsubRequest);
|
|
865
|
-
};
|
|
866
|
-
socket.on(`sub:${token.key}`, fillSubRequest);
|
|
867
|
-
return () => {
|
|
868
|
-
socket.off(`sub:${token.key}`, fillSubRequest);
|
|
869
|
-
unsubscribeFromStateUpdates == null ? void 0 : unsubscribeFromStateUpdates();
|
|
870
|
-
};
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
817
|
function realtimeMutableFamilyProvider({
|
|
874
818
|
socket,
|
|
875
819
|
store = IMPLICIT.STORE
|
|
@@ -918,6 +862,73 @@ function realtimeMutableFamilyProvider({
|
|
|
918
862
|
};
|
|
919
863
|
};
|
|
920
864
|
}
|
|
865
|
+
function realtimeMutableProvider({
|
|
866
|
+
socket,
|
|
867
|
+
store = IMPLICIT.STORE
|
|
868
|
+
}) {
|
|
869
|
+
return function mutableProvider(token) {
|
|
870
|
+
let unsubscribeFromStateUpdates = null;
|
|
871
|
+
const jsonToken = getJsonToken(token);
|
|
872
|
+
const trackerToken = getUpdateToken(token);
|
|
873
|
+
const fillUnsubRequest = () => {
|
|
874
|
+
socket.off(`unsub:${token.key}`, fillUnsubRequest);
|
|
875
|
+
unsubscribeFromStateUpdates == null ? void 0 : unsubscribeFromStateUpdates();
|
|
876
|
+
unsubscribeFromStateUpdates = null;
|
|
877
|
+
};
|
|
878
|
+
const fillSubRequest = () => {
|
|
879
|
+
socket.emit(`init:${token.key}`, getFromStore(jsonToken, store));
|
|
880
|
+
unsubscribeFromStateUpdates = subscribeToState(
|
|
881
|
+
trackerToken,
|
|
882
|
+
({ newValue }) => {
|
|
883
|
+
socket.emit(`next:${token.key}`, newValue);
|
|
884
|
+
},
|
|
885
|
+
`expose-single:${socket.id}`,
|
|
886
|
+
store
|
|
887
|
+
);
|
|
888
|
+
socket.on(`unsub:${token.key}`, fillUnsubRequest);
|
|
889
|
+
};
|
|
890
|
+
socket.on(`sub:${token.key}`, fillSubRequest);
|
|
891
|
+
return () => {
|
|
892
|
+
socket.off(`sub:${token.key}`, fillSubRequest);
|
|
893
|
+
unsubscribeFromStateUpdates == null ? void 0 : unsubscribeFromStateUpdates();
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
function realtimeStateProvider({
|
|
898
|
+
socket,
|
|
899
|
+
store = IMPLICIT.STORE
|
|
900
|
+
}) {
|
|
901
|
+
return function stateProvider(token) {
|
|
902
|
+
let unsubscribeFromStateUpdates;
|
|
903
|
+
const fillSubRequest = () => {
|
|
904
|
+
socket.emit(`serve:${token.key}`, getFromStore(token, store));
|
|
905
|
+
unsubscribeFromStateUpdates = subscribeToState(
|
|
906
|
+
token,
|
|
907
|
+
({ newValue }) => {
|
|
908
|
+
socket.emit(`serve:${token.key}`, newValue);
|
|
909
|
+
},
|
|
910
|
+
`expose-single:${socket.id}`,
|
|
911
|
+
store
|
|
912
|
+
);
|
|
913
|
+
const fillUnsubRequest = () => {
|
|
914
|
+
socket.off(`unsub:${token.key}`, fillUnsubRequest);
|
|
915
|
+
if (unsubscribeFromStateUpdates) {
|
|
916
|
+
unsubscribeFromStateUpdates();
|
|
917
|
+
unsubscribeFromStateUpdates = void 0;
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
socket.on(`unsub:${token.key}`, fillUnsubRequest);
|
|
921
|
+
};
|
|
922
|
+
socket.on(`sub:${token.key}`, fillSubRequest);
|
|
923
|
+
return () => {
|
|
924
|
+
socket.off(`sub:${token.key}`, fillSubRequest);
|
|
925
|
+
if (unsubscribeFromStateUpdates) {
|
|
926
|
+
unsubscribeFromStateUpdates();
|
|
927
|
+
unsubscribeFromStateUpdates = void 0;
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
};
|
|
931
|
+
}
|
|
921
932
|
function realtimeStateReceiver({
|
|
922
933
|
socket,
|
|
923
934
|
store = IMPLICIT.STORE
|
|
@@ -941,28 +952,17 @@ function realtimeStateReceiver({
|
|
|
941
952
|
};
|
|
942
953
|
};
|
|
943
954
|
}
|
|
944
|
-
function
|
|
955
|
+
function realtimeStateSynchronizer({
|
|
945
956
|
socket,
|
|
946
957
|
store = IMPLICIT.STORE
|
|
947
958
|
}) {
|
|
948
|
-
return function
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
const performanceKeyStart = `${performanceKey}:start`;
|
|
952
|
-
const performanceKeyEnd = `${performanceKey}:end`;
|
|
953
|
-
performance.mark(performanceKeyStart);
|
|
954
|
-
actUponStore(tx, update.id, store)(...update.params);
|
|
955
|
-
performance.mark(performanceKeyEnd);
|
|
956
|
-
const metric = performance.measure(
|
|
957
|
-
performanceKey,
|
|
958
|
-
performanceKeyStart,
|
|
959
|
-
performanceKeyEnd
|
|
960
|
-
);
|
|
961
|
-
store == null ? void 0 : store.logger.info(`\u{1F680}`, `transaction`, tx.key, update.id, metric.duration);
|
|
959
|
+
return function stateSynchronizer(token) {
|
|
960
|
+
const fillGetRequest = () => {
|
|
961
|
+
socket.emit(`value:${token.key}`, getFromStore(token, store));
|
|
962
962
|
};
|
|
963
|
-
socket.on(`
|
|
963
|
+
socket.on(`get:${token.key}`, fillGetRequest);
|
|
964
964
|
return () => {
|
|
965
|
-
socket.off(`
|
|
965
|
+
socket.off(`get:${token.key}`, fillGetRequest);
|
|
966
966
|
};
|
|
967
967
|
};
|
|
968
968
|
}
|
|
@@ -2,15 +2,15 @@ import type { Store } from "atom.io/internal"
|
|
|
2
2
|
import type { Json } from "atom.io/json"
|
|
3
3
|
|
|
4
4
|
export * from "./ipc-sockets"
|
|
5
|
+
export * from "./realtime-action-receiver"
|
|
5
6
|
export * from "./realtime-continuity-synchronizer"
|
|
6
|
-
export * from "./realtime-server-stores"
|
|
7
|
-
export * from "./realtime-state-provider"
|
|
8
|
-
export * from "./realtime-state-synchronizer"
|
|
9
7
|
export * from "./realtime-family-provider"
|
|
10
|
-
export * from "./realtime-mutable-provider"
|
|
11
8
|
export * from "./realtime-mutable-family-provider"
|
|
9
|
+
export * from "./realtime-mutable-provider"
|
|
10
|
+
export * from "./realtime-server-stores"
|
|
11
|
+
export * from "./realtime-state-provider"
|
|
12
12
|
export * from "./realtime-state-receiver"
|
|
13
|
-
export * from "./realtime-
|
|
13
|
+
export * from "./realtime-state-synchronizer"
|
|
14
14
|
// export * from "./realtime-action-synchronizer.txt"
|
|
15
15
|
|
|
16
16
|
export type Socket = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IMPLICIT, Subject } from "atom.io/internal"
|
|
2
|
-
import { parseJson, stringifyJson } from "atom.io/json"
|
|
3
2
|
import type { Json } from "atom.io/json"
|
|
4
|
-
|
|
3
|
+
import { parseJson, stringifyJson } from "atom.io/json"
|
|
5
4
|
import { SetRTX } from "atom.io/transceivers/set-rtx"
|
|
6
|
-
|
|
5
|
+
|
|
7
6
|
import type { EventBuffer, Events } from "./custom-socket"
|
|
7
|
+
import { CustomSocket } from "./custom-socket"
|
|
8
8
|
|
|
9
9
|
export class SubjectSocket<
|
|
10
10
|
I extends Events,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
2
|
import {
|
|
3
|
-
IMPLICIT,
|
|
4
3
|
actUponStore,
|
|
5
4
|
findInStore,
|
|
6
5
|
getFromStore,
|
|
7
6
|
getJsonToken,
|
|
7
|
+
IMPLICIT,
|
|
8
8
|
isRootStore,
|
|
9
9
|
subscribeToState,
|
|
10
10
|
subscribeToTransaction,
|
|
@@ -12,10 +12,9 @@ import {
|
|
|
12
12
|
import type { Json, JsonIO } from "atom.io/json"
|
|
13
13
|
import type { ContinuityToken } from "atom.io/realtime"
|
|
14
14
|
|
|
15
|
+
import { findRelationsInStore } from "../../data/src/join"
|
|
15
16
|
import type { ServerConfig, Socket } from "."
|
|
16
17
|
import { socketAtoms, usersOfSockets } from "."
|
|
17
|
-
|
|
18
|
-
import { findRelationsInStore } from "../../data/src/join"
|
|
19
18
|
import {
|
|
20
19
|
redactTransactionUpdateContent,
|
|
21
20
|
userUnacknowledgedQueues,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
2
|
import type { Transceiver } from "atom.io/internal"
|
|
3
3
|
import {
|
|
4
|
-
IMPLICIT,
|
|
5
4
|
findInStore,
|
|
6
5
|
getFromStore,
|
|
7
6
|
getJsonToken,
|
|
8
7
|
getUpdateToken,
|
|
8
|
+
IMPLICIT,
|
|
9
9
|
subscribeToState,
|
|
10
10
|
} from "atom.io/internal"
|
|
11
11
|
import type { Json } from "atom.io/json"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
|
+
import type { Transceiver } from "atom.io/internal"
|
|
2
3
|
import {
|
|
3
|
-
IMPLICIT,
|
|
4
4
|
getFromStore,
|
|
5
5
|
getJsonToken,
|
|
6
6
|
getUpdateToken,
|
|
7
|
+
IMPLICIT,
|
|
7
8
|
subscribeToState,
|
|
8
9
|
} from "atom.io/internal"
|
|
9
|
-
import type { Transceiver } from "atom.io/internal"
|
|
10
10
|
import type { Json } from "atom.io/json"
|
|
11
11
|
|
|
12
12
|
import type { ServerConfig } from "."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { selectorFamily } from "atom.io"
|
|
2
1
|
import type { TransactionUpdate } from "atom.io"
|
|
3
|
-
import {
|
|
2
|
+
import { selectorFamily } from "atom.io"
|
|
3
|
+
import { getJsonToken, getUpdateToken, IMPLICIT } from "atom.io/internal"
|
|
4
4
|
import type { JsonIO } from "atom.io/json"
|
|
5
5
|
import { SyncGroup } from "atom.io/realtime"
|
|
6
6
|
// import { completeUpdateAtoms } from "atom.io/realtime-server"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as AtomIO from "atom.io"
|
|
2
|
-
import {
|
|
2
|
+
import { editRelations, editRelationsInStore, type Loadable } from "atom.io/data"
|
|
3
3
|
import type { UserInRoomMeta } from "atom.io/realtime"
|
|
4
4
|
import { roomIndex, usersInRooms } from "atom.io/realtime"
|
|
5
5
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { atom, atomFamily } from "atom.io"
|
|
2
2
|
import { join } from "atom.io/data"
|
|
3
|
+
import type { SetRTXJson } from "atom.io/transceivers/set-rtx"
|
|
3
4
|
import { SetRTX } from "atom.io/transceivers/set-rtx"
|
|
4
5
|
|
|
5
6
|
import type { Socket } from ".."
|
|
@@ -9,14 +10,14 @@ export const socketAtoms = atomFamily<Socket | null, string>({
|
|
|
9
10
|
default: null,
|
|
10
11
|
})
|
|
11
12
|
|
|
12
|
-
export const socketIndex = atom({
|
|
13
|
+
export const socketIndex = atom<SetRTX<string>, SetRTXJson<string>>({
|
|
13
14
|
key: `socketsIndex`,
|
|
14
15
|
mutable: true,
|
|
15
16
|
default: () => new SetRTX<string>(),
|
|
16
17
|
toJson: (set) => set.toJSON(),
|
|
17
18
|
fromJson: (json) => SetRTX.fromJSON(json),
|
|
18
19
|
})
|
|
19
|
-
export const userIndex = atom({
|
|
20
|
+
export const userIndex = atom<SetRTX<string>, SetRTXJson<string>>({
|
|
20
21
|
key: `usersIndex`,
|
|
21
22
|
mutable: true,
|
|
22
23
|
default: () => new SetRTX<string>(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
|
-
import {
|
|
2
|
+
import { getFromStore, IMPLICIT, subscribeToState } from "atom.io/internal"
|
|
3
3
|
import type { Json } from "atom.io/json"
|
|
4
4
|
|
|
5
5
|
import type { ServerConfig } from "."
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { myUsernameState } from '../../dist/chunk-O47EQUM6.js';
|
|
2
|
-
import { editRelationsInStore } from '../../dist/chunk-
|
|
2
|
+
import { editRelationsInStore } from '../../dist/chunk-SMZRGPN6.js';
|
|
3
3
|
import '../../dist/chunk-FTONNX2R.js';
|
|
4
|
-
import { recordToEntries } from '../../dist/chunk-
|
|
4
|
+
import { recordToEntries } from '../../dist/chunk-3V3VWQ7X.js';
|
|
5
5
|
import '../../dist/chunk-BWWVY5O5.js';
|
|
6
6
|
import { __spreadProps, __spreadValues } from '../../dist/chunk-F2X4B4VY.js';
|
|
7
7
|
import * as http from 'http';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as http from "node:http"
|
|
2
2
|
|
|
3
|
-
import { prettyDOM, render } from "@testing-library/react"
|
|
4
3
|
import type { RenderResult } from "@testing-library/react"
|
|
4
|
+
import { prettyDOM, render } from "@testing-library/react"
|
|
5
5
|
import * as AtomIO from "atom.io"
|
|
6
6
|
import {
|
|
7
|
-
IMPLICIT,
|
|
8
7
|
clearStore,
|
|
9
8
|
findInStore,
|
|
10
9
|
getFromStore,
|
|
10
|
+
IMPLICIT,
|
|
11
11
|
setIntoStore,
|
|
12
12
|
} from "atom.io/internal"
|
|
13
13
|
import * as AR from "atom.io/react"
|
|
@@ -21,6 +21,7 @@ import type { Socket as ClientSocket } from "socket.io-client"
|
|
|
21
21
|
import { io } from "socket.io-client"
|
|
22
22
|
|
|
23
23
|
import { recordToEntries } from "~/packages/anvl/src/object"
|
|
24
|
+
|
|
24
25
|
import { editRelationsInStore } from "../../data/src/join"
|
|
25
26
|
import { myUsernameState } from "../../realtime-client/src/realtime-client-stores"
|
|
26
27
|
|
package/src/atom.ts
CHANGED
package/src/find-state.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
WritableToken,
|
|
14
14
|
} from "atom.io"
|
|
15
15
|
import type { Transceiver } from "atom.io/internal"
|
|
16
|
-
import {
|
|
16
|
+
import { findInStore, IMPLICIT } from "atom.io/internal"
|
|
17
17
|
import type { Json } from "atom.io/json"
|
|
18
18
|
|
|
19
19
|
export function findState<
|
package/src/index.ts
CHANGED
package/src/selector.ts
CHANGED
package/src/silo.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Transceiver } from "atom.io/internal"
|
|
2
2
|
import {
|
|
3
|
-
Store,
|
|
4
3
|
createAtomFamily,
|
|
5
4
|
createSelectorFamily,
|
|
6
5
|
createStandaloneAtom,
|
|
@@ -10,23 +9,24 @@ import {
|
|
|
10
9
|
findInStore,
|
|
11
10
|
getFromStore,
|
|
12
11
|
setIntoStore,
|
|
12
|
+
Store,
|
|
13
13
|
timeTravel,
|
|
14
14
|
} from "atom.io/internal"
|
|
15
15
|
import type { Json } from "atom.io/json"
|
|
16
16
|
|
|
17
17
|
import type {
|
|
18
18
|
AtomToken,
|
|
19
|
+
findState,
|
|
20
|
+
getState,
|
|
19
21
|
MutableAtomFamily,
|
|
20
22
|
MutableAtomFamilyOptions,
|
|
21
23
|
MutableAtomOptions,
|
|
22
24
|
MutableAtomToken,
|
|
25
|
+
redo,
|
|
23
26
|
RegularAtomFamily,
|
|
24
27
|
RegularAtomFamilyOptions,
|
|
25
28
|
RegularAtomOptions,
|
|
26
29
|
RegularAtomToken,
|
|
27
|
-
findState,
|
|
28
|
-
getState,
|
|
29
|
-
redo,
|
|
30
30
|
setState,
|
|
31
31
|
timeline,
|
|
32
32
|
undo,
|
package/src/subscribe.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Store } from "atom.io/internal"
|
|
2
2
|
import {
|
|
3
|
-
IMPLICIT,
|
|
4
3
|
arbitrary,
|
|
4
|
+
IMPLICIT,
|
|
5
5
|
subscribeToState,
|
|
6
6
|
subscribeToTimeline,
|
|
7
7
|
subscribeToTransaction,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
|
|
10
10
|
import type {
|
|
11
11
|
FamilyMetadata,
|
|
12
|
+
Func,
|
|
12
13
|
ReadableToken,
|
|
13
14
|
TimelineManageable,
|
|
14
15
|
TimelineToken,
|
|
15
16
|
TimelineUpdate,
|
|
16
17
|
TransactionToken,
|
|
17
18
|
TransactionUpdate,
|
|
18
|
-
Func,
|
|
19
19
|
} from "."
|
|
20
20
|
|
|
21
21
|
export type StateUpdate<T> = { newValue: T; oldValue: T }
|
package/src/timeline.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
TimelineSelectorUpdate,
|
|
5
5
|
TimelineTransactionUpdate,
|
|
6
6
|
} from "atom.io/internal"
|
|
7
|
-
import {
|
|
7
|
+
import { createTimeline, IMPLICIT, timeTravel } from "atom.io/internal"
|
|
8
8
|
|
|
9
9
|
import type { AtomFamilyToken, AtomToken } from "."
|
|
10
10
|
|
package/src/transaction.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { EnvironmentData } from "atom.io/internal"
|
|
2
2
|
import {
|
|
3
|
-
IMPLICIT,
|
|
4
3
|
actUponStore,
|
|
5
4
|
arbitrary,
|
|
6
5
|
createTransaction,
|
|
6
|
+
IMPLICIT,
|
|
7
7
|
} from "atom.io/internal"
|
|
8
8
|
|
|
9
9
|
import type {
|
|
10
|
+
findState,
|
|
11
|
+
Func,
|
|
10
12
|
KeyedStateUpdate,
|
|
11
13
|
ReadonlySelectorToken,
|
|
12
14
|
WritableToken,
|
|
13
|
-
findState,
|
|
14
|
-
Func,
|
|
15
15
|
} from "."
|
|
16
16
|
|
|
17
17
|
export type TransactionToken<F extends Func> = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Lineage, Transceiver, TransceiverMode } from "atom.io/internal"
|
|
2
2
|
import { Subject } from "atom.io/internal"
|
|
3
|
-
import type { Json,
|
|
3
|
+
import type { Json, primitive, Stringified } from "atom.io/json"
|
|
4
4
|
import { parseJson, stringifyJson } from "atom.io/json"
|
|
5
5
|
|
|
6
6
|
export type SetUpdate =
|
|
File without changes
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
// ../anvl/src/array/index.ts
|
|
2
|
+
var isArray = (isType) => (input) => Array.isArray(input) && input.every((item) => isType(item));
|
|
3
|
+
var map = (f) => (a) => a.map(f);
|
|
4
|
+
var every = (f = Boolean) => (a) => a.every(f);
|
|
5
|
+
var allTrue = every((x) => x === true);
|
|
6
|
+
|
|
1
7
|
// ../anvl/src/function/pipe.ts
|
|
2
8
|
function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
3
9
|
switch (arguments.length) {
|
|
@@ -46,12 +52,6 @@ var fallback = (fn, fallbackValue) => {
|
|
|
46
52
|
}
|
|
47
53
|
};
|
|
48
54
|
|
|
49
|
-
// ../anvl/src/array/index.ts
|
|
50
|
-
var isArray = (isType) => (input) => Array.isArray(input) && input.every((item) => isType(item));
|
|
51
|
-
var map = (f) => (a) => a.map(f);
|
|
52
|
-
var every = (f = Boolean) => (a) => a.every(f);
|
|
53
|
-
var allTrue = every((x) => x === true);
|
|
54
|
-
|
|
55
55
|
// ../anvl/src/nullish/index.ts
|
|
56
56
|
var isUndefined = (input) => input === void 0;
|
|
57
57
|
var ifDefined = (validate) => (input) => isUndefined(input) || validate(input);
|
|
File without changes
|