atom.io 0.18.3 → 0.19.1
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 +173 -1
- package/data/dist/index.d.ts +52 -21
- package/data/dist/index.js +12 -331
- package/data/src/join.ts +321 -53
- package/dist/{chunk-CVBEVTM5.js → chunk-7VCCW45K.js} +1 -39
- package/dist/chunk-7ZR244C2.js +489 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/internal/dist/index.cjs +1 -1
- package/internal/dist/index.d.ts +1 -1
- package/internal/dist/index.js +1 -1
- package/internal/src/mutable/tracker.ts +1 -1
- package/internal/src/set-state/become.ts +1 -1
- package/internal/src/subscribe/subscribe-to-state.ts +2 -2
- package/internal/src/timeline/add-atom-to-timeline.ts +3 -3
- package/internal/src/transaction/build-transaction.ts +1 -1
- package/introspection/dist/index.cjs +3 -2
- package/introspection/dist/index.d.ts +4 -4
- package/introspection/dist/index.js +3 -2
- package/introspection/src/attach-atom-index.ts +5 -4
- package/introspection/src/index.ts +3 -3
- package/json/dist/index.d.ts +1 -1
- package/json/dist/index.js +2 -2
- package/package.json +18 -19
- package/react-devtools/dist/index.cjs +218 -927
- package/react-devtools/dist/index.css +0 -18
- package/react-devtools/dist/index.d.ts +4 -4
- package/react-devtools/dist/index.js +181 -833
- package/react-devtools/src/AtomIODevtools.tsx +2 -1
- package/react-devtools/src/Button.tsx +3 -1
- package/react-devtools/src/StateEditor.tsx +13 -16
- package/react-devtools/src/StateIndex.tsx +22 -19
- package/react-devtools/src/TimelineIndex.tsx +11 -4
- package/react-devtools/src/TransactionIndex.tsx +10 -3
- package/react-devtools/src/Updates.tsx +10 -3
- package/realtime/dist/index.cjs +4 -2
- package/realtime/dist/index.d.ts +1 -96
- package/realtime/dist/index.js +5 -3
- package/realtime/src/shared-room-store.ts +5 -3
- package/realtime-react/dist/index.cjs +1 -1
- package/realtime-react/dist/index.js +1 -1
- package/realtime-react/src/use-single-effect.ts +1 -1
- package/realtime-server/dist/index.cjs +162 -18
- package/realtime-server/dist/index.d.ts +2 -92
- package/realtime-server/dist/index.js +31 -17
- package/realtime-server/src/ipc-sockets/child-socket.ts +1 -1
- package/realtime-server/src/realtime-continuity-synchronizer.ts +8 -6
- package/realtime-server/src/realtime-server-stores/server-room-external-actions.ts +22 -10
- package/realtime-server/src/realtime-server-stores/server-room-external-store.ts +2 -2
- package/realtime-testing/dist/index.cjs +48 -6
- package/realtime-testing/dist/index.js +10 -3
- package/realtime-testing/src/setup-realtime-test.tsx +9 -3
- package/src/silo.ts +4 -0
- package/src/validators.ts +2 -2
- /package/dist/{chunk-VAE5OCKN.js → chunk-BF4MVQF6.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as http from "http"
|
|
1
|
+
import * as http from "node:http"
|
|
2
2
|
|
|
3
3
|
import { prettyDOM, render } from "@testing-library/react"
|
|
4
4
|
import type { RenderResult } from "@testing-library/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
|
+
import { editRelationsInStore } from "../../data/src/join"
|
|
24
25
|
import { myUsernameState } from "../../realtime-client/src/realtime-client-stores"
|
|
25
26
|
|
|
26
27
|
let testNumber = 0
|
|
@@ -87,8 +88,13 @@ export const setupRealtimeTestServer = (
|
|
|
87
88
|
if (token === `test` && socket.id) {
|
|
88
89
|
const socketState = findInStore(RTS.socketAtoms, socket.id, silo.store)
|
|
89
90
|
setIntoStore(socketState, socket, silo.store)
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
editRelationsInStore(
|
|
92
|
+
RTS.usersOfSockets,
|
|
93
|
+
(relations) => {
|
|
94
|
+
relations.set(socket.id, username)
|
|
95
|
+
},
|
|
96
|
+
silo.store,
|
|
97
|
+
)
|
|
92
98
|
setIntoStore(RTS.userIndex, (index) => index.add(username), silo.store)
|
|
93
99
|
setIntoStore(RTS.socketIndex, (index) => index.add(socket.id), silo.store)
|
|
94
100
|
console.log(`${username} connected on ${socket.id}`)
|
package/src/silo.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
createStandaloneSelector,
|
|
8
8
|
createTimeline,
|
|
9
9
|
createTransaction,
|
|
10
|
+
findInStore,
|
|
10
11
|
getFromStore,
|
|
11
12
|
setIntoStore,
|
|
12
13
|
timeTravel,
|
|
@@ -23,6 +24,7 @@ import type {
|
|
|
23
24
|
RegularAtomFamilyOptions,
|
|
24
25
|
RegularAtomOptions,
|
|
25
26
|
RegularAtomToken,
|
|
27
|
+
findState,
|
|
26
28
|
getState,
|
|
27
29
|
redo,
|
|
28
30
|
setState,
|
|
@@ -42,6 +44,7 @@ export class Silo {
|
|
|
42
44
|
public selectorFamily: typeof selectorFamily
|
|
43
45
|
public transaction: typeof transaction
|
|
44
46
|
public timeline: typeof timeline
|
|
47
|
+
public findState: typeof findState
|
|
45
48
|
public getState: typeof getState
|
|
46
49
|
public setState: typeof setState
|
|
47
50
|
public subscribe: typeof subscribe
|
|
@@ -80,6 +83,7 @@ export class Silo {
|
|
|
80
83
|
this.selectorFamily = (options) => createSelectorFamily(options, s) as any
|
|
81
84
|
this.transaction = (options) => createTransaction(options, s)
|
|
82
85
|
this.timeline = (options) => createTimeline(options, s)
|
|
86
|
+
this.findState = (token, key) => findInStore(token, key, s) as any
|
|
83
87
|
this.getState = (token) => getFromStore(token, s)
|
|
84
88
|
this.setState = (token, newValue) => setIntoStore(token, newValue, s)
|
|
85
89
|
this.subscribe = (token, handler, key) => subscribe(token, handler, key, s)
|
package/src/validators.ts
CHANGED
|
@@ -24,8 +24,8 @@ export type TokenType<
|
|
|
24
24
|
> = Comparison extends ReadableToken<infer RepresentedValue>
|
|
25
25
|
? RepresentedValue
|
|
26
26
|
: Comparison extends ReadableFamilyToken<infer RepresentedValue, any>
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
? RepresentedValue
|
|
28
|
+
: never
|
|
29
29
|
|
|
30
30
|
export function isToken<KnownToken extends RegularAtomToken<any>>(
|
|
31
31
|
knownToken: KnownToken,
|
|
File without changes
|