on-zero 0.14.3 → 0.14.4

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.
Files changed (41) hide show
  1. package/README.md +7 -0
  2. package/dist/cjs/createUseQueryDirect.cjs +6 -6
  3. package/dist/cjs/createUseQueryDirect.native.js +6 -9
  4. package/dist/cjs/createUseQueryDirect.native.js.map +1 -1
  5. package/dist/cjs/createZeroClient.cjs +28 -30
  6. package/dist/cjs/createZeroClient.native.js +49 -35
  7. package/dist/cjs/createZeroClient.native.js.map +1 -1
  8. package/dist/cjs/provideZero.eagerInstance.test.cjs +196 -0
  9. package/dist/cjs/provideZero.eagerInstance.test.native.js +229 -0
  10. package/dist/cjs/provideZero.eagerInstance.test.native.js.map +1 -0
  11. package/dist/cjs/provideZero.ssr.test.cjs +60 -0
  12. package/dist/cjs/provideZero.ssr.test.native.js +69 -0
  13. package/dist/cjs/provideZero.ssr.test.native.js.map +1 -0
  14. package/dist/esm/createUseQueryDirect.mjs +6 -6
  15. package/dist/esm/createUseQueryDirect.mjs.map +1 -1
  16. package/dist/esm/createUseQueryDirect.native.js +6 -9
  17. package/dist/esm/createUseQueryDirect.native.js.map +1 -1
  18. package/dist/esm/createZeroClient.mjs +28 -30
  19. package/dist/esm/createZeroClient.mjs.map +1 -1
  20. package/dist/esm/createZeroClient.native.js +49 -35
  21. package/dist/esm/createZeroClient.native.js.map +1 -1
  22. package/dist/esm/provideZero.eagerInstance.test.mjs +197 -0
  23. package/dist/esm/provideZero.eagerInstance.test.mjs.map +1 -0
  24. package/dist/esm/provideZero.eagerInstance.test.native.js +227 -0
  25. package/dist/esm/provideZero.eagerInstance.test.native.js.map +1 -0
  26. package/dist/esm/provideZero.ssr.test.mjs +61 -0
  27. package/dist/esm/provideZero.ssr.test.mjs.map +1 -0
  28. package/dist/esm/provideZero.ssr.test.native.js +67 -0
  29. package/dist/esm/provideZero.ssr.test.native.js.map +1 -0
  30. package/package.json +2 -2
  31. package/src/createUseQueryDirect.tsx +22 -17
  32. package/src/createZeroClient.tsx +86 -75
  33. package/src/multiInstanceNested.test.tsx +2 -2
  34. package/src/provideZero.eagerInstance.test.tsx +235 -0
  35. package/src/provideZero.ssr.test.tsx +69 -0
  36. package/types/createUseQueryDirect.d.ts.map +1 -1
  37. package/types/createZeroClient.d.ts.map +1 -1
  38. package/types/provideZero.eagerInstance.test.d.ts +5 -0
  39. package/types/provideZero.eagerInstance.test.d.ts.map +1 -0
  40. package/types/provideZero.ssr.test.d.ts +2 -0
  41. package/types/provideZero.ssr.test.d.ts.map +1 -0
@@ -395,6 +395,10 @@ export function createZeroClientInternal<
395
395
  // run(), and waitForZero() resolve identically either way.
396
396
  function publishZeroInstance(zeroInstance: ZeroInstance): boolean {
397
397
  if (zeroInstance === zeroRuntime.zero) return false
398
+ // retiring the outgoing client and activating the replacement is one step:
399
+ // a write queued against the client being replaced must not land on its
400
+ // replacement, and fencing from a separate effect let the two orders drift.
401
+ if (zeroRuntime.zero) mutationLifecycle.fence()
398
402
  zeroRuntime.zero = zeroInstance
399
403
  mutationLifecycle.activate()
400
404
  const runner: ZeroRunner = (query, options) => zeroInstance.run(query as any, options)
@@ -430,12 +434,12 @@ export function createZeroClientInternal<
430
434
  })
431
435
  }
432
436
 
433
- // the provider creates the instance one effect-tick after mount, so on a
434
- // fresh page load (deep link) components render once before it exists. the
435
- // documented `useMutation(zero.mutate.x.y)` pattern dereferences `mutate`
436
- // during that render hand back a lazy path that resolves the live instance
437
- // at CALL time instead of throwing at property access. a call that fires
438
- // with still-no instance throws the same error, so real misuse stays loud.
437
+ // the documented `useMutation(zero.mutate.x.y)` pattern dereferences
438
+ // `mutate` wherever it is written, including above the provider and in
439
+ // module scope where no instance exists yet — hand back a lazy path that
440
+ // resolves the live instance at CALL time instead of throwing at property
441
+ // access. a call that fires with still-no instance throws the same error, so
442
+ // real misuse stays loud.
439
443
  function lazyMutatePath(path: string[]): any {
440
444
  const resolve = () => {
441
445
  if (zeroRuntime.zero === null) {
@@ -627,15 +631,22 @@ export function createZeroClientInternal<
627
631
  // created zero inside its own effect, every such cycle closed the live
628
632
  // instance mid-connect ("Failed to connect / Store is closed") and built a
629
633
  // replacement, killing in-flight queries and preloads. instead the instance
630
- // is created in an effect, cached here per identity key, handed to
631
- // ZeroProvider as an external `zero` (which it never closes), and the
632
- // previous instance is closed only when the key truly changes — a real
634
+ // is created during the provider's render, cached here per identity key,
635
+ // handed to ZeroProvider as an external `zero` (which it never closes), and
636
+ // the previous instance is closed only when the key truly changes — a real
633
637
  // identity change (user, storage, server, logged in/out), never a react
634
638
  // lifecycle artifact. single-provider assumption: one mounted ProvideZero
635
639
  // per client (true of every consumer); two simultaneously mounted providers
636
640
  // with different identities would thrash this slot.
637
641
  let cachedZero: { key: string; instance: ZeroInstance } | null = null
638
642
 
643
+ // instances the render phase displaced, waiting for a commit to close them.
644
+ // react can throw a render away, so a rotation is only PROVISIONAL until
645
+ // something commits: closing there would kill an instance the committed tree
646
+ // still holds. keyed so a render that swings back to a retired identity
647
+ // revives that instance instead of constructing a twin beside it.
648
+ const retiredZero = new Map<string, ZeroInstance>()
649
+
639
650
  // in-place re-mint: drop the current instance's local state then reconstruct a
640
651
  // fresh client WITHOUT a page reload — the native-safe recovery path (a reload
641
652
  // may never land on prod native, wedging the module latch). the mounted
@@ -944,66 +955,69 @@ export function createZeroClientInternal<
944
955
  remintGeneration,
945
956
  ])
946
957
 
947
- // create/rotate in an effect commit-safe: a discarded concurrent render
948
- // can never close an instance the committed tree still uses. a suspense
949
- // hide/reveal re-runs this effect with an unchanged keycache hit, no
950
- // churn, no cleanup-close. children mounting one effect-tick after the
951
- // provider matches ZeroProvider's internal-creation timing, which consumer
952
- // boot orchestration observes.
953
- const [instance, setInstance] = useState<ZeroInstance | undefined>()
954
-
955
- // a changed identity or disabled provider stops being ready before
956
- // descendant passive effects run. the outgoing instance remains cached
957
- // until the commit-safe rotation effect below closes or reuses it.
958
+ // create/rotate DURING RENDER. a consumer that reads `zero`, or a
959
+ // transport that has to be installed before the first connect, has to find
960
+ // a live client in its very first renderan effect is one tick too late,
961
+ // and in any environment where passive effects are delayed, discarded, or
962
+ // never flushed (workers, double-rendered roots, concurrent react) that
963
+ // tick may never arrive at all. idempotent by instanceKey, so strictmode's
964
+ // double-invoked render and a suspense hide/reveal both hit the cache: no
965
+ // churn, no second client.
966
+ //
967
+ // disable=true creates nothing. consumers toggle disable on/off mid-mount,
968
+ // and every hook below still runs in both states, so rules-of-hooks holds.
969
+ let liveInstance: ZeroInstance | undefined
970
+ if (!disable) {
971
+ if (cachedZero?.key !== instanceKey) {
972
+ if (cachedZero) retiredZero.set(cachedZero.key, cachedZero.instance)
973
+ const revived = retiredZero.get(instanceKey)
974
+ retiredZero.delete(instanceKey)
975
+ cachedZero = {
976
+ key: instanceKey,
977
+ instance:
978
+ revived ??
979
+ constructZeroInstance({
980
+ options: scopedProps as Omit<
981
+ ZeroOptions<Schema, ZeroMutators>,
982
+ 'schema' | 'mutators'
983
+ >,
984
+ transport,
985
+ beforeReload,
986
+ scheduleReload,
987
+ guardStorage,
988
+ benignLogPatterns,
989
+ }),
990
+ }
991
+ }
992
+ liveInstance = cachedZero.instance
993
+ }
994
+
995
+ // a disabled provider stops being ready before descendant passive effects
996
+ // run. the instance stays cached — disable is a gate, not a teardown — so
997
+ // flipping back on reuses it. a rotation needs nothing here: the render
998
+ // above already published the replacement.
958
999
  useLayoutEffect(() => {
959
- if (zeroRuntime.zero && (disable || cachedZero?.key !== instanceKey)) {
1000
+ if (disable && zeroRuntime.zero) {
960
1001
  mutationLifecycle.fence()
961
1002
  unpublishZeroInstance(zeroRuntime.zero)
962
1003
  }
963
- }, [disable, instanceKey])
964
-
1004
+ }, [disable])
1005
+
1006
+ // disposal is commit-only, so construction and teardown are deliberately
1007
+ // asymmetric. render can be thrown away and a provider can render without
1008
+ // ever mounting; closing an instance the committed tree still holds would
1009
+ // blank the app, so the render phase only retires and this closes. runs
1010
+ // after every commit because a discarded rotation can retire an instance
1011
+ // without instanceKey ever changing between two committed renders.
965
1012
  useEffect(() => {
966
- // disable=true: do not create / rotate any instance. consumers can
967
- // toggle disable on/off mid-mount without violating rules-of-hooks
968
- // because every hook still runs every render — only the effect body
969
- // (and the returned JSX, below) varies with disable.
970
- if (disable) {
971
- if (instance !== undefined) setInstance(undefined)
972
- return
973
- }
974
- let cached = cachedZero
975
- const options = scopedProps as Omit<
976
- ZeroOptions<Schema, ZeroMutators>,
977
- 'schema' | 'mutators'
978
- >
979
-
980
- if (cached?.key !== instanceKey) {
981
- if (cached) {
982
- // the replacement's SetZeroInstance effect publishes one version
983
- // change; clearing the old references here must not emit a second.
984
- clearZeroInstanceReferences(cached.instance)
985
- mutationLifecycle.fence()
986
- cached.instance.close()
987
- }
988
- cached = {
989
- key: instanceKey,
990
- instance: constructZeroInstance({
991
- options,
992
- transport,
993
- beforeReload,
994
- scheduleReload,
995
- guardStorage,
996
- benignLogPatterns,
997
- }),
998
- }
999
- cachedZero = cached
1000
- }
1001
- setInstance(cached.instance)
1002
- // identity is captured by instanceKey; function props are bound at
1003
- // construction. transport is also a dependency so a same-origin behavior
1004
- // change reaches the strict conflict check above.
1005
- // eslint-disable-next-line react-hooks/exhaustive-deps
1006
- }, [instanceKey, disable, transport])
1013
+ if (retiredZero.size === 0) return
1014
+ const outgoing = [...retiredZero.values()]
1015
+ retiredZero.clear()
1016
+ // close only. the replacement is already published and already fenced
1017
+ // the outgoing client's writes, and SetZeroInstance's effect emits the
1018
+ // one version change a rotation is allowed to produce.
1019
+ for (const zeroInstance of outgoing) zeroInstance.close()
1020
+ })
1007
1021
 
1008
1022
  // a changed token on the same identity refreshes auth in place — zero
1009
1023
  // sends an auth update over the live connection instead of reconnecting
@@ -1014,24 +1028,21 @@ export function createZeroClientInternal<
1014
1028
  const prevAuth = prevAuthRef.current
1015
1029
  prevAuthRef.current = auth
1016
1030
  if (
1017
- instance &&
1031
+ liveInstance &&
1018
1032
  typeof prevAuth === 'string' &&
1019
1033
  typeof auth === 'string' &&
1020
1034
  prevAuth !== auth
1021
1035
  ) {
1022
- instance.connection.connect({ auth })
1036
+ liveInstance.connection.connect({ auth })
1023
1037
  }
1024
- }, [instance, auth])
1038
+ }, [liveInstance, auth])
1025
1039
 
1026
1040
  // Always render the same shell shape, with or without an instance, and
1027
- // whether disable is true or false. While the instance is being
1028
- // constructed (first effect tick) — OR while disable=true we hand
1029
- // descendants the stub Zero plus DisabledContext='empty' so
1030
- // useZero/useQuery short-circuit instead of throwing. SetZeroInstance +
1031
- // ConnectionMonitor only mount once an active instance exists, as
1032
- // siblings of children — they NEVER wrap children, so toggling them
1033
- // never re-parents.
1034
- const liveInstance = disable ? undefined : instance
1041
+ // whether disable is true or false. While disable=true we hand descendants
1042
+ // the stub Zero plus DisabledContext='empty' so useZero/useQuery
1043
+ // short-circuit instead of throwing. SetZeroInstance + ConnectionMonitor
1044
+ // only mount once an active instance exists, as siblings of children
1045
+ // they NEVER wrap children, so toggling them never re-parents.
1035
1046
  return (
1036
1047
  <AuthDataContext.Provider value={authData}>
1037
1048
  <DisabledContext.Provider value={liveInstance ? false : 'empty'}>
@@ -142,8 +142,8 @@ function ControlUserProbe({ id, ttl }: { id: string; ttl?: number }) {
142
142
 
143
143
  function MaterializeProbe() {
144
144
  const zero = useZero() as any
145
- // ProvideZero hands children a stub Zero (no .materialize) until the real
146
- // instance is created in an effect. skip on the stub render.
145
+ // ProvideZero hands children a stub Zero (no .materialize) when disable=true.
146
+ // skip on the stub render.
147
147
  if (typeof zero.materialize !== 'function') return null
148
148
  if (!zero.__onZeroMaterializeProbe) {
149
149
  zero.__onZeroMaterializeProbe = true
@@ -0,0 +1,235 @@
1
+ // @vitest-environment jsdom
2
+ //
3
+ // Zero must be available in the consumer's FIRST render. Not one effect tick
4
+ // later, not after a passive-effect flush — immediately.
5
+ //
6
+ // regression: soot's sootsim tenant render worker rendered ProvideZero (its
7
+ // `globalThis.__testZero` was set, which only the provider's render body does)
8
+ // and still had no Zero: `zero.query` threw "Zero instance not initialized",
9
+ // and the http-pull page registry symbol was absent because the transport is
10
+ // installed inside constructZeroInstance. That tenant's passive effects never
11
+ // ran, and construction lived in a useEffect. Anywhere effects are delayed,
12
+ // discarded, or never flushed — workers, double-rendered roots, concurrent
13
+ // React — the same hole opens.
14
+
15
+ import { createSchema, string, table } from '@rocicorp/zero'
16
+ import { useZero } from '@rocicorp/zero/react'
17
+ import { act, StrictMode } from 'react'
18
+ import { createRoot, type Root } from 'react-dom/client'
19
+ import { renderToString } from 'react-dom/server'
20
+ import { afterEach, beforeEach, expect, test, vi } from 'vitest'
21
+
22
+ // counting constructions is the whole point here, so Zero is faked: a real
23
+ // client would open a store and a socket per test.
24
+ const fakeZero = vi.hoisted(() => {
25
+ const instances: any[] = []
26
+ class FakeZero {
27
+ readonly clientID: string
28
+ readonly context = {}
29
+ readonly query = {}
30
+ readonly connection = {
31
+ state: { current: { name: 'connecting' }, subscribe: () => () => {} },
32
+ connect: vi.fn(async () => {}),
33
+ }
34
+ readonly close = vi.fn()
35
+ readonly delete = vi.fn(async () => ({ errors: [] }))
36
+ readonly run = vi.fn(async () => [])
37
+ constructor(options: { userID?: string }) {
38
+ instances.push(this)
39
+ this.clientID = `fake-${instances.length}-${options.userID ?? 'anon'}`
40
+ }
41
+ }
42
+ return { FakeZero, instances }
43
+ })
44
+
45
+ vi.mock('@rocicorp/zero', async (importOriginal) => {
46
+ const actual = await importOriginal<typeof import('@rocicorp/zero')>()
47
+ return { ...actual, Zero: fakeZero.FakeZero }
48
+ })
49
+
50
+ import { createZeroClient } from './createZeroClient'
51
+
52
+ declare global {
53
+ // eslint-disable-next-line no-var
54
+ var IS_REACT_ACT_ENVIRONMENT: boolean | undefined
55
+ }
56
+ globalThis.IS_REACT_ACT_ENVIRONMENT = true
57
+
58
+ const todoTable = table('todo')
59
+ .columns({ id: string(), title: string() })
60
+ .primaryKey('id')
61
+ const schema = createSchema({ tables: [todoTable] })
62
+
63
+ let clientCount = 0
64
+ // each test gets its own client: the instance cache and the namespace registry
65
+ // are per-client and per-module, so sharing one leaks state across tests.
66
+ const makeClient = () =>
67
+ createZeroClient({
68
+ schema,
69
+ models: {},
70
+ groupedQueries: {},
71
+ instanceName: `eager-instance-${++clientCount}`,
72
+ })
73
+
74
+ let container: HTMLDivElement
75
+ let root: Root | null
76
+
77
+ beforeEach(() => {
78
+ fakeZero.instances.length = 0
79
+ container = document.createElement('div')
80
+ root = null
81
+ })
82
+
83
+ afterEach(() => {
84
+ if (root) act(() => root?.unmount())
85
+ })
86
+
87
+ test('a consumer reading zero in its first render gets a live instance, with no effects flushed', () => {
88
+ const client = makeClient()
89
+ const install = vi.fn()
90
+ const seen: {
91
+ facadeClientID?: string
92
+ contextClientID?: string
93
+ error?: string
94
+ transportInstalled?: boolean
95
+ } = {}
96
+
97
+ const Probe = () => {
98
+ // the transport has to be installed BEFORE the instance connects, so by
99
+ // the time a child renders it must already have happened.
100
+ seen.transportInstalled = install.mock.calls.length > 0
101
+ seen.contextClientID = (useZero() as unknown as { clientID: string }).clientID
102
+ try {
103
+ seen.facadeClientID = (client.zero as unknown as { clientID: string }).clientID
104
+ } catch (error) {
105
+ seen.error = (error as Error).message
106
+ }
107
+ return null
108
+ }
109
+
110
+ // renderToString never flushes an effect — that is exactly the environment
111
+ // the soot tenant was in.
112
+ renderToString(
113
+ <client.ProvideZero
114
+ cacheURL="http://127.0.0.1:7788/zero"
115
+ userID="first-render"
116
+ transport={{ install }}
117
+ >
118
+ <Probe />
119
+ </client.ProvideZero>
120
+ )
121
+
122
+ expect(seen.error).toBeUndefined()
123
+ expect(fakeZero.instances.length).toBe(1)
124
+ expect(seen.facadeClientID).toBe(fakeZero.instances[0].clientID)
125
+ expect(seen.contextClientID).toBe(fakeZero.instances[0].clientID)
126
+ expect(seen.transportInstalled).toBe(true)
127
+ })
128
+
129
+ test('the first committed render already carries the real instance', () => {
130
+ const client = makeClient()
131
+ const clientIDs: string[] = []
132
+ const Probe = () => {
133
+ clientIDs.push((useZero() as unknown as { clientID: string }).clientID)
134
+ return null
135
+ }
136
+
137
+ root = createRoot(container)
138
+ act(() => {
139
+ root?.render(
140
+ <client.ProvideZero cacheURL="http://127.0.0.1:7788/zero" userID="committed">
141
+ <Probe />
142
+ </client.ProvideZero>
143
+ )
144
+ })
145
+
146
+ // no render of a child ever sees the disabled stub
147
+ expect(clientIDs.length).toBeGreaterThan(0)
148
+ expect(clientIDs).not.toContain('disabled')
149
+ expect(clientIDs[0]).toBe(fakeZero.instances[0].clientID)
150
+ })
151
+
152
+ test('StrictMode double-invoked render constructs exactly one instance', () => {
153
+ const client = makeClient()
154
+ root = createRoot(container)
155
+ act(() => {
156
+ root?.render(
157
+ <StrictMode>
158
+ <client.ProvideZero cacheURL="http://127.0.0.1:7788/zero" userID="strict">
159
+ <span>ok</span>
160
+ </client.ProvideZero>
161
+ </StrictMode>
162
+ )
163
+ })
164
+
165
+ expect(fakeZero.instances.length).toBe(1)
166
+ expect(fakeZero.instances[0].close).not.toHaveBeenCalled()
167
+ })
168
+
169
+ test('an identity change rotates the instance and closes the outgoing one', () => {
170
+ const client = makeClient()
171
+ root = createRoot(container)
172
+ const render = (userID: string) =>
173
+ act(() => {
174
+ root?.render(
175
+ <client.ProvideZero cacheURL="http://127.0.0.1:7788/zero" userID={userID}>
176
+ <span>ok</span>
177
+ </client.ProvideZero>
178
+ )
179
+ })
180
+
181
+ render('one')
182
+ expect(fakeZero.instances.length).toBe(1)
183
+ render('two')
184
+ expect(fakeZero.instances.length).toBe(2)
185
+ expect(fakeZero.instances[0].close).toHaveBeenCalled()
186
+ expect(fakeZero.instances[1].close).not.toHaveBeenCalled()
187
+ })
188
+
189
+ test('a rotation that never commits is undone, not duplicated', () => {
190
+ const client = makeClient()
191
+ root = createRoot(container)
192
+ const mount = (userID: string) =>
193
+ act(() => {
194
+ root?.render(
195
+ <client.ProvideZero cacheURL="http://127.0.0.1:7788/zero" userID={userID}>
196
+ <span>ok</span>
197
+ </client.ProvideZero>
198
+ )
199
+ })
200
+
201
+ mount('committed')
202
+ const first = fakeZero.instances[0]
203
+
204
+ // stand-in for a render react throws away: a full render pass of the same
205
+ // provider at a different identity that no commit ever follows.
206
+ renderToString(
207
+ <client.ProvideZero cacheURL="http://127.0.0.1:7788/zero" userID="abandoned">
208
+ <span>ok</span>
209
+ </client.ProvideZero>
210
+ )
211
+ expect(fakeZero.instances.length).toBe(2)
212
+ // the committed tree's instance survives an uncommitted rotation
213
+ expect(first.close).not.toHaveBeenCalled()
214
+
215
+ // back to the committed identity: revive the original rather than build a
216
+ // third client beside it, and close the abandoned one
217
+ mount('committed')
218
+ expect(fakeZero.instances.length).toBe(2)
219
+ expect(first.close).not.toHaveBeenCalled()
220
+ expect(fakeZero.instances[1].close).toHaveBeenCalled()
221
+ })
222
+
223
+ test('disable=true constructs nothing', () => {
224
+ const client = makeClient()
225
+ root = createRoot(container)
226
+ act(() => {
227
+ root?.render(
228
+ <client.ProvideZero cacheURL="http://127.0.0.1:7788/zero" userID="off" disable>
229
+ <span>ok</span>
230
+ </client.ProvideZero>
231
+ )
232
+ })
233
+
234
+ expect(fakeZero.instances.length).toBe(0)
235
+ })
@@ -0,0 +1,69 @@
1
+ // @vitest-environment node
2
+ //
3
+ // eager construction is a CLIENT-runtime behavior. ProvideZero renders through
4
+ // ProvideZeroServer on a server runtime, which has no hooks and creates
5
+ // nothing: a render pass on the server must never open a store or a socket,
6
+ // and every descendant still gets the inert stub plus DisabledContext='empty'.
7
+
8
+ import { createSchema, string, table } from '@rocicorp/zero'
9
+ import { useZero } from '@rocicorp/zero/react'
10
+ import { renderToString } from 'react-dom/server'
11
+ import { expect, test, vi } from 'vitest'
12
+
13
+ const fakeZero = vi.hoisted(() => {
14
+ const instances: unknown[] = []
15
+ class FakeZero {
16
+ constructor() {
17
+ instances.push(this)
18
+ }
19
+ }
20
+ return { FakeZero, instances }
21
+ })
22
+
23
+ vi.mock('@rocicorp/zero', async (importOriginal) => {
24
+ const actual = await importOriginal<typeof import('@rocicorp/zero')>()
25
+ return { ...actual, Zero: fakeZero.FakeZero }
26
+ })
27
+
28
+ import { createZeroClient } from './createZeroClient'
29
+ import { IS_SERVER_RUNTIME } from './helpers/platform'
30
+
31
+ if (typeof window !== 'undefined') {
32
+ throw new Error('provideZero.ssr.test.tsx must run with @vitest-environment node')
33
+ }
34
+
35
+ const todoTable = table('todo')
36
+ .columns({ id: string(), title: string() })
37
+ .primaryKey('id')
38
+ const schema = createSchema({ tables: [todoTable] })
39
+
40
+ const client = createZeroClient({
41
+ schema,
42
+ models: {},
43
+ groupedQueries: {},
44
+ instanceName: 'ssr-eager-test',
45
+ })
46
+
47
+ test('the server runtime is what this file exercises', () => {
48
+ expect(IS_SERVER_RUNTIME).toBe(true)
49
+ })
50
+
51
+ test('rendering ProvideZero on the server constructs no client', () => {
52
+ let contextClientID: unknown
53
+ const Probe = () => {
54
+ contextClientID = (useZero() as unknown as { clientID: string }).clientID
55
+ return null
56
+ }
57
+
58
+ renderToString(
59
+ <client.ProvideZero cacheURL="http://127.0.0.1:7788/zero" userID="ssr">
60
+ <Probe />
61
+ </client.ProvideZero>
62
+ )
63
+
64
+ expect(fakeZero.instances.length).toBe(0)
65
+ expect(contextClientID).toBe('disabled')
66
+ expect(() => (client.zero as unknown as { clientID: string }).clientID).toThrow(
67
+ /Zero instance not initialized/
68
+ )
69
+ })
@@ -1 +1 @@
1
- {"version":3,"file":"createUseQueryDirect.d.ts","sourceRoot":"","sources":["../src/createUseQueryDirect.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAqD,KAAK,OAAO,EAAE,MAAM,OAAO,CAAA;AAEvF,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAIjE,OAAO,KAAK,EACV,gBAAgB,EAEhB,MAAM,IAAI,UAAU,EACrB,MAAM,gBAAgB,CAAA;AAkBvB,MAAM,MAAM,kBAAkB,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E,CAAC;;;;;EA+wCV"}
@@ -0,0 +1,5 @@
1
+ declare global {
2
+ var IS_REACT_ACT_ENVIRONMENT: boolean | undefined;
3
+ }
4
+ export {};
5
+ //# sourceMappingURL=provideZero.eagerInstance.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provideZero.eagerInstance.test.d.ts","sourceRoot":"","sources":["../src/provideZero.eagerInstance.test.tsx"],"names":[],"mappings":"AAmDA,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,wBAAwB,EAAE,OAAO,GAAG,SAAS,CAAA;CAClD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=provideZero.ssr.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provideZero.ssr.test.d.ts","sourceRoot":"","sources":["../src/provideZero.ssr.test.tsx"],"names":[],"mappings":""}