@multiplatform.one/frappe 7.6.3 → 7.7.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/dist/cjs/fixtureDb.cjs +8 -0
- package/dist/cjs/fixtureDb.native.js +10 -0
- package/dist/cjs/fixtureDb.native.js.map +1 -1
- package/dist/cjs/sync/virtualPageManager.cjs +2 -1
- package/dist/cjs/sync/virtualPageManager.native.js +4 -1
- package/dist/cjs/sync/virtualPageManager.native.js.map +1 -1
- package/dist/cjs/useLiveQuery.cjs +2 -8
- package/dist/cjs/useLiveQuery.native.js +2 -9
- package/dist/cjs/useLiveQuery.native.js.map +1 -1
- package/dist/esm/fixtureDb.mjs +8 -0
- package/dist/esm/fixtureDb.mjs.map +1 -1
- package/dist/esm/fixtureDb.native.js +10 -0
- package/dist/esm/fixtureDb.native.js.map +1 -1
- package/dist/esm/sync/virtualPageManager.mjs +2 -1
- package/dist/esm/sync/virtualPageManager.mjs.map +1 -1
- package/dist/esm/sync/virtualPageManager.native.js +4 -1
- package/dist/esm/sync/virtualPageManager.native.js.map +1 -1
- package/dist/esm/useLiveQuery.mjs +2 -7
- package/dist/esm/useLiveQuery.mjs.map +1 -1
- package/dist/esm/useLiveQuery.native.js +2 -8
- package/dist/esm/useLiveQuery.native.js.map +1 -1
- package/dist/jsx/fixtureDb.mjs +8 -0
- package/dist/jsx/fixtureDb.mjs.map +1 -1
- package/dist/jsx/fixtureDb.native.js +10 -0
- package/dist/jsx/fixtureDb.native.js.map +1 -1
- package/dist/jsx/sync/virtualPageManager.mjs +2 -1
- package/dist/jsx/sync/virtualPageManager.mjs.map +1 -1
- package/dist/jsx/sync/virtualPageManager.native.js +4 -1
- package/dist/jsx/sync/virtualPageManager.native.js.map +1 -1
- package/dist/jsx/useLiveQuery.mjs +2 -7
- package/dist/jsx/useLiveQuery.mjs.map +1 -1
- package/dist/jsx/useLiveQuery.native.js +2 -9
- package/dist/jsx/useLiveQuery.native.js.map +1 -1
- package/package.json +7 -7
- package/src/devtools/FrappeDevtoolsPanel.spec.tsx +270 -0
- package/src/devtools/FrappeDevtoolsPanel.stories.tsx +233 -0
- package/src/devtools/plugin.spec.tsx +91 -0
- package/src/devtools/plugin.stories.tsx +77 -0
- package/src/fixtureDb.spec.ts +126 -0
- package/src/fixtureDb.ts +16 -0
- package/src/sync/virtualPageManager.spec.ts +62 -0
- package/src/sync/virtualPageManager.ts +8 -2
- package/src/useFrappeCollection.stories.tsx +166 -0
- package/src/useFrappeInfiniteList.stories.tsx +104 -0
- package/src/useFrappePendingMutations.spec.ts +241 -0
- package/src/useFrappePendingMutations.stories.tsx +102 -0
- package/src/useLiveQuery.spec.ts +43 -0
- package/src/useLiveQuery.ts +16 -15
- package/types/fixtureDb.d.ts.map +1 -1
- package/types/sync/virtualPageManager.d.ts.map +1 -1
- package/types/useLiveQuery.d.ts.map +1 -1
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFrappePendingMutations contract specs.
|
|
3
|
+
*
|
|
4
|
+
* This hook is the state behind the rejected-write UI contract: a surface
|
|
5
|
+
* that started an optimistic write reads `failed` from here and renders it
|
|
6
|
+
* inline (frappe-ui's SyncErrorNotice), with `retry` and `dismiss` as the two
|
|
7
|
+
* ways out. Three things are worth pinning, because each has a silent failure
|
|
8
|
+
* mode:
|
|
9
|
+
*
|
|
10
|
+
* - the SPLIT. `pending` and `failed` are derived from one ledger read, so a
|
|
11
|
+
* mis-filtered status would show a rejected write as still in flight.
|
|
12
|
+
* - the SIGNATURE GUARD. The hook re-reads on every store emit but only
|
|
13
|
+
* re-renders when ids × status × retryCount move; a broken guard turns a
|
|
14
|
+
* busy sync engine into a render storm.
|
|
15
|
+
* - the SCOPE. `doctype` narrows the ledger, and re-scoping has to re-read.
|
|
16
|
+
*
|
|
17
|
+
* The sync engine is mocked the same way frappeReact.spec.ts mocks it: the
|
|
18
|
+
* hook's whole dependency on it is getMutationEntries / subscribeStore /
|
|
19
|
+
* replayPending / dismissMutation.
|
|
20
|
+
*/
|
|
21
|
+
import { act, renderHook, waitFor } from "@testing-library/react";
|
|
22
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
23
|
+
|
|
24
|
+
const { mockGetMutationEntries, mockSubscribeStore, mockReplayPending, mockDismissMutation } =
|
|
25
|
+
vi.hoisted(() => ({
|
|
26
|
+
mockGetMutationEntries: vi.fn(),
|
|
27
|
+
mockSubscribeStore: vi.fn(),
|
|
28
|
+
mockReplayPending: vi.fn(),
|
|
29
|
+
mockDismissMutation: vi.fn(),
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
vi.mock("./sync", () => ({
|
|
33
|
+
SyncModule: class {
|
|
34
|
+
getMutationEntries = mockGetMutationEntries;
|
|
35
|
+
subscribeStore = mockSubscribeStore;
|
|
36
|
+
replayPending = mockReplayPending;
|
|
37
|
+
dismissMutation = mockDismissMutation;
|
|
38
|
+
subscribe = vi.fn();
|
|
39
|
+
unsubscribe = vi.fn();
|
|
40
|
+
},
|
|
41
|
+
}));
|
|
42
|
+
vi.mock("./realtime", () => ({ RealtimeModule: class {} }));
|
|
43
|
+
vi.mock("./core/http", () => ({ HttpClient: class {} }));
|
|
44
|
+
vi.mock("./db", () => ({ DbModule: class {} }));
|
|
45
|
+
vi.mock("./collection", () => ({
|
|
46
|
+
createFrappeCollection: vi.fn(),
|
|
47
|
+
releaseFrappeCollectionSync: () => false,
|
|
48
|
+
}));
|
|
49
|
+
vi.mock("./fixtureDb", () => ({ FixtureDbModule: class {} }));
|
|
50
|
+
|
|
51
|
+
const { mockIsBrowser } = vi.hoisted(() => ({ mockIsBrowser: vi.fn(() => true) }));
|
|
52
|
+
vi.mock("./util", () => ({ isBrowser: mockIsBrowser }));
|
|
53
|
+
|
|
54
|
+
import type { DebugMutationEntry } from "./sync/types";
|
|
55
|
+
import { Operation, Status } from "./sync/types";
|
|
56
|
+
import { useFrappePendingMutations } from "./frappeReact";
|
|
57
|
+
|
|
58
|
+
function entry(
|
|
59
|
+
id: string,
|
|
60
|
+
status: Status,
|
|
61
|
+
overrides: Partial<DebugMutationEntry> = {},
|
|
62
|
+
): DebugMutationEntry {
|
|
63
|
+
return {
|
|
64
|
+
id,
|
|
65
|
+
operation: Operation.Update,
|
|
66
|
+
doctype: "ToDo",
|
|
67
|
+
docname: id.toUpperCase(),
|
|
68
|
+
status,
|
|
69
|
+
createdAt: 1_700_000_000_000,
|
|
70
|
+
retryCount: 0,
|
|
71
|
+
...overrides,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
let storeListener: (() => void) | undefined;
|
|
76
|
+
|
|
77
|
+
beforeEach(() => {
|
|
78
|
+
vi.clearAllMocks();
|
|
79
|
+
storeListener = undefined;
|
|
80
|
+
mockIsBrowser.mockReturnValue(true);
|
|
81
|
+
mockGetMutationEntries.mockReturnValue([]);
|
|
82
|
+
mockSubscribeStore.mockImplementation((listener: () => void) => {
|
|
83
|
+
storeListener = listener;
|
|
84
|
+
return () => {
|
|
85
|
+
storeListener = undefined;
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// A distinct baseURL per test keeps the module-level SyncModule cache from
|
|
91
|
+
// handing one test the engine another test configured.
|
|
92
|
+
let n = 0;
|
|
93
|
+
const freshConfig = () => ({ baseURL: `https://ledger-${++n}.test` });
|
|
94
|
+
|
|
95
|
+
describe("useFrappePendingMutations ledger split", () => {
|
|
96
|
+
it("splits one ledger read into pending and failed", () => {
|
|
97
|
+
mockGetMutationEntries.mockReturnValue([
|
|
98
|
+
entry("a", Status.Pending),
|
|
99
|
+
entry("b", Status.Failed, { error: "rejected" }),
|
|
100
|
+
entry("c", Status.Pending),
|
|
101
|
+
]);
|
|
102
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
103
|
+
expect(result.current.entries).toHaveLength(3);
|
|
104
|
+
expect(result.current.pending.map((e) => e.id)).toEqual(["a", "c"]);
|
|
105
|
+
expect(result.current.failed.map((e) => e.id)).toEqual(["b"]);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("a confirmed entry is neither pending nor failed", () => {
|
|
109
|
+
mockGetMutationEntries.mockReturnValue([
|
|
110
|
+
entry("a", Status.Confirmed),
|
|
111
|
+
entry("b", Status.Failed),
|
|
112
|
+
]);
|
|
113
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
114
|
+
expect(result.current.pending).toHaveLength(0);
|
|
115
|
+
expect(result.current.failed.map((e) => e.id)).toEqual(["b"]);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("an empty ledger yields empty arrays, never undefined", () => {
|
|
119
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
120
|
+
expect(result.current.entries).toEqual([]);
|
|
121
|
+
expect(result.current.pending).toEqual([]);
|
|
122
|
+
expect(result.current.failed).toEqual([]);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("no config means no ledger and no engine read", () => {
|
|
126
|
+
const { result } = renderHook(() => useFrappePendingMutations(undefined));
|
|
127
|
+
expect(result.current.entries).toEqual([]);
|
|
128
|
+
expect(mockGetMutationEntries).not.toHaveBeenCalled();
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it("outside a browser the hook stays empty (server render)", () => {
|
|
132
|
+
mockIsBrowser.mockReturnValue(false);
|
|
133
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
134
|
+
expect(result.current.entries).toEqual([]);
|
|
135
|
+
expect(mockGetMutationEntries).not.toHaveBeenCalled();
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
describe("useFrappePendingMutations reactivity", () => {
|
|
140
|
+
it("subscribes to the store and re-reads on an emit", async () => {
|
|
141
|
+
mockGetMutationEntries.mockReturnValue([]);
|
|
142
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
143
|
+
expect(mockSubscribeStore).toHaveBeenCalled();
|
|
144
|
+
mockGetMutationEntries.mockReturnValue([entry("a", Status.Failed, { error: "boom" })]);
|
|
145
|
+
act(() => storeListener?.());
|
|
146
|
+
await waitFor(() => expect(result.current.failed).toHaveLength(1));
|
|
147
|
+
expect(result.current.failed[0]?.error).toBe("boom");
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it("an emit that does not move the ledger does not produce a new result object", () => {
|
|
151
|
+
mockGetMutationEntries.mockReturnValue([entry("a", Status.Pending)]);
|
|
152
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
153
|
+
const before = result.current;
|
|
154
|
+
act(() => storeListener?.());
|
|
155
|
+
act(() => storeListener?.());
|
|
156
|
+
expect(result.current).toBe(before);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("a retryCount bump is a real change and does reach the caller", async () => {
|
|
160
|
+
mockGetMutationEntries.mockReturnValue([entry("a", Status.Failed, { retryCount: 0 })]);
|
|
161
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
162
|
+
expect(result.current.failed[0]?.retryCount).toBe(0);
|
|
163
|
+
mockGetMutationEntries.mockReturnValue([entry("a", Status.Failed, { retryCount: 1 })]);
|
|
164
|
+
act(() => storeListener?.());
|
|
165
|
+
await waitFor(() => expect(result.current.failed[0]?.retryCount).toBe(1));
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("a status change from pending to failed moves the entry between the lists", async () => {
|
|
169
|
+
mockGetMutationEntries.mockReturnValue([entry("a", Status.Pending)]);
|
|
170
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
171
|
+
expect(result.current.pending).toHaveLength(1);
|
|
172
|
+
mockGetMutationEntries.mockReturnValue([entry("a", Status.Failed, { error: "nope" })]);
|
|
173
|
+
act(() => storeListener?.());
|
|
174
|
+
await waitFor(() => expect(result.current.failed).toHaveLength(1));
|
|
175
|
+
expect(result.current.pending).toHaveLength(0);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
it("unsubscribes from the store on unmount", () => {
|
|
179
|
+
const { unmount } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
180
|
+
expect(storeListener).toBeTypeOf("function");
|
|
181
|
+
unmount();
|
|
182
|
+
expect(storeListener).toBeUndefined();
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
describe("useFrappePendingMutations doctype scope", () => {
|
|
187
|
+
it("passes the doctype through to the ledger read", () => {
|
|
188
|
+
renderHook(() => useFrappePendingMutations(freshConfig(), "Note"));
|
|
189
|
+
expect(mockGetMutationEntries).toHaveBeenCalledWith("Note");
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it("an unscoped hook reads the whole ledger", () => {
|
|
193
|
+
renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
194
|
+
expect(mockGetMutationEntries).toHaveBeenCalledWith(undefined);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it("re-scoping re-reads with the new doctype", () => {
|
|
198
|
+
const config = freshConfig();
|
|
199
|
+
const { rerender } = renderHook(
|
|
200
|
+
({ doctype }: { doctype: string }) => useFrappePendingMutations(config, doctype),
|
|
201
|
+
{ initialProps: { doctype: "ToDo" } },
|
|
202
|
+
);
|
|
203
|
+
expect(mockGetMutationEntries).toHaveBeenCalledWith("ToDo");
|
|
204
|
+
rerender({ doctype: "Note" });
|
|
205
|
+
expect(mockGetMutationEntries).toHaveBeenCalledWith("Note");
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
describe("useFrappePendingMutations retry and dismiss", () => {
|
|
210
|
+
it("retry replays the pending queue on the engine", async () => {
|
|
211
|
+
mockReplayPending.mockResolvedValue(undefined);
|
|
212
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
213
|
+
await act(async () => {
|
|
214
|
+
await result.current.retry();
|
|
215
|
+
});
|
|
216
|
+
expect(mockReplayPending).toHaveBeenCalledTimes(1);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it("dismiss drops one entry by id, not the whole ledger", () => {
|
|
220
|
+
mockGetMutationEntries.mockReturnValue([entry("a", Status.Failed)]);
|
|
221
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
222
|
+
act(() => result.current.dismiss("a"));
|
|
223
|
+
expect(mockDismissMutation).toHaveBeenCalledWith("a");
|
|
224
|
+
expect(mockDismissMutation).toHaveBeenCalledTimes(1);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it("retry and dismiss are stable across re-renders", () => {
|
|
228
|
+
const config = freshConfig();
|
|
229
|
+
const { result, rerender } = renderHook(() => useFrappePendingMutations(config));
|
|
230
|
+
const { retry, dismiss } = result.current;
|
|
231
|
+
rerender();
|
|
232
|
+
expect(result.current.retry).toBe(retry);
|
|
233
|
+
expect(result.current.dismiss).toBe(dismiss);
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it("retry with no engine resolves rather than throwing", async () => {
|
|
237
|
+
mockIsBrowser.mockReturnValue(false);
|
|
238
|
+
const { result } = renderHook(() => useFrappePendingMutations(freshConfig()));
|
|
239
|
+
await expect(result.current.retry()).resolves.toBeUndefined();
|
|
240
|
+
});
|
|
241
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Button, Text, XStack, YStack } from "tamagui";
|
|
2
|
+
import {
|
|
3
|
+
type ToDo,
|
|
4
|
+
toDoFixtureData,
|
|
5
|
+
useSeededJournal,
|
|
6
|
+
useStoryConfig,
|
|
7
|
+
} from "../tests/storyFixtures";
|
|
8
|
+
import { useFrappeCollection, useFrappePendingMutations } from "./frappeReact";
|
|
9
|
+
import { Status } from "./sync/types";
|
|
10
|
+
import { useLiveQuery } from "./useLiveQuery";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: "Frappe/useFrappePendingMutations",
|
|
14
|
+
tags: ["!test"],
|
|
15
|
+
parameters: {
|
|
16
|
+
status: { type: "stable" },
|
|
17
|
+
docs: {
|
|
18
|
+
description: {
|
|
19
|
+
component:
|
|
20
|
+
"The mutation ledger behind the rejected-write UI contract: useFrappePendingMutations(config, doctype?) returns the live journal entries (pending + failed), a retry() that re-issues them with their original mutation ids, and dismiss(id) for a failed entry. The probe opens a ToDo subscription, then writes to two scripted documents: one whose update never acks (stays pending) and one the server rejects (failed, optimistic state rolled back). Network-hermetic (G-15/D-05): config.fixtures is an InMemoryFixtureProvider and nothing is fetched. Retry re-runs the same scripted writes, so the hanging one keeps hanging and the rejected one fails again; that is the ledger doing its job, not a bug in the story.",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
interface ProbeProps {
|
|
27
|
+
/** Seed the journal once the subscription is ready. */
|
|
28
|
+
seed?: boolean;
|
|
29
|
+
/** Scope the hook to one doctype. */
|
|
30
|
+
scope?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function LedgerProbe({ seed = true, scope }: ProbeProps) {
|
|
34
|
+
const config = useStoryConfig(toDoFixtureData(3));
|
|
35
|
+
const collection = useFrappeCollection<ToDo>(config, "ToDo");
|
|
36
|
+
const { data, isReady } = useLiveQuery(
|
|
37
|
+
(q) => (collection ? q.from({ todo: collection }) : null),
|
|
38
|
+
[collection],
|
|
39
|
+
);
|
|
40
|
+
useSeededJournal(config, Boolean(isReady), seed);
|
|
41
|
+
const ledger = useFrappePendingMutations(config, scope);
|
|
42
|
+
const rows = (data as ToDo[] | undefined) ?? [];
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<YStack gap="$3" data-testid="ledger-probe">
|
|
46
|
+
<Text fontWeight="600">useFrappePendingMutations(config{scope ? `, "${scope}"` : ""})</Text>
|
|
47
|
+
<Text fontSize="$2" data-testid="ledger-counts">
|
|
48
|
+
entries {ledger.entries.length} · pending {ledger.pending.length} · failed{" "}
|
|
49
|
+
{ledger.failed.length}
|
|
50
|
+
</Text>
|
|
51
|
+
<XStack gap="$2">
|
|
52
|
+
<Button size="$2" onPress={() => void ledger.retry()} disabled={!ledger.entries.length}>
|
|
53
|
+
Retry all
|
|
54
|
+
</Button>
|
|
55
|
+
</XStack>
|
|
56
|
+
<YStack gap="$1">
|
|
57
|
+
{ledger.entries.map((entry) => (
|
|
58
|
+
<XStack
|
|
59
|
+
key={entry.id}
|
|
60
|
+
gap="$3"
|
|
61
|
+
alignItems="center"
|
|
62
|
+
data-testid={`ledger-entry-${entry.status}`}
|
|
63
|
+
>
|
|
64
|
+
<Text fontSize="$2" width={80}>
|
|
65
|
+
{entry.status}
|
|
66
|
+
</Text>
|
|
67
|
+
<Text fontSize="$2" width={70}>
|
|
68
|
+
{entry.operation}
|
|
69
|
+
</Text>
|
|
70
|
+
<Text fontSize="$2" flex={1}>
|
|
71
|
+
{entry.doctype}/{entry.docname ?? "?"} · retries {entry.retryCount}
|
|
72
|
+
{entry.error ? ` · ${entry.error}` : ""}
|
|
73
|
+
</Text>
|
|
74
|
+
{entry.status === Status.Failed ? (
|
|
75
|
+
<Button size="$2" onPress={() => ledger.dismiss(entry.id)}>
|
|
76
|
+
Dismiss
|
|
77
|
+
</Button>
|
|
78
|
+
) : null}
|
|
79
|
+
</XStack>
|
|
80
|
+
))}
|
|
81
|
+
{ledger.entries.length === 0 ? (
|
|
82
|
+
<Text fontSize="$2" color="$color10">
|
|
83
|
+
The ledger is empty: every write has been acked.
|
|
84
|
+
</Text>
|
|
85
|
+
) : null}
|
|
86
|
+
</YStack>
|
|
87
|
+
<Text fontSize="$2" color="$color10" data-testid="ledger-rows">
|
|
88
|
+
cached rows: {rows.map((r) => `${r.name}=${r.status}`).join(" · ") || "(none)"}
|
|
89
|
+
</Text>
|
|
90
|
+
</YStack>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** One pending entry (TODO-HANGS) and one failed entry (TODO-REJECTS, rolled back to Open). */
|
|
95
|
+
export const Main = () => <LedgerProbe />;
|
|
96
|
+
Main.storyName = "Main";
|
|
97
|
+
|
|
98
|
+
/** Nothing written yet: entries, pending and failed are all empty. */
|
|
99
|
+
export const Clean = () => <LedgerProbe seed={false} />;
|
|
100
|
+
|
|
101
|
+
/** Scoped to another doctype: the ToDo entries exist but the hook reports none. */
|
|
102
|
+
export const ScopedToNote = () => <LedgerProbe scope="Note" />;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { isServer } from "@multiplatform.one/platform";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { useLiveQuery } from "./useLiveQuery";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* MPO-204 / MPO-192. `import.meta` is a PARSE-time SyntaxError in a classic
|
|
9
|
+
* script, and two bundles execute mpo as one: the vxrn/rolldown native bundle
|
|
10
|
+
* for Hermes, and any Metro bundle for platform=web — which is what an Expo
|
|
11
|
+
* DOM component (`'use dom'`) is. A try/catch cannot help, because the file
|
|
12
|
+
* never parses. So the token must be absent from the source, not merely
|
|
13
|
+
* guarded, and that is a property of the FILE, which is what this reads.
|
|
14
|
+
*/
|
|
15
|
+
describe("useLiveQuery carries no import.meta (MPO-204)", () => {
|
|
16
|
+
const source = readFileSync(resolve(process.cwd(), "src/useLiveQuery.ts"), "utf8").replace(
|
|
17
|
+
/\/\*[\s\S]*?\*\//g,
|
|
18
|
+
"",
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
it("contains no import.meta token", () => {
|
|
22
|
+
expect(source).not.toMatch(/import\.meta/);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("takes its SSR answer from the platform package, which is split by FILE and not by a bundler define", () => {
|
|
26
|
+
expect(source).toMatch(/import \{ isServer \} from "@multiplatform\.one\/platform";/);
|
|
27
|
+
expect(source).toMatch(/const IS_SSR: boolean = isServer;/);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("has no platform twin — a .web twin replaced the bake once already (MPO-192)", () => {
|
|
31
|
+
expect(source).toBeTruthy();
|
|
32
|
+
for (const twin of ["useLiveQuery.web.ts", "useLiveQuery.native.ts"]) {
|
|
33
|
+
expect(() => readFileSync(resolve(process.cwd(), "src", twin), "utf8")).toThrow();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("useLiveQuery answers client in a browser-like environment", () => {
|
|
39
|
+
it("resolves isServer false, so the hook delegates to @tanstack/react-db", () => {
|
|
40
|
+
expect(isServer).toBe(false);
|
|
41
|
+
expect(typeof useLiveQuery).toBe("function");
|
|
42
|
+
});
|
|
43
|
+
});
|
package/src/useLiveQuery.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isServer } from "@multiplatform.one/platform";
|
|
1
2
|
import { useLiveQuery as useLiveQueryBase } from "@tanstack/react-db";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -21,22 +22,22 @@ const SSR_LIVE_QUERY_RESULT = Object.freeze({
|
|
|
21
22
|
/**
|
|
22
23
|
* True when this module is evaluated during web server rendering.
|
|
23
24
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
25
|
+
* This used to read `import.meta.env.SSR` behind a try/catch. MPO-192 ruled
|
|
26
|
+
* that shape out: two bundles execute mpo as a CLASSIC script — the
|
|
27
|
+
* vxrn/rolldown native bundle for Hermes, and any Metro bundle for
|
|
28
|
+
* platform=web, which is what an Expo DOM component (`'use dom'`) is — and in
|
|
29
|
+
* a classic script `import.meta` is a PARSE-time SyntaxError, so the catch
|
|
30
|
+
* never gets to run. The whole module fails to parse and takes its consumers
|
|
31
|
+
* with it.
|
|
32
|
+
*
|
|
33
|
+
* `isServer` is the repo's own answer and carries no `import.meta`: it comes
|
|
34
|
+
* from @tamagui/constants through @multiplatform.one/platform, and it is
|
|
35
|
+
* split at the FILE level (`constants.native.ts` hardcodes `isServer = false`)
|
|
36
|
+
* rather than by a bundler define. Web server render is the only case that
|
|
37
|
+
* answers true — a browser has navigator + location, native takes the
|
|
38
|
+
* `.native` flavour, and a DOM component's WebView is a browser.
|
|
32
39
|
*/
|
|
33
|
-
const IS_SSR: boolean =
|
|
34
|
-
try {
|
|
35
|
-
return (import.meta as ImportMeta & { env?: { SSR?: boolean } }).env?.SSR === true;
|
|
36
|
-
} catch {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
})();
|
|
40
|
+
const IS_SSR: boolean = isServer;
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
43
|
* SSR-safe wrapper around `useLiveQuery` from `@tanstack/react-db`.
|
package/types/fixtureDb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtureDb.d.ts","sourceRoot":"","sources":["../src/fixtureDb.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;gBAE/B,QAAQ,EAAE,eAAe;IAIrC,UAAU,IAAI,MAAM,GAAG,SAAS;IAIhC,YAAY;;;;;;;;;IAYN,MAAM,CAAC,IAAI,SAAS,aAAa,EACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAYrB,aAAa,CAAC,QAAQ,EAA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EAAE,MAAM,GAAG;QACzC,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;KACpB;IAwBD;;OAEG;IACH,sBAAsB,CACpB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EAAE,EAChB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,EAC1B,OAAO,CAAC,EAAE,OAAO;YAmBL,iBAAiB;YA4CjB,cAAc;YA0Ed,iBAAiB;YA2CjB,eAAe;YA6Bf,YAAY;IAS1B,OAAO,CAAC,YAAY;IA4CpB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,oBAAoB;IAuC5B,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,iBAAiB;CAM1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveQuery.d.ts","sourceRoot":"","sources":["../src/useLiveQuery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLiveQuery.d.ts","sourceRoot":"","sources":["../src/useLiveQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAwCtE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,EAAE,OAAO,gBAIL,CAAC"}
|