atom.io 0.30.2 → 0.30.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/package.json +22 -22
- package/react-devtools/dist/index.js +1 -1
- package/react-devtools/src/AtomIODevtools.tsx +1 -1
- package/react-devtools/src/elastic-input/NumberInput.tsx +0 -1
- package/react-devtools/src/elastic-input/TextInput.tsx +0 -1
- package/realtime/dist/index.d.ts +2 -1
- package/realtime/src/realtime-continuity.ts +3 -2
- package/realtime-server/dist/index.d.ts +9 -8
- package/realtime-server/dist/index.js +279 -234
- package/realtime-server/src/continuity/prepare-to-send-initial-payload.ts +54 -0
- package/realtime-server/src/continuity/prepare-to-serve-transaction-request.ts +53 -0
- package/realtime-server/src/continuity/prepare-to-sync-realtime-continuity.ts +145 -0
- package/realtime-server/src/continuity/prepare-to-track-client-acknowledgement.ts +38 -0
- package/realtime-server/src/continuity/subscribe-to-continuity-actions.ts +106 -0
- package/realtime-server/src/continuity/subscribe-to-continuity-perpectives.ts +60 -0
- package/realtime-server/src/index.ts +1 -1
- package/realtime-server/src/realtime-server-stores/server-sync-store.ts +11 -5
- package/realtime-server/src/realtime-continuity-synchronizer.ts +0 -343
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.3",
|
|
4
4
|
"description": "Composable and testable reactive data library.",
|
|
5
5
|
"homepage": "https://atom.io.fyi",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@floating-ui/react-dom": ">=2.0.0",
|
|
21
21
|
"@testing-library/react": ">=14.0.0",
|
|
22
22
|
"eslint": ">=9.0.0",
|
|
23
|
-
"
|
|
23
|
+
"motion": ">=11.0.0",
|
|
24
24
|
"react": ">=18.0.0",
|
|
25
25
|
"socket.io": ">=4.0.0",
|
|
26
26
|
"socket.io-client": ">=4.0.0"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"eslint": {
|
|
42
42
|
"optional": true
|
|
43
43
|
},
|
|
44
|
-
"
|
|
44
|
+
"motion": {
|
|
45
45
|
"optional": true
|
|
46
46
|
},
|
|
47
47
|
"socket.io": {
|
|
@@ -59,32 +59,32 @@
|
|
|
59
59
|
"@types/npmlog": "7.0.0",
|
|
60
60
|
"@types/react": "18.3.12",
|
|
61
61
|
"@types/tmp": "0.2.6",
|
|
62
|
-
"@typescript-eslint/parser": "8.
|
|
63
|
-
"@typescript-eslint/rule-tester": "8.
|
|
64
|
-
"@vitest/coverage-v8": "2.1.
|
|
65
|
-
"@vitest/ui": "2.1.
|
|
66
|
-
"concurrently": "9.0
|
|
67
|
-
"drizzle-kit": "0.
|
|
68
|
-
"drizzle-orm": "0.
|
|
69
|
-
"eslint": "9.
|
|
70
|
-
"
|
|
71
|
-
"happy-dom": "15.7.4",
|
|
62
|
+
"@typescript-eslint/parser": "8.14.0",
|
|
63
|
+
"@typescript-eslint/rule-tester": "8.14.0",
|
|
64
|
+
"@vitest/coverage-v8": "2.1.5",
|
|
65
|
+
"@vitest/ui": "2.1.5",
|
|
66
|
+
"concurrently": "9.1.0",
|
|
67
|
+
"drizzle-kit": "0.28.0",
|
|
68
|
+
"drizzle-orm": "0.36.1",
|
|
69
|
+
"eslint": "9.14.0",
|
|
70
|
+
"happy-dom": "15.11.4",
|
|
72
71
|
"http-proxy": "1.18.1",
|
|
72
|
+
"motion": "11.11.15",
|
|
73
73
|
"npmlog": "7.0.1",
|
|
74
|
-
"postgres": "3.4.
|
|
74
|
+
"postgres": "3.4.5",
|
|
75
75
|
"preact": "10.24.3",
|
|
76
76
|
"react": "18.3.1",
|
|
77
77
|
"react-dom": "18.3.1",
|
|
78
|
-
"react-router-dom": "6.
|
|
79
|
-
"socket.io": "4.8.
|
|
80
|
-
"socket.io-client": "4.8.
|
|
78
|
+
"react-router-dom": "6.28.0",
|
|
79
|
+
"socket.io": "4.8.1",
|
|
80
|
+
"socket.io-client": "4.8.1",
|
|
81
81
|
"tmp": "0.2.3",
|
|
82
|
-
"tsup": "8.3.
|
|
83
|
-
"tsx": "4.19.
|
|
82
|
+
"tsup": "8.3.5",
|
|
83
|
+
"tsx": "4.19.2",
|
|
84
84
|
"typescript": "5.6.3",
|
|
85
|
-
"vite": "5.4.
|
|
86
|
-
"vite-tsconfig-paths": "5.
|
|
87
|
-
"vitest": "2.1.
|
|
85
|
+
"vite": "5.4.11",
|
|
86
|
+
"vite-tsconfig-paths": "5.1.2",
|
|
87
|
+
"vitest": "2.1.5",
|
|
88
88
|
"zod": "3.23.8"
|
|
89
89
|
},
|
|
90
90
|
"main": "dist/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../dist/chunk-XWL6SNVU.js';
|
|
2
2
|
import { StoreContext, useI, useO } from 'atom.io/react';
|
|
3
|
-
import { motion, spring, LayoutGroup } from '
|
|
3
|
+
import { motion, spring, LayoutGroup } from 'motion/react';
|
|
4
4
|
import { forwardRef, useRef, useState, useImperativeHandle, useLayoutEffect, createContext, useId, Component, useContext, Fragment as Fragment$1 } from 'react';
|
|
5
5
|
import { undo, redo, getState } from 'atom.io';
|
|
6
6
|
import { IMPLICIT, createStandaloneAtom, createAtomFamily, findInStore, become } from 'atom.io/internal';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./devtools.scss"
|
|
2
2
|
|
|
3
3
|
import { StoreContext, useI, useO } from "atom.io/react"
|
|
4
|
-
import { LayoutGroup, motion, spring } from "
|
|
4
|
+
import { LayoutGroup, motion, spring } from "motion/react"
|
|
5
5
|
import { useContext, useRef } from "react"
|
|
6
6
|
|
|
7
7
|
import { StateIndex } from "./StateIndex"
|
|
@@ -166,7 +166,6 @@ export const NumberInput: FC<NumberInputProps> = ({
|
|
|
166
166
|
|
|
167
167
|
return (
|
|
168
168
|
<span>
|
|
169
|
-
{/* biome-ignore lint/a11y/noLabelWithoutControl: it's associated via htmlFor */}
|
|
170
169
|
{label ? <label htmlFor={htmlId}>{label}</label> : null}
|
|
171
170
|
{autoSize ? (
|
|
172
171
|
<ElasticInput
|
|
@@ -23,7 +23,6 @@ export const TextInput: FC<TextInputProps> = ({
|
|
|
23
23
|
const htmlId = useId()
|
|
24
24
|
return (
|
|
25
25
|
<span>
|
|
26
|
-
{/* biome-ignore lint/a11y/noLabelWithoutControl: it's associated via htmlFor */}
|
|
27
26
|
{label ? <label htmlFor={htmlId}>{label}</label> : null}
|
|
28
27
|
{autoSize ? (
|
|
29
28
|
<ElasticInput
|
package/realtime/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as atom_io from 'atom.io';
|
|
2
2
|
import { AtomFamilyToken, ReadableFamilyToken, ReadableToken, TokenType, AtomToken, TransactionToken, MutableAtomToken } from 'atom.io';
|
|
3
3
|
import { Canonical } from 'atom.io/json';
|
|
4
|
+
import { UserKey } from 'atom.io/realtime-server';
|
|
4
5
|
import * as atom_io_data from 'atom.io/data';
|
|
5
6
|
import { SetRTX, SetRTXJson } from 'atom.io/transceivers/set-rtx';
|
|
6
7
|
|
|
@@ -11,7 +12,7 @@ declare class InvariantMap<K, V> extends Map<K, V> {
|
|
|
11
12
|
type PerspectiveToken<F extends AtomFamilyToken<any>> = {
|
|
12
13
|
type: `realtime_perspective`;
|
|
13
14
|
resourceAtoms: F;
|
|
14
|
-
viewAtoms: ReadableFamilyToken<ReadableToken<TokenType<F>>[],
|
|
15
|
+
viewAtoms: ReadableFamilyToken<ReadableToken<TokenType<F>>[], UserKey>;
|
|
15
16
|
};
|
|
16
17
|
type ContinuityToken = {
|
|
17
18
|
readonly type: `continuity`;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
setEpochNumberOfContinuity,
|
|
13
13
|
} from "atom.io/internal"
|
|
14
14
|
import type { Canonical } from "atom.io/json"
|
|
15
|
+
import type { UserKey } from "atom.io/realtime-server"
|
|
15
16
|
|
|
16
17
|
/* eslint-disable no-console */
|
|
17
18
|
|
|
@@ -35,7 +36,7 @@ export class InvariantMap<K, V> extends Map<K, V> {
|
|
|
35
36
|
export type PerspectiveToken<F extends AtomFamilyToken<any>> = {
|
|
36
37
|
type: `realtime_perspective`
|
|
37
38
|
resourceAtoms: F
|
|
38
|
-
viewAtoms: ReadableFamilyToken<ReadableToken<TokenType<F>>[],
|
|
39
|
+
viewAtoms: ReadableFamilyToken<ReadableToken<TokenType<F>>[], UserKey>
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
export type ContinuityToken = {
|
|
@@ -96,7 +97,7 @@ export class SyncGroup {
|
|
|
96
97
|
{
|
|
97
98
|
const [family, index] = args as [
|
|
98
99
|
AtomFamilyToken<any, any>,
|
|
99
|
-
ReadableFamilyToken<ReadableToken<any>[],
|
|
100
|
+
ReadableFamilyToken<ReadableToken<any>[], UserKey>,
|
|
100
101
|
]
|
|
101
102
|
this.perspectives.push({
|
|
102
103
|
type: `realtime_perspective`,
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Subject, Transceiver, Store } from 'atom.io/internal';
|
|
2
2
|
import { Json, stringified, JsonIO, Canonical } from 'atom.io/json';
|
|
3
|
+
import { ContinuityToken, UserInRoomMeta } from 'atom.io/realtime';
|
|
3
4
|
import { ChildProcessWithoutNullStreams } from 'node:child_process';
|
|
4
5
|
import * as AtomIO from 'atom.io';
|
|
5
6
|
import { TransactionUpdateContent, TransactionUpdate, Hierarchy, WritableToken } from 'atom.io';
|
|
6
|
-
import { ContinuityToken, UserInRoomMeta } from 'atom.io/realtime';
|
|
7
7
|
import * as atom_io_data from 'atom.io/data';
|
|
8
8
|
import { Loadable } from 'atom.io/data';
|
|
9
9
|
import { SetRTX, SetRTXJson } from 'atom.io/transceivers/set-rtx';
|
|
10
10
|
|
|
11
|
+
type ExposeRealtimeContinuity = (continuity: ContinuityToken) => () => void;
|
|
12
|
+
declare function prepareToExposeRealtimeContinuity({ socket: initialSocket, store, }: ServerConfig): ExposeRealtimeContinuity;
|
|
13
|
+
|
|
11
14
|
type Events = Json.Object<string, Json.Serializable[]>;
|
|
12
15
|
type StringifiedEvent<Key extends string, Params extends Json.Serializable[]> = stringified<[Key, ...Params]>;
|
|
13
16
|
interface EventBuffer<Key extends string, Params extends Json.Serializable[]> extends Buffer {
|
|
@@ -82,9 +85,6 @@ declare class ParentSocket<I extends Events & {
|
|
|
82
85
|
type ActionReceiver = ReturnType<typeof realtimeActionReceiver>;
|
|
83
86
|
declare function realtimeActionReceiver({ socket, store, }: ServerConfig): <F extends JsonIO>(tx: AtomIO.TransactionToken<F>) => () => void;
|
|
84
87
|
|
|
85
|
-
type RealtimeContinuitySynchronizer = ReturnType<typeof realtimeContinuitySynchronizer>;
|
|
86
|
-
declare function realtimeContinuitySynchronizer({ socket: initialSocket, store, }: ServerConfig): (continuity: ContinuityToken) => () => void;
|
|
87
|
-
|
|
88
88
|
type FamilyProvider = ReturnType<typeof realtimeAtomFamilyProvider>;
|
|
89
89
|
declare function realtimeAtomFamilyProvider({ socket, store, }: ServerConfig): <J extends Json.Serializable, K extends Canonical>(family: AtomIO.RegularAtomFamilyToken<J, K>, index: AtomIO.ReadableToken<Iterable<K>>) => () => void;
|
|
90
90
|
|
|
@@ -107,10 +107,11 @@ declare const roomArgumentsAtoms: AtomIO.RegularAtomFamilyToken<RoomArguments, s
|
|
|
107
107
|
declare const roomSelectors: AtomIO.ReadonlySelectorFamilyToken<Loadable<ChildSocket<any, any>>, string>;
|
|
108
108
|
|
|
109
109
|
declare function redactTransactionUpdateContent(visibleStateKeys: string[], updates: TransactionUpdateContent[]): TransactionUpdateContent[];
|
|
110
|
-
declare const
|
|
110
|
+
declare const redactorAtoms: AtomIO.RegularAtomFamilyToken<{
|
|
111
111
|
occlude: (updates: TransactionUpdateContent[]) => TransactionUpdateContent[];
|
|
112
|
-
}, string
|
|
113
|
-
|
|
112
|
+
}, `user::${string}`>;
|
|
113
|
+
type ContinuitySyncTransactionUpdate = Pick<TransactionUpdate<any>, `epoch` | `id` | `key` | `output` | `updates`>;
|
|
114
|
+
declare const userUnacknowledgedQueues: AtomIO.RegularAtomFamilyToken<ContinuitySyncTransactionUpdate[], `user::${string}`>;
|
|
114
115
|
|
|
115
116
|
type SocketKey = `socket::${string}`;
|
|
116
117
|
type UserKey = `user::${string}`;
|
|
@@ -145,4 +146,4 @@ type ServerConfig = {
|
|
|
145
146
|
store?: Store;
|
|
146
147
|
};
|
|
147
148
|
|
|
148
|
-
export { type ActionReceiver, ChildSocket, type CreateRoomIO, CustomSocket, type EventBuffer, type Events, type FamilyProvider, type JoinRoomIO, type LeaveRoomIO, type MutableFamilyProvider, type MutableProvider, ParentSocket, type
|
|
149
|
+
export { type ActionReceiver, ChildSocket, type ContinuitySyncTransactionUpdate, type CreateRoomIO, CustomSocket, type EventBuffer, type Events, type ExposeRealtimeContinuity, type FamilyProvider, type JoinRoomIO, type LeaveRoomIO, type MutableFamilyProvider, type MutableProvider, ParentSocket, type RoomArguments, type RoomKey, type ServerConfig, type Socket, type SocketKey, type SocketSystemHierarchy, type StateProvider, type StateReceiver, type StringifiedEvent, SubjectSocket, type UserKey, createRoomTX, destroyRoomTX, joinRoomTX, leaveRoomTX, prepareToExposeRealtimeContinuity, realtimeActionReceiver, realtimeAtomFamilyProvider, realtimeMutableFamilyProvider, realtimeMutableProvider, realtimeStateProvider, realtimeStateReceiver, redactTransactionUpdateContent, redactorAtoms, roomArgumentsAtoms, roomSelectors, socketAtoms, socketIndex, userIndex, userUnacknowledgedQueues, usersOfSockets };
|