atom.io 0.31.1 → 0.32.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.d.ts +867 -101
- package/data/dist/index.js +10 -558
- package/data/src/index.ts +0 -2
- package/data/src/struct-family.ts +1 -1
- package/data/src/struct.ts +1 -2
- package/dist/chunk-354XQWHH.js +153 -0
- package/dist/chunk-4LWKCEW3.js +14 -0
- package/dist/chunk-5F2V7S3B.js +83 -0
- package/dist/chunk-ECOMOMUN.js +631 -0
- package/dist/{chunk-Y5MBNTVU.js → chunk-GY2XQYZY.js} +1791 -703
- package/dist/chunk-NF7FJKJD.js +107 -0
- package/dist/chunk-R3ZUK5EH.js +1024 -0
- package/dist/chunk-Z2UJW4NQ.js +523 -0
- package/dist/index.d.ts +622 -26
- package/dist/index.js +1 -228
- package/eslint-plugin/dist/index.d.ts +1 -30
- package/eslint-plugin/dist/index.js +0 -146
- package/eslint-plugin/src/index.ts +0 -1
- package/eslint-plugin/src/rules/index.ts +0 -1
- package/internal/dist/index.d.ts +783 -64
- package/internal/dist/index.js +1 -1
- package/internal/src/atom/create-regular-atom.ts +3 -3
- package/internal/src/atom/dispose-atom.ts +4 -13
- package/internal/src/atom/is-default.ts +3 -3
- package/internal/src/caching.ts +5 -5
- package/internal/src/capitalize.ts +3 -0
- package/internal/src/families/create-readonly-selector-family.ts +5 -6
- package/internal/src/families/create-writable-selector-family.ts +1 -4
- package/internal/src/families/dispose-from-store.ts +3 -13
- package/internal/src/get-state/get-from-store.ts +2 -2
- package/internal/src/get-state/read-or-compute-value.ts +1 -1
- package/internal/src/index.ts +2 -0
- package/internal/src/install-into-store.ts +1 -1
- package/internal/src/join/edit-relations-in-store.ts +32 -0
- package/internal/src/join/find-relations-in-store.ts +124 -0
- package/internal/src/join/get-internal-relations-from-store.ts +14 -0
- package/internal/src/join/get-join.ts +31 -0
- package/internal/src/join/index.ts +5 -0
- package/{data/src/join.ts → internal/src/join/join-internal.ts} +20 -429
- package/internal/src/keys.ts +7 -7
- package/internal/src/mutable/create-mutable-atom-family.ts +1 -1
- package/internal/src/mutable/create-mutable-atom.ts +3 -3
- package/internal/src/mutable/get-json-token.ts +1 -1
- package/internal/src/mutable/tracker-family.ts +19 -17
- package/internal/src/mutable/tracker.ts +8 -8
- package/internal/src/pretty-print.ts +1 -1
- package/internal/src/selector/create-readonly-selector.ts +3 -7
- package/internal/src/selector/create-writable-selector.ts +4 -4
- package/internal/src/selector/dispose-selector.ts +20 -11
- package/internal/src/selector/get-selector-dependency-keys.ts +1 -1
- package/internal/src/selector/register-selector.ts +6 -9
- package/internal/src/selector/trace-selector-atoms.ts +2 -2
- package/internal/src/set-state/copy-mutable-if-needed.ts +1 -1
- package/internal/src/set-state/emit-update.ts +1 -1
- package/internal/src/set-state/evict-downstream.ts +1 -1
- package/internal/src/set-state/set-atom-or-selector.ts +1 -1
- package/internal/src/set-state/set-atom.ts +10 -10
- package/internal/src/set-state/set-into-store.ts +2 -2
- package/internal/src/set-state/stow-update.ts +1 -1
- package/internal/src/store/store.ts +1 -1
- package/internal/src/store/withdraw.ts +22 -22
- package/internal/src/subscribe/recall-state.ts +1 -1
- package/internal/src/subscribe/subscribe-in-store.ts +3 -3
- package/internal/src/subscribe/subscribe-to-root-atoms.ts +3 -3
- package/internal/src/subscribe/subscribe-to-state.ts +5 -5
- package/internal/src/subscribe/subscribe-to-timeline.ts +3 -3
- package/internal/src/subscribe/subscribe-to-transaction.ts +3 -3
- package/internal/src/timeline/create-timeline.ts +17 -37
- package/internal/src/transaction/act-upon-store.ts +2 -2
- package/internal/src/transaction/apply-transaction.ts +5 -5
- package/internal/src/transaction/assign-transaction-to-continuity.ts +1 -1
- package/internal/src/transaction/build-transaction.ts +5 -8
- package/internal/src/transaction/create-transaction.ts +3 -3
- package/internal/src/transaction/get-epoch-number.ts +3 -3
- package/internal/src/transaction/set-epoch-number.ts +2 -2
- package/introspection/dist/index.d.ts +922 -6
- package/introspection/dist/index.js +2 -620
- package/json/dist/index.d.ts +899 -5
- package/json/dist/index.js +1 -80
- package/json/src/select-json-family.ts +3 -14
- package/package.json +24 -42
- package/react/dist/index.d.ts +921 -3
- package/react/dist/index.js +2 -82
- package/react/src/use-o.ts +1 -1
- package/react/src/use-tl.ts +2 -2
- package/react-devtools/dist/index.css +16 -14
- package/react-devtools/dist/index.d.ts +26 -1
- package/react-devtools/dist/index.js +6 -6
- package/react-devtools/src/devtools.scss +16 -14
- package/realtime/dist/index.d.ts +202 -8
- package/realtime/dist/index.js +2 -107
- package/realtime/src/realtime-continuity.ts +2 -2
- package/realtime/src/shared-room-store.ts +1 -2
- package/realtime-client/dist/index.d.ts +960 -22
- package/realtime-client/dist/index.js +3 -509
- package/realtime-client/src/continuity/register-and-attempt-confirmed-update.ts +3 -3
- package/realtime-client/src/continuity/use-conceal-state.ts +1 -1
- package/realtime-client/src/pull-atom-family-member.ts +2 -2
- package/realtime-client/src/pull-atom.ts +2 -2
- package/realtime-client/src/pull-mutable-atom-family-member.ts +2 -2
- package/realtime-client/src/pull-mutable-atom.ts +2 -2
- package/realtime-client/src/pull-selector-family-member.ts +4 -4
- package/realtime-client/src/pull-selector.ts +4 -4
- package/realtime-client/src/push-state.ts +5 -10
- package/realtime-client/src/server-action.ts +4 -4
- package/realtime-client/src/sync-continuity.ts +6 -6
- package/realtime-react/dist/index.d.ts +166 -12
- package/realtime-react/dist/index.js +5 -154
- package/realtime-react/src/use-pull-atom-family-member.ts +1 -1
- package/realtime-react/src/use-pull-atom.ts +1 -1
- package/realtime-react/src/use-pull-mutable-atom.ts +1 -1
- package/realtime-react/src/use-pull-mutable-family-member.ts +1 -1
- package/realtime-react/src/use-pull-selector-family-member.ts +1 -1
- package/realtime-react/src/use-pull-selector.ts +1 -1
- package/realtime-react/src/use-push.ts +1 -1
- package/realtime-react/src/use-server-action.ts +2 -2
- package/realtime-react/src/use-sync-continuity.ts +1 -1
- package/realtime-server/dist/index.d.ts +971 -28
- package/realtime-server/dist/index.js +3 -1001
- package/realtime-server/src/continuity/prepare-to-serve-transaction-request.ts +1 -1
- package/realtime-server/src/continuity/prepare-to-sync-realtime-continuity.ts +3 -3
- package/realtime-server/src/continuity/subscribe-to-continuity-actions.ts +2 -2
- package/realtime-server/src/continuity/subscribe-to-continuity-perpectives.ts +2 -2
- package/realtime-server/src/realtime-action-receiver.ts +1 -1
- package/realtime-server/src/realtime-family-provider.ts +2 -2
- package/realtime-server/src/realtime-mutable-family-provider.ts +2 -2
- package/realtime-server/src/realtime-mutable-provider.ts +2 -2
- package/realtime-server/src/realtime-server-stores/server-room-external-actions.ts +2 -1
- package/realtime-server/src/realtime-server-stores/server-room-external-store.ts +1 -1
- package/realtime-server/src/realtime-server-stores/server-user-store.ts +1 -2
- package/realtime-server/src/realtime-state-provider.ts +2 -2
- package/realtime-testing/dist/index.d.ts +1091 -3
- package/realtime-testing/dist/index.js +20 -22
- package/realtime-testing/src/setup-realtime-test.tsx +2 -1
- package/src/index.ts +4 -0
- package/src/join.ts +218 -0
- package/src/silo.ts +4 -4
- package/src/timeline.ts +1 -1
- package/src/transaction.ts +4 -8
- package/transceivers/set-rtx/dist/index.d.ts +37 -2
- package/transceivers/set-rtx/dist/index.js +1 -215
- package/web/dist/index.d.ts +30 -1
- package/web/dist/index.js +1 -15
- package/data/src/until.ts +0 -15
- package/ephemeral/dist/index.d.ts +0 -67
- package/ephemeral/dist/index.js +0 -9
- package/ephemeral/package.json +0 -13
- package/ephemeral/src/index.ts +0 -1
- package/eslint-plugin/src/rules/lifespan.ts +0 -203
- package/immortal/dist/index.d.ts +0 -12
- package/immortal/dist/index.js +0 -9
- package/immortal/package.json +0 -13
- package/immortal/src/index.ts +0 -1
- package/immortal/src/seek-state.ts +0 -60
- /package/{ephemeral/src → src}/find-state.ts +0 -0
|
@@ -20,9 +20,9 @@ export function prepareToServeTransactionRequest(
|
|
|
20
20
|
performance.mark(performanceKeyStart)
|
|
21
21
|
try {
|
|
22
22
|
actUponStore(
|
|
23
|
+
store,
|
|
23
24
|
{ type: `transaction`, key: transactionKey },
|
|
24
25
|
updateId,
|
|
25
|
-
store,
|
|
26
26
|
)(...update.params)
|
|
27
27
|
} catch (thrown) {
|
|
28
28
|
if (thrown instanceof Error) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { findRelationsInStore } from "atom.io/data"
|
|
2
1
|
import {
|
|
3
2
|
findInStore,
|
|
3
|
+
findRelationsInStore,
|
|
4
4
|
getFromStore,
|
|
5
5
|
IMPLICIT,
|
|
6
6
|
subscribeToState,
|
|
@@ -50,7 +50,9 @@ export function prepareToExposeRealtimeContinuity({
|
|
|
50
50
|
store,
|
|
51
51
|
).socketKeyOfUser
|
|
52
52
|
const unsubscribeFromSocketTracking = subscribeToState(
|
|
53
|
+
store,
|
|
53
54
|
socketKeyState,
|
|
55
|
+
`sync-continuity:${continuityKey}:${userKey}`,
|
|
54
56
|
({ newValue: newSocketKey }) => {
|
|
55
57
|
store.logger.info(
|
|
56
58
|
`👋`,
|
|
@@ -77,8 +79,6 @@ export function prepareToExposeRealtimeContinuity({
|
|
|
77
79
|
)
|
|
78
80
|
}
|
|
79
81
|
},
|
|
80
|
-
`sync-continuity:${continuityKey}:${userKey}`,
|
|
81
|
-
store,
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
const userUnacknowledgedUpdates = getFromStore(
|
|
@@ -28,7 +28,9 @@ export function subscribeToContinuityActions(
|
|
|
28
28
|
|
|
29
29
|
for (const transaction of continuity.actions) {
|
|
30
30
|
const unsubscribeFromTransaction = subscribeToTransaction(
|
|
31
|
+
store,
|
|
31
32
|
transaction,
|
|
33
|
+
`sync-continuity:${continuityKey}:${userKey}`,
|
|
32
34
|
(update) => {
|
|
33
35
|
try {
|
|
34
36
|
const visibleKeys = continuity.globals
|
|
@@ -97,8 +99,6 @@ export function subscribeToContinuityActions(
|
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
},
|
|
100
|
-
`sync-continuity:${continuityKey}:${userKey}`,
|
|
101
|
-
store,
|
|
102
102
|
)
|
|
103
103
|
unsubscribeFunctions.push(unsubscribeFromTransaction)
|
|
104
104
|
}
|
|
@@ -22,7 +22,9 @@ export function subscribeToContinuityPerspectives(
|
|
|
22
22
|
const { viewAtoms } = perspective
|
|
23
23
|
const userViewState = findInStore(store, viewAtoms, userKey)
|
|
24
24
|
const unsubscribeFromUserView = subscribeToState(
|
|
25
|
+
store,
|
|
25
26
|
userViewState,
|
|
27
|
+
`sync-continuity:${continuityKey}:${userKey}:perspective:${perspective.resourceAtoms.key}`,
|
|
26
28
|
({ oldValue, newValue }) => {
|
|
27
29
|
const oldKeys = oldValue.map((token) => token.key)
|
|
28
30
|
const newKeys = newValue.map((token) => token.key)
|
|
@@ -51,8 +53,6 @@ export function subscribeToContinuityPerspectives(
|
|
|
51
53
|
socket?.emit(`conceal:${continuityKey}`, concealed)
|
|
52
54
|
}
|
|
53
55
|
},
|
|
54
|
-
`sync-continuity:${continuityKey}:${userKey}:perspective:${perspective.resourceAtoms.key}`,
|
|
55
|
-
store,
|
|
56
56
|
)
|
|
57
57
|
unsubFns.push(unsubscribeFromUserView)
|
|
58
58
|
}
|
|
@@ -19,7 +19,7 @@ export function realtimeActionReceiver({
|
|
|
19
19
|
const performanceKeyStart = `${performanceKey}:start`
|
|
20
20
|
const performanceKeyEnd = `${performanceKey}:end`
|
|
21
21
|
performance.mark(performanceKeyStart)
|
|
22
|
-
actUponStore<F>(tx, update.id
|
|
22
|
+
actUponStore<F>(store, tx, update.id)(...update.params)
|
|
23
23
|
performance.mark(performanceKeyEnd)
|
|
24
24
|
const metric = performance.measure(
|
|
25
25
|
performanceKey,
|
|
@@ -40,12 +40,12 @@ export function realtimeAtomFamilyProvider({
|
|
|
40
40
|
const token = findInStore(store, family, subKey)
|
|
41
41
|
socket.emit(`serve:${token.key}`, getFromStore(store, token))
|
|
42
42
|
const unsubscribe = subscribeToState(
|
|
43
|
+
store,
|
|
43
44
|
token,
|
|
45
|
+
`expose-family:${family.key}:${socket.id}`,
|
|
44
46
|
({ newValue }) => {
|
|
45
47
|
socket.emit(`serve:${token.key}`, newValue)
|
|
46
48
|
},
|
|
47
|
-
`expose-family:${family.key}:${socket.id}`,
|
|
48
|
-
store,
|
|
49
49
|
)
|
|
50
50
|
unsubCallbacksByKey.set(token.key, unsubscribe)
|
|
51
51
|
socket.on(`unsub:${token.key}`, () => {
|
|
@@ -49,12 +49,12 @@ export function realtimeMutableFamilyProvider({
|
|
|
49
49
|
const updateToken = getUpdateToken(token)
|
|
50
50
|
socket.emit(`init:${token.key}`, getFromStore(store, jsonToken))
|
|
51
51
|
const unsubscribe = subscribeToState(
|
|
52
|
+
store,
|
|
52
53
|
updateToken,
|
|
54
|
+
`expose-family:${family.key}:${socket.id}`,
|
|
53
55
|
({ newValue }) => {
|
|
54
56
|
socket.emit(`next:${token.key}`, newValue)
|
|
55
57
|
},
|
|
56
|
-
`expose-family:${family.key}:${socket.id}`,
|
|
57
|
-
store,
|
|
58
58
|
)
|
|
59
59
|
unsubCallbacksByKey.set(token.key, unsubscribe)
|
|
60
60
|
socket.on(`unsub:${token.key}`, () => {
|
|
@@ -34,12 +34,12 @@ export function realtimeMutableProvider({
|
|
|
34
34
|
const fillSubRequest = () => {
|
|
35
35
|
socket.emit(`init:${token.key}`, getFromStore(store, jsonToken))
|
|
36
36
|
unsubscribeFromStateUpdates = subscribeToState(
|
|
37
|
+
store,
|
|
37
38
|
trackerToken,
|
|
39
|
+
`expose-single:${socket.id}`,
|
|
38
40
|
({ newValue }) => {
|
|
39
41
|
socket.emit(`next:${token.key}`, newValue)
|
|
40
42
|
},
|
|
41
|
-
`expose-single:${socket.id}`,
|
|
42
|
-
store,
|
|
43
43
|
)
|
|
44
44
|
socket.on(`unsub:${token.key}`, fillUnsubRequest)
|
|
45
45
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Loadable } from "atom.io"
|
|
1
2
|
import * as AtomIO from "atom.io"
|
|
2
|
-
import { editRelationsInStore
|
|
3
|
+
import { editRelationsInStore } from "atom.io/internal"
|
|
3
4
|
import type { UserInRoomMeta } from "atom.io/realtime"
|
|
4
5
|
import { roomIndex, usersInRooms } from "atom.io/realtime"
|
|
5
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ChildProcessWithoutNullStreams } from "node:child_process"
|
|
2
2
|
import { spawn } from "node:child_process"
|
|
3
3
|
|
|
4
|
+
import type { Loadable } from "atom.io"
|
|
4
5
|
import { atomFamily, selectorFamily } from "atom.io"
|
|
5
|
-
import type { Loadable } from "atom.io/data"
|
|
6
6
|
|
|
7
7
|
import { ChildSocket } from "../ipc-sockets"
|
|
8
8
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Hierarchy } from "atom.io"
|
|
2
|
-
import { atom, atomFamily } from "atom.io"
|
|
3
|
-
import { join } from "atom.io/data"
|
|
2
|
+
import { atom, atomFamily, join } from "atom.io"
|
|
4
3
|
import type { SetRTXJson } from "atom.io/transceivers/set-rtx"
|
|
5
4
|
import { SetRTX } from "atom.io/transceivers/set-rtx"
|
|
6
5
|
|
|
@@ -18,12 +18,12 @@ export function realtimeStateProvider({
|
|
|
18
18
|
socket.emit(`serve:${token.key}`, getFromStore(store, token))
|
|
19
19
|
|
|
20
20
|
unsubscribeFromStateUpdates = subscribeToState(
|
|
21
|
+
store,
|
|
21
22
|
token,
|
|
23
|
+
`expose-single:${socket.id}`,
|
|
22
24
|
({ newValue }) => {
|
|
23
25
|
socket.emit(`serve:${token.key}`, newValue)
|
|
24
26
|
},
|
|
25
|
-
`expose-single:${socket.id}`,
|
|
26
|
-
store,
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
const fillUnsubRequest = () => {
|