@confect/react 10.0.0-next.21 → 10.0.0-next.23

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/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # @confect/react
2
2
 
3
+ ## 10.0.0-next.23
4
+
5
+ No changes in this release.
6
+
7
+ ## 10.0.0-next.22
8
+
9
+ ### Minor Changes
10
+
11
+ - 6cc5834: Add experimental stream querying with reactive pagination, configurable middleware policies, and broader tracing.
12
+
13
+ ### Stream queries and pagination
14
+
15
+ Create composable Effect streams with `reader.table(...).stream(index, range?, order?)` and `QueryStream` from `@confect/server`. Merge, filter, map, join, deduplicate, narrow, and reverse queries without losing cursor pagination. Order keys and directions are checked by the type system. Joins support left-join placeholders through `onEmpty`, and effectful filters and maps support ordered concurrency. Reversing a distinct stream preserves its chosen representatives.
16
+
17
+ `QueryStream.paginate` resumes from indexed cursor bounds and supports pinned page ranges, automatic split recommendations, and `maximumRowsRead`/`maximumBytesRead` budgets that count underlying query-stream reads, including filtered documents. Byte counts are estimates. If a budget prevents safe progress or splitting, pagination fails with `ReadBudgetExceededError`; increase the budget or reduce the query's read requirements.
18
+
19
+ Use React's new `useStreamPaginatedQuery` for these queries:
20
+
21
+ ```ts
22
+ import { useStreamPaginatedQuery } from "@confect/react";
23
+
24
+ const { results, status, loadMore } = useStreamPaginatedQuery(
25
+ refs.public.notes.feed,
26
+ {},
27
+ {
28
+ initialNumItems: 10,
29
+ maximumRowsRead: 1000,
30
+ maximumBytesRead: 512 * 1024,
31
+ },
32
+ );
33
+ ```
34
+
35
+ The hook pins loaded pages to fixed ranges, splits oversized or budget-limited pages, and restarts pagination on invalid cursors. Foldkit's `PaginatedQuery` also supports stream queries and preserves page ranges when navigating back and forward, avoiding skipped or repeated documents as data changes.
36
+
37
+ Stream cursors expose their order-key values. Do not paginate publicly over sensitive indexed fields unless they are pinned with `eq`. All `QueryStream` APIs are experimental.
38
+
39
+ ### Middleware options
40
+
41
+ Declare a lazy `options` schema on `MiddlewareSpec.MiddlewareSpec`, then pass typed values with `.middleware(Policy, options)` on functions or groups. Options are validated without coercion during codegen and server registration; keep schemas and values client-safe because generated refs carry them.
42
+
43
+ The same policy can be attached repeatedly with non-equivalent options. Every attachment runs, with group policies before function policies. Equivalent options and duplicate policies without options are rejected. Register implementations against the same spec used for attachments.
44
+
45
+ ### Breaking changes
46
+
47
+ Middleware callbacks passed to `MiddlewareImpl.make` or `MiddlewareImpl.makeByFunctionType` receive invocation metadata under `invocation`. To migrate, nest destructuring of `name`, `functionType`, `functionVisibility`, and decoded `args`:
48
+
49
+ **Before:**
50
+
51
+ ```ts
52
+ (effect, { name, args }) => effect;
53
+ ```
54
+
55
+ **After:**
56
+
57
+ ```ts
58
+ (effect, { invocation: { name, args } }) => effect;
59
+ ```
60
+
61
+ Middleware with an options schema also receives `options` alongside `invocation`; middleware without one keeps its single-argument attachment API and receives only `{ invocation }`.
62
+
63
+ ### Fixes and tracing
64
+ - Preserve `ConvexError.data` when a handler throws a `ConvexError` inside an Effect instead of returning it as a typed failure.
65
+ - Add named tracing spans for JavaScript client calls, server function execution, database writes and pagination, `QueryStream.unique`/`QueryStream.paginate`, and `confect codegen`/`confect dev` code-generation passes.
66
+
67
+ ### Patch Changes
68
+
69
+ - 9f4e2c0: Require `effect@^4.0.0-rc.113` across `@confect/*` and raise `@confect/server`'s optional `@effect/platform-node` peer to the same range. Upgrade Effect alongside Confect; existing Confect call sites are unchanged.
70
+
71
+ Effect's own APIs include breaking renames: use `Config.String` instead of `Config.string`, and `LanguageModel.LanguageModel` instead of `LanguageModel.Service` when annotating the result of `AiGatewayLanguageModel.make`. See the [Effect RC 113 release notes](https://github.com/Effect-TS/effect/releases/tag/effect%404.0.0-rc.113) for the complete migration guidance.
72
+
73
+ - 90c80e9: Require `effect@^4.0.0-rc.115` across `@confect/*` and `@effect/platform-node@^4.0.0-rc.115` when using `@confect/server`'s optional Node integration. Upgrade these dependencies alongside Confect; existing Confect call sites are unchanged.
74
+ - f721d2c: Remove spaces around em dashes and separator slashes in API documentation and `confect codegen` diagnostics.
75
+
3
76
  ## 10.0.0-next.21
4
77
 
5
78
  ### Major Changes
@@ -9,7 +82,7 @@
9
82
  ### Breaking Changes
10
83
  - `engines.node` is now `>=24` on every `@confect/*` package, raised from `>=22`.
11
84
 
12
- Node 22 has entered maintenance, so Confect now targets Node 24, the active LTS line. To migrate, move the Node version your project builds and runs on to 24 or later — on Node 22, installing `@confect/*` now fails your package manager's engine check. No API changes accompany the raise: code already running on Node 24 needs no edits.
85
+ Node 22 has entered maintenance, so Confect now targets Node 24, the active LTS line. To migrate, move the Node version your project builds and runs on to 24 or later—on Node 22, installing `@confect/*` now fails your package manager's engine check. No API changes accompany the raise: code already running on Node 24 needs no edits.
13
86
 
14
87
  ## 10.0.0-next.20
15
88
 
@@ -34,14 +107,14 @@
34
107
  Breaking changes for users:
35
108
 
36
109
  - **Schemas** follow Effect v4's Schema API: `Schema.Union([a, b])` (array form), `Schema.Literals([...])` for literal unions, `Schema.optionalKey` in place of `optionalWith({ exact: true })`, and checks like `Schema.String.check(Schema.isMaxLength(...))` in place of piped filters.
37
- - **Option-returning functions** must use a codec with a serializable encoded form, such as `Schema.OptionFromNullOr(...)` — v4's `Schema.Option` encodes to an `Option` instance, which is not a Convex value.
38
- - **Table schemas** may now be transformations (`Schema.decodeTo` chains, `Schema.encodeKeys`), branded structs, suspended schemas, or unions of these — Convex's system fields are carried through the whole encoding chain. Schemas that do not resolve to an object shape at every step (such as `Schema.Class`) are rejected with a descriptive error when the table is defined.
110
+ - **Option-returning functions** must use a codec with a serializable encoded form, such as `Schema.OptionFromNullOr(...)`—v4's `Schema.Option` encodes to an `Option` instance, which is not a Convex value.
111
+ - **Table schemas** may now be transformations (`Schema.decodeTo` chains, `Schema.encodeKeys`), branded structs, suspended schemas, or unions of these—Convex's system fields are carried through the whole encoding chain. Schemas that do not resolve to an object shape at every step (such as `Schema.Class`) are rejected with a descriptive error when the table is defined.
39
112
  - **Clients**: decode failures surface as `SchemaError` rather than `ParseError` in `@confect/js` and `@confect/react`, and `@confect/react`'s `useMutation`/`useAction` handles with an `error` schema now resolve to `Result` (v4's replacement for `Either`).
40
- - **HTTP** is now mounted through the renamed `HttpRouter` module (formerly `HttpApi`). `HttpRouter.make(routes)` takes a single route-registering `Layer` composed from Effect's own `effect/unstable/http` and `effect/unstable/httpapi` modules — `HttpApiBuilder.layer(api)` (with group handler layers supplied via `Layer.provide`; a missing group is a compile-time error), `HttpApiScalar.layer` for docs, `HttpRouter.add` for plain routes, and `HttpRouter.middleware(fn, { global: true })` for middleware, merged with `Layer.mergeAll`. The per-path-prefix record and its `api`/`apiLive`/`middleware`/`scalar` options are gone; Confect registers one catch-all Convex HTTP action at `/`, and plain Convex routes added to the returned router still take precedence. Handlers, middleware, and route-layer construction all run with Confect's Convex-aware `ConfigProvider` in context.
113
+ - **HTTP** is now mounted through the renamed `HttpRouter` module (formerly `HttpApi`). `HttpRouter.make(routes)` takes a single route-registering `Layer` composed from Effect's own `effect/unstable/http` and `effect/unstable/httpapi` modules—`HttpApiBuilder.layer(api)` (with group handler layers supplied via `Layer.provide`; a missing group is a compile-time error), `HttpApiScalar.layer` for docs, `HttpRouter.add` for plain routes, and `HttpRouter.middleware(fn, { global: true })` for middleware, merged with `Layer.mergeAll`. The per-path-prefix record and its `api`/`apiLive`/`middleware`/`scalar` options are gone; Confect registers one catch-all Convex HTTP action at `/`, and plain Convex routes added to the returned router still take precedence. Handlers, middleware, and route-layer construction all run with Confect's Convex-aware `ConfigProvider` in context.
41
114
  - **Node actions** use `effect/unstable/process` (`ChildProcessSpawner`) and `@effect/platform-node`'s `NodeServices` in place of `@effect/platform` `Command`/`NodeContext`.
42
115
  - **Configuration**: Confect's Convex-aware `ConfigProvider` treats empty-string environment variables as missing values (matching Effect v4's built-in providers), so `Config.withDefault` and `Config.option` recover from them.
43
116
  - **CLI**: a malformed `convex.json` now fails codegen with a descriptive error instead of being silently ignored.
44
- - Confect queries no longer stub the global `Date.now`. Queries run with a `Clock` whose unsafe accessors return constants, so Effect-internal reads (log timestamps, spans) never evict a query from Convex's cache; explicit time reads — `Clock.currentTimeMillis`/`currentTimeNanos` or a raw `Date.now()` call — opt the query out and evict as they honestly should.
117
+ - Confect queries no longer stub the global `Date.now`. Queries run with a `Clock` whose unsafe accessors return constants, so Effect-internal reads (log timestamps, spans) never evict a query from Convex's cache; explicit time reads—`Clock.currentTimeMillis`/`currentTimeNanos` or a raw `Date.now()` call—opt the query out and evict as they honestly should.
45
118
 
46
119
  ### Patch Changes
47
120
 
@@ -56,9 +129,9 @@
56
129
  - Raise the required `effect` peer version to `^4.0.0-beta.102` (from `^4.0.0-beta.101`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
57
130
  - Raise the required `effect` peer version to `^4.0.0-beta.105` (from `^4.0.0-beta.102`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
58
131
 
59
- `beta.103` separates wall-clock time from monotonic elapsed time: `Clock.Clock` now also requires `monotonicTimeNanos` and `monotonicTimeNanosUnsafe`, so a custom `Clock` provided to a Confect function has to supply both. Effects that measure elapsed time — `Effect.timed`, duration metrics, `Sink.withDuration` — read the monotonic accessors instead of the wall clock, and continue to report a zero duration inside queries and mutations, where Confect pins the unsafe accessors to constants to keep Convex's query cache from evicting on every logged span.
132
+ `beta.103` separates wall-clock time from monotonic elapsed time: `Clock.Clock` now also requires `monotonicTimeNanos` and `monotonicTimeNanosUnsafe`, so a custom `Clock` provided to a Confect function has to supply both. Effects that measure elapsed time—`Effect.timed`, duration metrics, `Sink.withDuration`—read the monotonic accessors instead of the wall clock, and continue to report a zero duration inside queries and mutations, where Confect pins the unsafe accessors to constants to keep Convex's query cache from evicting on every logged span.
60
133
 
61
- `beta.103` also moves synchronous Effect runs off `setImmediate`/`setTimeout` and onto the microtask queue, which Convex's query and mutation isolate permits. Confect no longer suppresses cooperative fiber yielding for the synchronous work it performs while your modules load — registration and schema-to-validator compilation — and relies on that scheduling instead. Neither the "Can't use `setTimeout` in queries and mutations" crash nor any other consumer-visible behavior changes, but this is the area to look at if module loading starts misbehaving.
134
+ `beta.103` also moves synchronous Effect runs off `setImmediate`/`setTimeout` and onto the microtask queue, which Convex's query and mutation isolate permits. Confect no longer suppresses cooperative fiber yielding for the synchronous work it performs while your modules load—registration and schema-to-validator compilation—and relies on that scheduling instead. Neither the "Can't use `setTimeout` in queries and mutations" crash nor any other consumer-visible behavior changes, but this is the area to look at if module loading starts misbehaving.
62
135
 
63
136
  `beta.104` renames Effect's schema error constructors to match their `Data` counterparts, which affects any error schema you declare for a Confect function:
64
137
 
@@ -80,7 +153,7 @@
80
153
  ) {}
81
154
  ```
82
155
 
83
- `Schema.ErrorClass` is likewise now `Schema.Error`; the schema for JavaScript `Error` instances that previously went by `Schema.Error` is now `Schema.ErrorInstance`, and `Schema.ErrorReviver` is now `Schema.ErrorInstanceReviver`. Confect's own error types — `DocumentDecodeError`, `BlobNotFoundError`, and the rest — are unchanged in name, shape, and message.
156
+ `Schema.ErrorClass` is likewise now `Schema.Error`; the schema for JavaScript `Error` instances that previously went by `Schema.Error` is now `Schema.ErrorInstance`, and `Schema.ErrorReviver` is now `Schema.ErrorInstanceReviver`. Confect's own error types—`DocumentDecodeError`, `BlobNotFoundError`, and the rest—are unchanged in name, shape, and message.
84
157
 
85
158
  `beta.105` restructures how schema validation failures are reported, but not on the path Confect puts you on: decode and encode failures still surface as `Schema.SchemaError` with a formatted `message`, so error text from `@confect/js`, `@confect/react`, and document decoding is unchanged.
86
159
 
@@ -108,13 +181,13 @@
108
181
 
109
182
  - Raise the required `effect` peer version to `^4.0.0-beta.107` (from `^4.0.0-beta.106`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
110
183
 
111
- `beta.107` is a patch-only Effect release, so no Confect API changes and no call-site edits are needed — upgrade `effect` alongside `@confect/*` and everything you have written keeps compiling. Your table, argument, and returns schemas still produce the same Convex validators.
184
+ `beta.107` is a patch-only Effect release, so no Confect API changes and no call-site edits are needed—upgrade `effect` alongside `@confect/*` and everything you have written keeps compiling. Your table, argument, and returns schemas still produce the same Convex validators.
112
185
 
113
- Two Effect fixes are worth knowing about if they touch your code. HTTP actions written with `HttpRouter` now collect uploaded file contents far faster on large multipart bodies, and a file part whose stream is cut short — because a parser limit was exceeded or the request body ended early — now fails instead of hanging. Separately, `Duration` values that are equal now hash equally, so a `Duration` used as a `HashMap` key or a `HashSet` member is found regardless of which constructor built it.
186
+ Two Effect fixes are worth knowing about if they touch your code. HTTP actions written with `HttpRouter` now collect uploaded file contents far faster on large multipart bodies, and a file part whose stream is cut short—because a parser limit was exceeded or the request body ended early—now fails instead of hanging. Separately, `Duration` values that are equal now hash equally, so a `Duration` used as a `HashMap` key or a `HashSet` member is found regardless of which constructor built it.
114
187
 
115
188
  - Raise the required `effect` peer version to `^4.0.0-beta.98` (from `^4.0.0-beta.97`).
116
189
 
117
- `effect`'s `SchemaError` is now exposed as its own public module (`effect/SchemaError`), which changes the import path TypeScript picks when Confect emits `.d.ts` declarations that reference `Schema.SchemaError` (for example in generated `services.d.ts`). Existing `Schema.SchemaError` / `Schema.isSchemaError` usage is unaffected — this is purely a declaration-emit detail that consumers relying on generated types may notice.
190
+ `effect`'s `SchemaError` is now exposed as its own public module (`effect/SchemaError`), which changes the import path TypeScript picks when Confect emits `.d.ts` declarations that reference `Schema.SchemaError` (for example in generated `services.d.ts`). Existing `Schema.SchemaError`/`Schema.isSchemaError` usage is unaffected—this is purely a declaration-emit detail that consumers relying on generated types may notice.
118
191
 
119
192
  - Raise the required `effect` peer version to `^4.0.0-beta.99` (from `^4.0.0-beta.98`).
120
193
 
@@ -138,7 +211,7 @@
138
211
 
139
212
  Also worth knowing if you serve an `HttpApi`: a query parameter declared as an array now decodes correctly when a request supplies exactly one value for it.
140
213
 
141
- One internal change rides along. Queries and mutations that run long enough to trigger a cooperative fiber yield now take that yield from Effect's own scheduler, which `rc.108` made usable inside Convex's isolate for the first time. The underlying microtask primitive is identical, so behavior should not change — but it is the thing to look at if a long-running query or mutation regresses on this release.
214
+ One internal change rides along. Queries and mutations that run long enough to trigger a cooperative fiber yield now take that yield from Effect's own scheduler, which `rc.108` made usable inside Convex's isolate for the first time. The underlying microtask primitive is identical, so behavior should not change—but it is the thing to look at if a long-running query or mutation regresses on this release.
142
215
 
143
216
  - Raise the required `effect` peer version to `^4.0.0-rc.109` (from `^4.0.0-rc.108`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
144
217
 
@@ -149,10 +222,10 @@
149
222
  No Confect API changed, and no call-site edits are needed. `rc.110` is a patch release of Effect with nothing removed or renamed, so upgrading is a matter of installing it alongside `@confect/*`.
150
223
 
151
224
  - 3f0255c: Build and test against `convex` 1.44.0. The published `convex` peer ranges are unchanged, so no consumer action is required.
152
- - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.2–9.2.4 — see those versions' changelog entries.
153
- - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.5 — see that version's changelog entries.
154
- - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.3.0 — see that version's changelog entries.
155
- - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.4.0 — see that version's changelog entries.
225
+ - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.2–9.2.4—see those versions' changelog entries.
226
+ - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.5—see that version's changelog entries.
227
+ - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.3.0—see that version's changelog entries.
228
+ - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.4.0—see that version's changelog entries.
156
229
 
157
230
  The `@effect/platform` and `@effect/cli` peer and dependency floors that 9.4.0 raises do not apply here: this line runs on Effect v4, where those packages are not dependencies at all.
158
231
 
@@ -188,7 +261,7 @@
188
261
 
189
262
  Also worth knowing if you serve an `HttpApi`: a query parameter declared as an array now decodes correctly when a request supplies exactly one value for it.
190
263
 
191
- One internal change rides along. Queries and mutations that run long enough to trigger a cooperative fiber yield now take that yield from Effect's own scheduler, which `rc.108` made usable inside Convex's isolate for the first time. The underlying microtask primitive is identical, so behavior should not change — but it is the thing to look at if a long-running query or mutation regresses on this release.
264
+ One internal change rides along. Queries and mutations that run long enough to trigger a cooperative fiber yield now take that yield from Effect's own scheduler, which `rc.108` made usable inside Convex's isolate for the first time. The underlying microtask primitive is identical, so behavior should not change—but it is the thing to look at if a long-running query or mutation regresses on this release.
192
265
 
193
266
  - a4054ab: The published type declarations are now emitted by TypeScript 7 rather than TypeScript 6. No API changed, but the declaration text differs in places, so an inferred type printed in your editor or in a type error may read slightly differently than before.
194
267
 
@@ -198,9 +271,9 @@
198
271
 
199
272
  - 5a73763: Raise the required `effect` peer version to `^4.0.0-beta.107` (from `^4.0.0-beta.106`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
200
273
 
201
- `beta.107` is a patch-only Effect release, so no Confect API changes and no call-site edits are needed — upgrade `effect` alongside `@confect/*` and everything you have written keeps compiling. Your table, argument, and returns schemas still produce the same Convex validators.
274
+ `beta.107` is a patch-only Effect release, so no Confect API changes and no call-site edits are needed—upgrade `effect` alongside `@confect/*` and everything you have written keeps compiling. Your table, argument, and returns schemas still produce the same Convex validators.
202
275
 
203
- Two Effect fixes are worth knowing about if they touch your code. HTTP actions written with `HttpRouter` now collect uploaded file contents far faster on large multipart bodies, and a file part whose stream is cut short — because a parser limit was exceeded or the request body ended early — now fails instead of hanging. Separately, `Duration` values that are equal now hash equally, so a `Duration` used as a `HashMap` key or a `HashSet` member is found regardless of which constructor built it.
276
+ Two Effect fixes are worth knowing about if they touch your code. HTTP actions written with `HttpRouter` now collect uploaded file contents far faster on large multipart bodies, and a file part whose stream is cut short—because a parser limit was exceeded or the request body ended early—now fails instead of hanging. Separately, `Duration` values that are equal now hash equally, so a `Duration` used as a `HashMap` key or a `HashSet` member is found regardless of which constructor built it.
204
277
 
205
278
  ## 10.0.0-next.12
206
279
 
@@ -234,9 +307,9 @@
234
307
 
235
308
  - f782cdd: Raise the required `effect` peer version to `^4.0.0-beta.105` (from `^4.0.0-beta.102`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
236
309
 
237
- `beta.103` separates wall-clock time from monotonic elapsed time: `Clock.Clock` now also requires `monotonicTimeNanos` and `monotonicTimeNanosUnsafe`, so a custom `Clock` provided to a Confect function has to supply both. Effects that measure elapsed time — `Effect.timed`, duration metrics, `Sink.withDuration` — read the monotonic accessors instead of the wall clock, and continue to report a zero duration inside queries and mutations, where Confect pins the unsafe accessors to constants to keep Convex's query cache from evicting on every logged span.
310
+ `beta.103` separates wall-clock time from monotonic elapsed time: `Clock.Clock` now also requires `monotonicTimeNanos` and `monotonicTimeNanosUnsafe`, so a custom `Clock` provided to a Confect function has to supply both. Effects that measure elapsed time—`Effect.timed`, duration metrics, `Sink.withDuration`—read the monotonic accessors instead of the wall clock, and continue to report a zero duration inside queries and mutations, where Confect pins the unsafe accessors to constants to keep Convex's query cache from evicting on every logged span.
238
311
 
239
- `beta.103` also moves synchronous Effect runs off `setImmediate`/`setTimeout` and onto the microtask queue, which Convex's query and mutation isolate permits. Confect no longer suppresses cooperative fiber yielding for the synchronous work it performs while your modules load — registration and schema-to-validator compilation — and relies on that scheduling instead. Neither the "Can't use `setTimeout` in queries and mutations" crash nor any other consumer-visible behavior changes, but this is the area to look at if module loading starts misbehaving.
312
+ `beta.103` also moves synchronous Effect runs off `setImmediate`/`setTimeout` and onto the microtask queue, which Convex's query and mutation isolate permits. Confect no longer suppresses cooperative fiber yielding for the synchronous work it performs while your modules load—registration and schema-to-validator compilation—and relies on that scheduling instead. Neither the "Can't use `setTimeout` in queries and mutations" crash nor any other consumer-visible behavior changes, but this is the area to look at if module loading starts misbehaving.
240
313
 
241
314
  `beta.104` renames Effect's schema error constructors to match their `Data` counterparts, which affects any error schema you declare for a Confect function:
242
315
 
@@ -258,11 +331,11 @@
258
331
  ) {}
259
332
  ```
260
333
 
261
- `Schema.ErrorClass` is likewise now `Schema.Error`; the schema for JavaScript `Error` instances that previously went by `Schema.Error` is now `Schema.ErrorInstance`, and `Schema.ErrorReviver` is now `Schema.ErrorInstanceReviver`. Confect's own error types — `DocumentDecodeError`, `BlobNotFoundError`, and the rest — are unchanged in name, shape, and message.
334
+ `Schema.ErrorClass` is likewise now `Schema.Error`; the schema for JavaScript `Error` instances that previously went by `Schema.Error` is now `Schema.ErrorInstance`, and `Schema.ErrorReviver` is now `Schema.ErrorInstanceReviver`. Confect's own error types—`DocumentDecodeError`, `BlobNotFoundError`, and the rest—are unchanged in name, shape, and message.
262
335
 
263
336
  `beta.105` restructures how schema validation failures are reported, but not on the path Confect puts you on: decode and encode failures still surface as `Schema.SchemaError` with a formatted `message`, so error text from `@confect/js`, `@confect/react`, and document decoding is unchanged.
264
337
 
265
- - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.4.0 — see that version's changelog entries.
338
+ - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.4.0—see that version's changelog entries.
266
339
 
267
340
  The `@effect/platform` and `@effect/cli` peer and dependency floors that 9.4.0 raises do not apply here: this line runs on Effect v4, where those packages are not dependencies at all.
268
341
 
@@ -270,14 +343,14 @@
270
343
 
271
344
  ### Patch Changes
272
345
 
273
- - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.3.0 — see that version's changelog entries.
346
+ - Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.3.0—see that version's changelog entries.
274
347
 
275
348
  ## 10.0.0-next.9
276
349
 
277
350
  ### Patch Changes
278
351
 
279
352
  - 0dcc0fb: Raise the required `effect` peer version to `^4.0.0-beta.102` (from `^4.0.0-beta.101`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
280
- - 25e8d19: Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.5 — see that version's changelog entries.
353
+ - 25e8d19: Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.5—see that version's changelog entries.
281
354
 
282
355
  ## 10.0.0-next.8
283
356
 
@@ -311,7 +384,7 @@
311
384
 
312
385
  This is a peer-range-only change with no consumer-visible API consequences. The `beta.99` release only touches `Graph`, CLI (`Command`/`CliConfig`/wizard mode), `Tool` cloning, Redis script eval, and multipart parser internals that Confect doesn't use.
313
386
 
314
- - 2aa7541: Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.2–9.2.4 — see those versions' changelog entries.
387
+ - 2aa7541: Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.2–9.2.4—see those versions' changelog entries.
315
388
 
316
389
  ## 10.0.0-next.1
317
390
 
@@ -319,7 +392,7 @@
319
392
 
320
393
  - 4d98ea8: Raise the required `effect` peer version to `^4.0.0-beta.98` (from `^4.0.0-beta.97`).
321
394
 
322
- `effect`'s `SchemaError` is now exposed as its own public module (`effect/SchemaError`), which changes the import path TypeScript picks when Confect emits `.d.ts` declarations that reference `Schema.SchemaError` (for example in generated `services.d.ts`). Existing `Schema.SchemaError` / `Schema.isSchemaError` usage is unaffected — this is purely a declaration-emit detail that consumers relying on generated types may notice.
395
+ `effect`'s `SchemaError` is now exposed as its own public module (`effect/SchemaError`), which changes the import path TypeScript picks when Confect emits `.d.ts` declarations that reference `Schema.SchemaError` (for example in generated `services.d.ts`). Existing `Schema.SchemaError`/`Schema.isSchemaError` usage is unaffected—this is purely a declaration-emit detail that consumers relying on generated types may notice.
323
396
 
324
397
  - Updated dependencies [4d98ea8]
325
398
  - @confect/core@10.0.0-next.1
@@ -332,14 +405,14 @@
332
405
 
333
406
  Breaking changes for users:
334
407
  - **Schemas** follow Effect v4's Schema API: `Schema.Union([a, b])` (array form), `Schema.Literals([...])` for literal unions, `Schema.optionalKey` in place of `optionalWith({ exact: true })`, `Schema.TaggedErrorClass` in place of `Schema.TaggedError`, and checks like `Schema.String.check(Schema.isMaxLength(...))` in place of piped filters.
335
- - **Option-returning functions** must use a codec with a serializable encoded form, such as `Schema.OptionFromNullOr(...)` — v4's `Schema.Option` encodes to an `Option` instance, which is not a Convex value.
336
- - **Table schemas** may now be transformations (`Schema.decodeTo` chains, `Schema.encodeKeys`), branded structs, suspended schemas, or unions of these — Convex's system fields are carried through the whole encoding chain. Schemas that do not resolve to an object shape at every step (such as `Schema.Class`) are rejected with a descriptive error when the table is defined.
408
+ - **Option-returning functions** must use a codec with a serializable encoded form, such as `Schema.OptionFromNullOr(...)`—v4's `Schema.Option` encodes to an `Option` instance, which is not a Convex value.
409
+ - **Table schemas** may now be transformations (`Schema.decodeTo` chains, `Schema.encodeKeys`), branded structs, suspended schemas, or unions of these—Convex's system fields are carried through the whole encoding chain. Schemas that do not resolve to an object shape at every step (such as `Schema.Class`) are rejected with a descriptive error when the table is defined.
337
410
  - **Clients**: decode failures surface as `SchemaError` rather than `ParseError` in `@confect/js` and `@confect/react`, and `@confect/react`'s `useMutation`/`useAction` handles with an `error` schema now resolve to `Result` (v4's replacement for `Either`).
338
- - **HTTP** is now mounted through the renamed `HttpRouter` module (formerly `HttpApi`). `HttpRouter.make(routes)` takes a single route-registering `Layer` composed from Effect's own `effect/unstable/http` and `effect/unstable/httpapi` modules — `HttpApiBuilder.layer(api)` (with group handler layers supplied via `Layer.provide`; a missing group is a compile-time error), `HttpApiScalar.layer` for docs, `HttpRouter.add` for plain routes, and `HttpRouter.middleware(fn, { global: true })` for middleware, merged with `Layer.mergeAll`. The per-path-prefix record and its `api`/`apiLive`/`middleware`/`scalar` options are gone; Confect registers one catch-all Convex HTTP action at `/`, and plain Convex routes added to the returned router still take precedence. Handlers, middleware, and route-layer construction all run with Confect's Convex-aware `ConfigProvider` in context.
411
+ - **HTTP** is now mounted through the renamed `HttpRouter` module (formerly `HttpApi`). `HttpRouter.make(routes)` takes a single route-registering `Layer` composed from Effect's own `effect/unstable/http` and `effect/unstable/httpapi` modules—`HttpApiBuilder.layer(api)` (with group handler layers supplied via `Layer.provide`; a missing group is a compile-time error), `HttpApiScalar.layer` for docs, `HttpRouter.add` for plain routes, and `HttpRouter.middleware(fn, { global: true })` for middleware, merged with `Layer.mergeAll`. The per-path-prefix record and its `api`/`apiLive`/`middleware`/`scalar` options are gone; Confect registers one catch-all Convex HTTP action at `/`, and plain Convex routes added to the returned router still take precedence. Handlers, middleware, and route-layer construction all run with Confect's Convex-aware `ConfigProvider` in context.
339
412
  - **Node actions** use `effect/unstable/process` (`ChildProcessSpawner`) and `@effect/platform-node`'s `NodeServices` in place of `@effect/platform` `Command`/`NodeContext`.
340
413
  - **Configuration**: Confect's Convex-aware `ConfigProvider` treats empty-string environment variables as missing values (matching Effect v4's built-in providers), so `Config.withDefault` and `Config.option` recover from them.
341
414
  - **CLI**: a malformed `convex.json` now fails codegen with a descriptive error instead of being silently ignored.
342
- - Confect queries no longer stub the global `Date.now`. Queries run with a `Clock` whose unsafe accessors return constants, so Effect-internal reads (log timestamps, spans) never evict a query from Convex's cache; explicit time reads — `Clock.currentTimeMillis`/`currentTimeNanos` or a raw `Date.now()` call — opt the query out and evict as they honestly should.
415
+ - Confect queries no longer stub the global `Date.now`. Queries run with a `Clock` whose unsafe accessors return constants, so Effect-internal reads (log timestamps, spans) never evict a query from Convex's cache; explicit time reads—`Clock.currentTimeMillis`/`currentTimeNanos` or a raw `Date.now()` call—opt the query out and evict as they honestly should.
343
416
 
344
417
  ### Patch Changes
345
418
 
@@ -362,7 +435,7 @@
362
435
 
363
436
  - 16b5ad6: Add first-class paginated queries: declare one with `FunctionSpec.publicPaginatedQuery` (or `internalPaginatedQuery`) and read it with the new `usePaginatedQuery` hook from `@confect/react`.
364
437
 
365
- Pass an `item` schema — the type of one element in a page — in place of `returns`, plus an optional `args` struct for your own arguments. The handler receives `paginationOpts` alongside them and forwards it to `paginate`.
438
+ Pass an `item` schema—the type of one element in a page—in place of `returns`, plus an optional `args` struct for your own arguments. The handler receives `paginationOpts` alongside them and forwards it to `paginate`.
366
439
 
367
440
  ```ts
368
441
  // confect/notes.spec.ts
@@ -487,7 +560,7 @@
487
560
 
488
561
  - 445ea9b: Loosen and align dependency ranges across all packages:
489
562
  - The `convex` peer dependency is now `^1.32.0` in every package (previously pinned exactly to `1.39.1`, or `^1.30.0` in `@confect/react`). The range is validated against convex 1.32.0 through 1.40.0.
490
- - `@confect/server`'s `@effect/platform-node` peer dependency is now optional — it is only needed when using the `@confect/server/node` entrypoint.
563
+ - `@confect/server`'s `@effect/platform-node` peer dependency is now optional—it is only needed when using the `@confect/server/node` entrypoint.
491
564
  - `@confect/cli` now uses caret ranges for its `@effect/platform` and `@effect/platform-node` dependencies so they can deduplicate with the versions resolved for `@confect/server`, and no longer declares an unused direct dependency on `@effect/platform-node-shared`.
492
565
  - `@confect/test` now accepts any `convex-test` release in `>=0.0.50 <0.1.0` instead of exactly 0.0.50.
493
566
 
@@ -506,8 +579,8 @@
506
579
 
507
580
  Your API is now authored as colocated `*.spec.ts`/`*.impl.ts` pairs, one pair per group, and **the file's path within `confect/` is the group's name** (its stem for top-level groups, the dot-joined directory path for nested groups). `GroupSpec.make()` and `GroupSpec.makeNode()` no longer take a name argument.
508
581
  - Each `*.spec.ts` `export default`s its `GroupSpec` (named co-exports like error classes are still allowed).
509
- - Each `*.impl.ts` default-imports its sibling spec, passes it to `FunctionImpl.make` / `GroupImpl.make`, and ends the layer pipeline with `GroupImpl.finalize`—a compile-time completeness check that only typechecks once every function the spec declares has a `FunctionImpl` provided.
510
- - The root `confect/spec.ts`, `confect/impl.ts`, `confect/nodeSpec.ts`, and `confect/nodeImpl.ts` files are gone, along with `Impl.make` and `Impl.finalize`. `confect codegen` deletes any of these (and the stale aggregate `_generated/registeredFunctions.ts` / `_generated/nodeRegisteredFunctions.ts`) on upgrade.
582
+ - Each `*.impl.ts` default-imports its sibling spec, passes it to `FunctionImpl.make`/`GroupImpl.make`, and ends the layer pipeline with `GroupImpl.finalize`—a compile-time completeness check that only typechecks once every function the spec declares has a `FunctionImpl` provided.
583
+ - The root `confect/spec.ts`, `confect/impl.ts`, `confect/nodeSpec.ts`, and `confect/nodeImpl.ts` files are gone, along with `Impl.make` and `Impl.finalize`. `confect codegen` deletes any of these (and the stale aggregate `_generated/registeredFunctions.ts`/`_generated/nodeRegisteredFunctions.ts`) on upgrade.
511
584
 
512
585
  ### Tables are the source of truth, named by their filename
513
586
 
@@ -538,7 +611,7 @@
538
611
 
539
612
  ### Specs and impls: lazy schemas, and impls take the `DatabaseSchema`
540
613
 
541
- `FunctionSpec.*` constructors now take `args`, `returns`, and the optional `error` as `() => Schema` thunks, so importing a spec builds no schemas until a function is invoked. `FunctionImpl.make` and `GroupImpl.make` take the runtime `DatabaseSchema` (the default export of `_generated/schema`) as their first argument instead of the whole `Api`—which keeps the project-wide spec graph out of a function's cold-start module graph. The `Api` module (`Api.make`, the `Api` type) and the generated `_generated/api.ts` / `_generated/nodeApi.ts` files are removed.
614
+ `FunctionSpec.*` constructors now take `args`, `returns`, and the optional `error` as `() => Schema` thunks, so importing a spec builds no schemas until a function is invoked. `FunctionImpl.make` and `GroupImpl.make` take the runtime `DatabaseSchema` (the default export of `_generated/schema`) as their first argument instead of the whole `Api`—which keeps the project-wide spec graph out of a function's cold-start module graph. The `Api` module (`Api.make`, the `Api` type) and the generated `_generated/api.ts`/`_generated/nodeApi.ts` files are removed.
542
615
 
543
616
  **Before:**
544
617
 
@@ -586,7 +659,7 @@
586
659
 
587
660
  A group's runtime is now declared solely by its spec—`GroupSpec.makeNode()` for a Node action group, `GroupSpec.make()` otherwise—mirroring vanilla Convex's per-file `"use node"` directive. The separate `node` namespace is gone: Node specs/impls are ordinary colocated pairs that can live anywhere in `confect/`, and codegen emits the `"use node"` directive based on the spec.
588
661
  - A Node group at `confect/email.spec.ts` is now reached at `refs.public.email.send` instead of `refs.public.node.email.send`.
589
- - `@confect/core` removes `Spec.makeNode`, `Spec.merge`, and `Spec.isConvexSpec` / `Spec.isNodeSpec`; `Spec.make()` is a single mixed-runtime container and `Refs.make(spec)` takes one argument. `GroupSpec.makeNode()`, `FunctionSpec.publicNodeAction()` / `internalNodeAction()` are unchanged.
662
+ - `@confect/core` removes `Spec.makeNode`, `Spec.merge`, and `Spec.isConvexSpec`/`Spec.isNodeSpec`; `Spec.make()` is a single mixed-runtime container and `Refs.make(spec)` takes one argument. `GroupSpec.makeNode()`, `FunctionSpec.publicNodeAction()`/`internalNodeAction()` are unchanged.
590
663
 
591
664
  ### Less work at cold start
592
665
 
@@ -603,7 +676,7 @@
603
676
  ### Migration
604
677
  1. **Tables.** Delete `confect/schema.ts`. Rename each table file to a valid JS identifier (e.g. `confect/tables/notes.ts`); the basename becomes the table name. Drop the name argument from `Table.make`, wrap the field struct in `() =>`, and replace `GenericId.GenericId("x")` with `Id("x")` from `_generated/id`. If you read `table.name` off a bound table, rename it to `table.tableName`.
605
678
  2. **Specs.** Split each group into a colocated `*.spec.ts` that `export default`s `GroupSpec.make()` (no name). Wrap every `args`/`returns`/`error` in `() =>`. Import a table's `Doc`/`Fields` from its wrapper, `import notes from "./_generated/tables/notes"`.
606
- 3. **Impls.** In each `*.impl.ts`, default-import the sibling spec, import `databaseSchema` from `_generated/schema`, pass it to `FunctionImpl.make` / `GroupImpl.make` in place of `api`, end the pipeline with `GroupImpl.finalize`, and `export default` it. Delete the root `confect/spec.ts`, `impl.ts`, `nodeSpec.ts`, and `nodeImpl.ts` (codegen will also remove them).
679
+ 3. **Impls.** In each `*.impl.ts`, default-import the sibling spec, import `databaseSchema` from `_generated/schema`, pass it to `FunctionImpl.make`/`GroupImpl.make` in place of `api`, end the pipeline with `GroupImpl.finalize`, and `export default` it. Delete the root `confect/spec.ts`, `impl.ts`, `nodeSpec.ts`, and `nodeImpl.ts` (codegen will also remove them).
607
680
  4. **Node groups.** Move any `confect/node/<path>` files anywhere you like under `confect/`; the `node/` directory no longer has special meaning. Drop the `node` segment from call sites (`refs.public.node.<group>` → `refs.public.<group>`) and replace `Refs.make(spec, nodeSpec)` with `Refs.make(spec)`.
608
681
  5. **Tests.** If you use `@confect/test`, import `confectSchema` from `_generated/schema`, import the generated `convexSchema` from `_generated/convexSchema`, and pass `convexSchema` as the new second argument to `TestConfect.layer`.
609
682
  6. **Optional.** Adopt submodule Effect imports (`import * as Schema from "effect/Schema"`) in your own `confect/` files for the full cold-start savings.
@@ -647,11 +720,11 @@
647
720
 
648
721
  ### Why
649
722
 
650
- A barrel import of a namespace re-export defeats esbuild's tree-shaking: accessing `Schema.X` from `import { Schema } from "effect"` retains the _entire_ `Schema` namespace, because the bundler can't prune property access on the barrel's `export * as Schema`. So every Convex function's cold-start bundle was pulling all of `effect/Schema` and `effect/Stream` — and, transitively through Schema's `Arbitrary`, `fast-check` — whether the function used them or not.
723
+ A barrel import of a namespace re-export defeats esbuild's tree-shaking: accessing `Schema.X` from `import { Schema } from "effect"` retains the _entire_ `Schema` namespace, because the bundler can't prune property access on the barrel's `export * as Schema`. So every Convex function's cold-start bundle was pulling all of `effect/Schema` and `effect/Stream`—and, transitively through Schema's `Arbitrary`, `fast-check`—whether the function used them or not.
651
724
 
652
725
  Importing from the submodule path tree-shakes normally. On a minimal function this cut the bundle esbuild produces by ~54% (the `effect/Schema` module alone by ~75%) and its cold-start module-evaluation time by ~35%, with `fast-check` dropped entirely. This is also the import style Effect v4 recommends, so it's forward-compatible. A `no-restricted-imports` ESLint rule now enforces it across the codebase (type-only imports and `@effect/vitest` are exempt).
653
726
 
654
- No API changes — your existing code keeps working.
727
+ No API changes—your existing code keeps working.
655
728
 
656
729
  ### Getting the full win in your own code
657
730
 
@@ -5,20 +5,20 @@ type TypeId = typeof TypeId;
5
5
  * A `PaginatedQueryResult` represents the result of a Confect paginated query.
6
6
  * The non-`Failure` variants mirror the statuses of `usePaginatedQuery` from
7
7
  * `convex/react` and all carry `results` and `isLoading`, so the common UI
8
- * shape — render the list, show a spinner while loading — needs only an
8
+ * shape—render the list, show a spinner while loading—needs only an
9
9
  * {@link isFailure} early-out and plain field access.
10
10
  *
11
11
  * Every variant carries `results`, including `Failure`: when a later page
12
12
  * fails, the pages already loaded are still worth rendering alongside the
13
- * error, so they are not discarded. `Failure` additionally carries the
14
- * query's decoded typed error.
13
+ * error, so they are not discarded. `Failure` additionally carries the query's
14
+ * decoded typed error.
15
15
  *
16
- * `loadMore` appears only on `CanLoadMore`, the one state it can make
17
- * progress from. The underlying Convex hook exposes it on every status, but
18
- * calling it while a page is in flight, once the list is exhausted, or after
19
- * a failure is an intentional no-op there; narrowing to `CanLoadMore` — via
20
- * {@link isCanLoadMore} or {@link match} — makes that statically apparent
21
- * instead of silently dropping the call.
16
+ * `loadMore` appears only on `CanLoadMore`, the one state it can make progress
17
+ * from. The underlying Convex hook exposes it on every status, but calling it
18
+ * while a page is in flight, once the list is exhausted, or after a failure is
19
+ * an intentional no-op there; narrowing to `CanLoadMore`—via
20
+ * {@link isCanLoadMore} or {@link match}—makes that statically apparent instead
21
+ * of silently dropping the call.
22
22
  *
23
23
  * When the query declares no `error` schema (`E` is `never`), the `Failure`
24
24
  * variant is excluded from the type entirely, so `isLoading` is accessible
@@ -29,9 +29,9 @@ type TypeId = typeof TypeId;
29
29
  */
30
30
  export type PaginatedQueryResult<Item, E = never> = [E] extends [never] ? LoadingFirstPage<Item, E> | LoadingMore<Item, E> | CanLoadMore<Item, E> | Exhausted<Item, E> : LoadingFirstPage<Item, E> | LoadingMore<Item, E> | CanLoadMore<Item, E> | Exhausted<Item, E> | Failure<Item, E>;
31
31
  /**
32
- * Every variant regardless of `E` — the parameter type for guards and
33
- * {@link match}, since `PaginatedQueryResult` itself excludes `Failure` when
34
- * `E` is `never`.
32
+ * Every variant regardless of `E`—the parameter type for guards and
33
+ * {@link match}, since `PaginatedQueryResult` itself excludes `Failure` when `E`
34
+ * is `never`.
35
35
  */
36
36
  export type Variants<Item, E = never> = LoadingFirstPage<Item, E> | LoadingMore<Item, E> | CanLoadMore<Item, E> | Exhausted<Item, E> | Failure<Item, E>;
37
37
  export declare namespace PaginatedQueryResult {
@@ -72,7 +72,9 @@ export interface Exhausted<Item, E = never> extends PaginatedQueryResult.Proto<I
72
72
  export interface Failure<Item, E = never> extends PaginatedQueryResult.Proto<Item, E> {
73
73
  readonly _tag: "Failure";
74
74
  readonly error: E;
75
- /** The pages loaded before the failure. */
75
+ /**
76
+ * The pages loaded before the failure.
77
+ */
76
78
  readonly results: ReadonlyArray<Item>;
77
79
  }
78
80
  export declare const isPaginatedQueryResult: (u: unknown) => u is Variants<unknown, unknown>;
@@ -109,9 +111,9 @@ type MatchOptions<Item, E, V, W, X, Y, Z> = {
109
111
  });
110
112
  type MatchReturns<E, V, W, X, Y, Z> = [E] extends [never] ? V | W | X | Y : V | W | X | Y | Z;
111
113
  /**
112
- * Matches a {@link PaginatedQueryResult} to the appropriate handler based on
113
- * its tag. If the provided result cannot fail (i.e. `E` is `never`),
114
- * `onFailure` is not required.
114
+ * Matches a {@link PaginatedQueryResult} to the appropriate handler based on its
115
+ * tag. If the provided result cannot fail (i.e. `E` is `never`), `onFailure` is
116
+ * not required.
115
117
  */
116
118
  export declare const match: {
117
119
  <Item, E, V, W, X, Y, Z = never>(options: MatchOptions<Item, E, V, W, X, Y, Z>): (self: Variants<Item, E>) => MatchReturns<E, V, W, X, Y, Z>;
@@ -1 +1 @@
1
- {"version":3,"file":"PaginatedQueryResult.d.ts","sourceRoot":"","sources":["../src/PaginatedQueryResult.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAG5C,QAAA,MAAM,MAAM,yCAAyC,CAAC;AACtD,KAAK,MAAM,GAAG,OAAO,MAAM,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,oBAAoB,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAE/D,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,GACzB,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,GACpB,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,GACpB,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,GAElB,gBAAgB,CAAC,IAAI,EAAE,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,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACrD,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GACb,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEtB;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE;IAClB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,EAC7B,OAAO,EAAE,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC5C,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,EAC7B,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EACvB,OAAO,EAAE,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC5C,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CA8BnC,CAAC"}
@@ -77,9 +77,9 @@ const isExhausted = (result) => result._tag === "Exhausted";
77
77
  const isFailure = (result) => result._tag === "Failure";
78
78
  const isLoading = (result) => result._tag === "LoadingFirstPage" || result._tag === "LoadingMore";
79
79
  /**
80
- * Matches a {@link PaginatedQueryResult} to the appropriate handler based on
81
- * its tag. If the provided result cannot fail (i.e. `E` is `never`),
82
- * `onFailure` is not required.
80
+ * Matches a {@link PaginatedQueryResult} to the appropriate handler based on its
81
+ * tag. If the provided result cannot fail (i.e. `E` is `never`), `onFailure` is
82
+ * not required.
83
83
  */
84
84
  const match = Function.dual(2, (self, options) => Match.value(self).pipe(Match.tag("LoadingFirstPage", (loadingFirstPage_) => options.onLoadingFirstPage(loadingFirstPage_.skipped)), Match.tag("LoadingMore", (loadingMore_) => options.onLoadingMore(loadingMore_.results)), Match.tag("CanLoadMore", (canLoadMore_) => options.onCanLoadMore(canLoadMore_.results, canLoadMore_.loadMore)), Match.tag("Exhausted", (exhausted_) => options.onExhausted(exhausted_.results)), Match.tag("Failure", (failure_) => {
85
85
  if (Predicate.hasProperty(options, "onFailure")) return options.onFailure(failure_.error, failure_.results);
@@ -1 +1 @@
1
- {"version":3,"file":"PaginatedQueryResult.js","names":[],"sources":["../src/PaginatedQueryResult.ts"],"sourcesContent":["import * as Equal from \"effect/Equal\";\nimport * as Function from \"effect/Function\";\nimport * as Hash from \"effect/Hash\";\nimport * as Match from \"effect/Match\";\nimport * as Pipeable from \"effect/Pipeable\";\nimport * as Predicate from \"effect/Predicate\";\n\nconst TypeId = \"~@confect/react/PaginatedQueryResult\";\ntype TypeId = typeof TypeId;\n\n/**\n * A `PaginatedQueryResult` represents the result of a Confect paginated query.\n * The non-`Failure` variants mirror the statuses of `usePaginatedQuery` from\n * `convex/react` and all carry `results` and `isLoading`, so the common UI\n * shape — render the list, show a spinner while loading — needs only an\n * {@link isFailure} early-out and plain field access.\n *\n * Every variant carries `results`, including `Failure`: when a later page\n * fails, the pages already loaded are still worth rendering alongside the\n * error, so they are not discarded. `Failure` additionally carries the\n * query's decoded typed error.\n *\n * `loadMore` appears only on `CanLoadMore`, the one state it can make\n * progress from. The underlying Convex hook exposes it on every status, but\n * calling it while a page is in flight, once the list is exhausted, or after\n * a failure is an intentional no-op there; narrowing to `CanLoadMore` — via\n * {@link isCanLoadMore} or {@link match} — makes that statically apparent\n * instead of silently dropping the call.\n *\n * When the query declares no `error` schema (`E` is `never`), the `Failure`\n * variant is excluded from the type entirely, so `isLoading` is accessible\n * without any narrowing.\n *\n * @typeParam Item - The type of a decoded page item.\n * @typeParam E - The type of the decoded typed error in the `Failure` variant.\n */\nexport type PaginatedQueryResult<Item, E = never> = [E] extends [never]\n ?\n | LoadingFirstPage<Item, E>\n | LoadingMore<Item, E>\n | CanLoadMore<Item, E>\n | Exhausted<Item, E>\n :\n | LoadingFirstPage<Item, E>\n | LoadingMore<Item, E>\n | CanLoadMore<Item, E>\n | Exhausted<Item, E>\n | Failure<Item, E>;\n\n/**\n * Every variant regardless of `E` — the parameter type for guards and\n * {@link match}, since `PaginatedQueryResult` itself excludes `Failure` when\n * `E` is `never`.\n */\nexport type Variants<Item, E = never> =\n | LoadingFirstPage<Item, E>\n | LoadingMore<Item, E>\n | CanLoadMore<Item, E>\n | Exhausted<Item, E>\n | Failure<Item, E>;\n\nexport declare namespace PaginatedQueryResult {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n export interface Proto<out Item, out E> extends Pipeable.Pipeable {\n readonly [TypeId]: TypeId;\n readonly \"~Item\": Item;\n readonly \"~E\": E;\n }\n\n export type Item<R> = R extends { readonly \"~Item\": infer Item_ }\n ? Item_\n : never;\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n export type Failure<R> = R extends { readonly \"~E\": infer E } ? E : never;\n}\n\nexport interface LoadingFirstPage<\n Item,\n E = never,\n> extends PaginatedQueryResult.Proto<Item, E> {\n readonly _tag: \"LoadingFirstPage\";\n readonly skipped: boolean;\n readonly results: ReadonlyArray<Item>;\n readonly isLoading: true;\n}\n\nexport interface LoadingMore<\n Item,\n E = never,\n> extends PaginatedQueryResult.Proto<Item, E> {\n readonly _tag: \"LoadingMore\";\n readonly results: ReadonlyArray<Item>;\n readonly isLoading: true;\n}\n\nexport interface CanLoadMore<\n Item,\n E = never,\n> extends PaginatedQueryResult.Proto<Item, E> {\n readonly _tag: \"CanLoadMore\";\n readonly results: ReadonlyArray<Item>;\n readonly isLoading: false;\n readonly loadMore: (numItems: number) => void;\n}\n\nexport interface Exhausted<Item, E = never> extends PaginatedQueryResult.Proto<\n Item,\n E\n> {\n readonly _tag: \"Exhausted\";\n readonly results: ReadonlyArray<Item>;\n readonly isLoading: false;\n}\n\nexport interface Failure<Item, E = never> extends PaginatedQueryResult.Proto<\n Item,\n E\n> {\n readonly _tag: \"Failure\";\n readonly error: E;\n /** The pages loaded before the failure. */\n readonly results: ReadonlyArray<Item>;\n}\n\nexport const isPaginatedQueryResult = (\n u: unknown,\n): u is Variants<unknown, unknown> => Predicate.hasProperty(u, TypeId);\n\nconst PaginatedQueryResultProto = {\n [TypeId]: TypeId,\n pipe(this: Variants<any, any>, ...args: ReadonlyArray<unknown>) {\n return Pipeable.pipeArguments(\n this,\n args as unknown as Parameters<typeof Pipeable.pipeArguments>[1],\n );\n },\n /**\n * `CanLoadMore`'s `loadMore` is excluded from equality and hashing, like\n * function fields generally: two results that render identically are equal\n * even though their callbacks differ by identity.\n */\n [Equal.symbol](this: Variants<any, any>, that: Variants<any, any>): boolean {\n if (this._tag !== that._tag) {\n return false;\n }\n return Match.value(this).pipe(\n Match.tag(\n \"LoadingFirstPage\",\n (self) => self.skipped === (that as LoadingFirstPage<any, any>).skipped,\n ),\n Match.tag(\"LoadingMore\", \"CanLoadMore\", \"Exhausted\", (self) =>\n Equal.equals(self.results, that.results),\n ),\n Match.tag(\n \"Failure\",\n (self) =>\n Equal.equals(self.error, (that as Failure<any, any>).error) &&\n Equal.equals(self.results, (that as Failure<any, any>).results),\n ),\n Match.exhaustive,\n );\n },\n [Hash.symbol](this: Variants<any, any>): number {\n const tagHash = Hash.string(this._tag);\n return Match.value(this).pipe(\n Match.tag(\"LoadingFirstPage\", (self) =>\n Hash.combine(tagHash)(Hash.hash(self.skipped)),\n ),\n Match.tag(\"LoadingMore\", \"CanLoadMore\", \"Exhausted\", (self) =>\n Hash.combine(tagHash)(Hash.hash(self.results)),\n ),\n Match.tag(\"Failure\", (self) =>\n Hash.combine(tagHash)(\n Hash.combine(Hash.hash(self.error))(Hash.hash(self.results)),\n ),\n ),\n Match.exhaustive,\n );\n },\n};\n\nconst noResults: ReadonlyArray<never> = [];\n\nexport const loadingFirstPage = <Item = never, E = never>(options: {\n skipped: boolean;\n}): LoadingFirstPage<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"LoadingFirstPage\" as const,\n skipped: options.skipped,\n results: noResults,\n isLoading: true as const,\n });\n\nexport const loadingMore = <Item, E = never>(options: {\n results: ReadonlyArray<Item>;\n}): LoadingMore<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"LoadingMore\" as const,\n results: options.results,\n isLoading: true as const,\n });\n\nexport const canLoadMore = <Item, E = never>(options: {\n results: ReadonlyArray<Item>;\n loadMore: (numItems: number) => void;\n}): CanLoadMore<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"CanLoadMore\" as const,\n results: options.results,\n isLoading: false as const,\n loadMore: options.loadMore,\n });\n\nexport const exhausted = <Item, E = never>(options: {\n results: ReadonlyArray<Item>;\n}): Exhausted<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"Exhausted\" as const,\n results: options.results,\n isLoading: false as const,\n });\n\nexport const failure = <E, Item = never>(options: {\n error: E;\n results: ReadonlyArray<Item>;\n}): Failure<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"Failure\" as const,\n error: options.error,\n results: options.results,\n });\n\nexport const isLoadingFirstPage = <Item, E>(\n result: Variants<Item, E>,\n): result is LoadingFirstPage<Item, E> => result._tag === \"LoadingFirstPage\";\n\nexport const isLoadingMore = <Item, E>(\n result: Variants<Item, E>,\n): result is LoadingMore<Item, E> => result._tag === \"LoadingMore\";\n\nexport const isCanLoadMore = <Item, E>(\n result: Variants<Item, E>,\n): result is CanLoadMore<Item, E> => result._tag === \"CanLoadMore\";\n\nexport const isExhausted = <Item, E>(\n result: Variants<Item, E>,\n): result is Exhausted<Item, E> => result._tag === \"Exhausted\";\n\nexport const isFailure = <Item, E>(\n result: Variants<Item, E>,\n): result is Failure<Item, E> => result._tag === \"Failure\";\n\nexport const isLoading = <Item, E>(\n result: Variants<Item, E>,\n): result is LoadingFirstPage<Item, E> | LoadingMore<Item, E> =>\n result._tag === \"LoadingFirstPage\" || result._tag === \"LoadingMore\";\n\ntype MatchOptions<Item, E, V, W, X, Y, Z> = {\n readonly onLoadingFirstPage: (skipped: boolean) => V;\n readonly onLoadingMore: (results: ReadonlyArray<Item>) => W;\n readonly onCanLoadMore: (\n results: ReadonlyArray<Item>,\n loadMore: (numItems: number) => void,\n ) => X;\n readonly onExhausted: (results: ReadonlyArray<Item>) => Y;\n} & ([E] extends [never]\n ? {}\n : {\n readonly onFailure: (error: E, results: ReadonlyArray<Item>) => Z;\n });\n\ntype MatchReturns<E, V, W, X, Y, Z> = [E] extends [never]\n ? V | W | X | Y\n : V | W | X | Y | Z;\n\n/**\n * Matches a {@link PaginatedQueryResult} to the appropriate handler based on\n * its tag. If the provided result cannot fail (i.e. `E` is `never`),\n * `onFailure` is not required.\n */\nexport const match: {\n <Item, E, V, W, X, Y, Z = never>(\n options: MatchOptions<Item, E, V, W, X, Y, Z>,\n ): (self: Variants<Item, E>) => MatchReturns<E, V, W, X, Y, Z>;\n <Item, E, V, W, X, Y, Z = never>(\n self: Variants<Item, E>,\n options: MatchOptions<Item, E, V, W, X, Y, Z>,\n ): MatchReturns<E, V, W, X, Y, Z>;\n} = Function.dual(\n 2,\n <Item, E, V, W, X, Y, Z = never>(\n self: Variants<Item, E>,\n options: MatchOptions<Item, E, V, W, X, Y, Z>,\n ): MatchReturns<E, V, W, X, Y, Z> =>\n Match.value(self).pipe(\n Match.tag(\"LoadingFirstPage\", (loadingFirstPage_) =>\n options.onLoadingFirstPage(loadingFirstPage_.skipped),\n ),\n Match.tag(\"LoadingMore\", (loadingMore_) =>\n options.onLoadingMore(loadingMore_.results),\n ),\n Match.tag(\"CanLoadMore\", (canLoadMore_) =>\n options.onCanLoadMore(canLoadMore_.results, canLoadMore_.loadMore),\n ),\n Match.tag(\"Exhausted\", (exhausted_) =>\n options.onExhausted(exhausted_.results),\n ),\n Match.tag(\"Failure\", (failure_) => {\n if (Predicate.hasProperty(options, \"onFailure\")) {\n return options.onFailure(failure_.error, failure_.results);\n }\n throw new Error(\n \"`onFailure` is required when error schema is provided\",\n );\n }),\n Match.exhaustive,\n ) as MatchReturns<E, V, W, X, Y, Z>,\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,SAAS;AAsHf,MAAa,0BACX,MACoC,UAAU,YAAY,GAAG,MAAM;AAErE,MAAM,4BAA4B;EAC/B,SAAS;CACV,KAA+B,GAAG,MAA8B;EAC9D,OAAO,SAAS,cACd,MACA,IACF;CACF;;;;;;CAMA,CAAC,MAAM,QAAkC,MAAmC;EAC1E,IAAI,KAAK,SAAS,KAAK,MACrB,OAAO;EAET,OAAO,MAAM,MAAM,IAAI,CAAC,CAAC,KACvB,MAAM,IACJ,qBACC,SAAS,KAAK,YAAa,KAAoC,OAClE,GACA,MAAM,IAAI,eAAe,eAAe,cAAc,SACpD,MAAM,OAAO,KAAK,SAAS,KAAK,OAAO,CACzC,GACA,MAAM,IACJ,YACC,SACC,MAAM,OAAO,KAAK,OAAQ,KAA2B,KAAK,KAC1D,MAAM,OAAO,KAAK,SAAU,KAA2B,OAAO,CAClE,GACA,MAAM,UACR;CACF;CACA,CAAC,KAAK,UAA0C;EAC9C,MAAM,UAAU,KAAK,OAAO,KAAK,IAAI;EACrC,OAAO,MAAM,MAAM,IAAI,CAAC,CAAC,KACvB,MAAM,IAAI,qBAAqB,SAC7B,KAAK,QAAQ,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,OAAO,CAAC,CAC/C,GACA,MAAM,IAAI,eAAe,eAAe,cAAc,SACpD,KAAK,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M,IAAI,qBAAqB,sBAC7B,QAAQ,mBAAmB,kBAAkB,OAAO,CACtD,GACA,MAAM,IAAI,gBAAgB,iBACxB,QAAQ,cAAc,aAAa,OAAO,CAC5C,GACA,MAAM,IAAI,gBAAgB,iBACxB,QAAQ,cAAc,aAAa,SAAS,aAAa,QAAQ,CACnE,GACA,MAAM,IAAI,cAAc,eACtB,QAAQ,YAAY,WAAW,OAAO,CACxC,GACA,MAAM,IAAI,YAAY,aAAa;CACjC,IAAI,UAAU,YAAY,SAAS,WAAW,GAC5C,OAAO,QAAQ,UAAU,SAAS,OAAO,SAAS,OAAO;CAE3D,MAAM,IAAI,MACR,uDACF;AACF,CAAC,GACD,MAAM,UACR,CACJ"}
1
+ {"version":3,"file":"PaginatedQueryResult.js","names":[],"sources":["../src/PaginatedQueryResult.ts"],"sourcesContent":["import * as Equal from \"effect/Equal\";\nimport * as Function from \"effect/Function\";\nimport * as Hash from \"effect/Hash\";\nimport * as Match from \"effect/Match\";\nimport * as Pipeable from \"effect/Pipeable\";\nimport * as Predicate from \"effect/Predicate\";\n\nconst TypeId = \"~@confect/react/PaginatedQueryResult\";\ntype TypeId = typeof TypeId;\n\n/**\n * A `PaginatedQueryResult` represents the result of a Confect paginated query.\n * The non-`Failure` variants mirror the statuses of `usePaginatedQuery` from\n * `convex/react` and all carry `results` and `isLoading`, so the common UI\n * shape—render the list, show a spinner while loading—needs only an\n * {@link isFailure} early-out and plain field access.\n *\n * Every variant carries `results`, including `Failure`: when a later page\n * fails, the pages already loaded are still worth rendering alongside the\n * error, so they are not discarded. `Failure` additionally carries the query's\n * decoded typed error.\n *\n * `loadMore` appears only on `CanLoadMore`, the one state it can make progress\n * from. The underlying Convex hook exposes it on every status, but calling it\n * while a page is in flight, once the list is exhausted, or after a failure is\n * an intentional no-op there; narrowing to `CanLoadMore`—via\n * {@link isCanLoadMore} or {@link match}—makes that statically apparent instead\n * of silently dropping the call.\n *\n * When the query declares no `error` schema (`E` is `never`), the `Failure`\n * variant is excluded from the type entirely, so `isLoading` is accessible\n * without any narrowing.\n *\n * @typeParam Item - The type of a decoded page item.\n * @typeParam E - The type of the decoded typed error in the `Failure` variant.\n */\nexport type PaginatedQueryResult<Item, E = never> = [E] extends [never]\n ?\n | LoadingFirstPage<Item, E>\n | LoadingMore<Item, E>\n | CanLoadMore<Item, E>\n | Exhausted<Item, E>\n :\n | LoadingFirstPage<Item, E>\n | LoadingMore<Item, E>\n | CanLoadMore<Item, E>\n | Exhausted<Item, E>\n | Failure<Item, E>;\n\n/**\n * Every variant regardless of `E`—the parameter type for guards and\n * {@link match}, since `PaginatedQueryResult` itself excludes `Failure` when `E`\n * is `never`.\n */\nexport type Variants<Item, E = never> =\n | LoadingFirstPage<Item, E>\n | LoadingMore<Item, E>\n | CanLoadMore<Item, E>\n | Exhausted<Item, E>\n | Failure<Item, E>;\n\nexport declare namespace PaginatedQueryResult {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n export interface Proto<out Item, out E> extends Pipeable.Pipeable {\n readonly [TypeId]: TypeId;\n readonly \"~Item\": Item;\n readonly \"~E\": E;\n }\n\n export type Item<R> = R extends { readonly \"~Item\": infer Item_ }\n ? Item_\n : never;\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n export type Failure<R> = R extends { readonly \"~E\": infer E } ? E : never;\n}\n\nexport interface LoadingFirstPage<\n Item,\n E = never,\n> extends PaginatedQueryResult.Proto<Item, E> {\n readonly _tag: \"LoadingFirstPage\";\n readonly skipped: boolean;\n readonly results: ReadonlyArray<Item>;\n readonly isLoading: true;\n}\n\nexport interface LoadingMore<\n Item,\n E = never,\n> extends PaginatedQueryResult.Proto<Item, E> {\n readonly _tag: \"LoadingMore\";\n readonly results: ReadonlyArray<Item>;\n readonly isLoading: true;\n}\n\nexport interface CanLoadMore<\n Item,\n E = never,\n> extends PaginatedQueryResult.Proto<Item, E> {\n readonly _tag: \"CanLoadMore\";\n readonly results: ReadonlyArray<Item>;\n readonly isLoading: false;\n readonly loadMore: (numItems: number) => void;\n}\n\nexport interface Exhausted<Item, E = never> extends PaginatedQueryResult.Proto<\n Item,\n E\n> {\n readonly _tag: \"Exhausted\";\n readonly results: ReadonlyArray<Item>;\n readonly isLoading: false;\n}\n\nexport interface Failure<Item, E = never> extends PaginatedQueryResult.Proto<\n Item,\n E\n> {\n readonly _tag: \"Failure\";\n readonly error: E;\n /**\n * The pages loaded before the failure.\n */\n readonly results: ReadonlyArray<Item>;\n}\n\nexport const isPaginatedQueryResult = (\n u: unknown,\n): u is Variants<unknown, unknown> => Predicate.hasProperty(u, TypeId);\n\nconst PaginatedQueryResultProto = {\n [TypeId]: TypeId,\n pipe(this: Variants<any, any>, ...args: ReadonlyArray<unknown>) {\n return Pipeable.pipeArguments(\n this,\n args as unknown as Parameters<typeof Pipeable.pipeArguments>[1],\n );\n },\n /**\n * `CanLoadMore`'s `loadMore` is excluded from equality and hashing, like\n * function fields generally: two results that render identically are equal\n * even though their callbacks differ by identity.\n */\n [Equal.symbol](this: Variants<any, any>, that: Variants<any, any>): boolean {\n if (this._tag !== that._tag) {\n return false;\n }\n return Match.value(this).pipe(\n Match.tag(\n \"LoadingFirstPage\",\n (self) => self.skipped === (that as LoadingFirstPage<any, any>).skipped,\n ),\n Match.tag(\"LoadingMore\", \"CanLoadMore\", \"Exhausted\", (self) =>\n Equal.equals(self.results, that.results),\n ),\n Match.tag(\n \"Failure\",\n (self) =>\n Equal.equals(self.error, (that as Failure<any, any>).error) &&\n Equal.equals(self.results, (that as Failure<any, any>).results),\n ),\n Match.exhaustive,\n );\n },\n [Hash.symbol](this: Variants<any, any>): number {\n const tagHash = Hash.string(this._tag);\n return Match.value(this).pipe(\n Match.tag(\"LoadingFirstPage\", (self) =>\n Hash.combine(tagHash)(Hash.hash(self.skipped)),\n ),\n Match.tag(\"LoadingMore\", \"CanLoadMore\", \"Exhausted\", (self) =>\n Hash.combine(tagHash)(Hash.hash(self.results)),\n ),\n Match.tag(\"Failure\", (self) =>\n Hash.combine(tagHash)(\n Hash.combine(Hash.hash(self.error))(Hash.hash(self.results)),\n ),\n ),\n Match.exhaustive,\n );\n },\n};\n\nconst noResults: ReadonlyArray<never> = [];\n\nexport const loadingFirstPage = <Item = never, E = never>(options: {\n skipped: boolean;\n}): LoadingFirstPage<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"LoadingFirstPage\" as const,\n skipped: options.skipped,\n results: noResults,\n isLoading: true as const,\n });\n\nexport const loadingMore = <Item, E = never>(options: {\n results: ReadonlyArray<Item>;\n}): LoadingMore<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"LoadingMore\" as const,\n results: options.results,\n isLoading: true as const,\n });\n\nexport const canLoadMore = <Item, E = never>(options: {\n results: ReadonlyArray<Item>;\n loadMore: (numItems: number) => void;\n}): CanLoadMore<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"CanLoadMore\" as const,\n results: options.results,\n isLoading: false as const,\n loadMore: options.loadMore,\n });\n\nexport const exhausted = <Item, E = never>(options: {\n results: ReadonlyArray<Item>;\n}): Exhausted<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"Exhausted\" as const,\n results: options.results,\n isLoading: false as const,\n });\n\nexport const failure = <E, Item = never>(options: {\n error: E;\n results: ReadonlyArray<Item>;\n}): Failure<Item, E> =>\n Object.assign(Object.create(PaginatedQueryResultProto), {\n _tag: \"Failure\" as const,\n error: options.error,\n results: options.results,\n });\n\nexport const isLoadingFirstPage = <Item, E>(\n result: Variants<Item, E>,\n): result is LoadingFirstPage<Item, E> => result._tag === \"LoadingFirstPage\";\n\nexport const isLoadingMore = <Item, E>(\n result: Variants<Item, E>,\n): result is LoadingMore<Item, E> => result._tag === \"LoadingMore\";\n\nexport const isCanLoadMore = <Item, E>(\n result: Variants<Item, E>,\n): result is CanLoadMore<Item, E> => result._tag === \"CanLoadMore\";\n\nexport const isExhausted = <Item, E>(\n result: Variants<Item, E>,\n): result is Exhausted<Item, E> => result._tag === \"Exhausted\";\n\nexport const isFailure = <Item, E>(\n result: Variants<Item, E>,\n): result is Failure<Item, E> => result._tag === \"Failure\";\n\nexport const isLoading = <Item, E>(\n result: Variants<Item, E>,\n): result is LoadingFirstPage<Item, E> | LoadingMore<Item, E> =>\n result._tag === \"LoadingFirstPage\" || result._tag === \"LoadingMore\";\n\ntype MatchOptions<Item, E, V, W, X, Y, Z> = {\n readonly onLoadingFirstPage: (skipped: boolean) => V;\n readonly onLoadingMore: (results: ReadonlyArray<Item>) => W;\n readonly onCanLoadMore: (\n results: ReadonlyArray<Item>,\n loadMore: (numItems: number) => void,\n ) => X;\n readonly onExhausted: (results: ReadonlyArray<Item>) => Y;\n} & ([E] extends [never]\n ? {}\n : {\n readonly onFailure: (error: E, results: ReadonlyArray<Item>) => Z;\n });\n\ntype MatchReturns<E, V, W, X, Y, Z> = [E] extends [never]\n ? V | W | X | Y\n : V | W | X | Y | Z;\n\n/**\n * Matches a {@link PaginatedQueryResult} to the appropriate handler based on its\n * tag. If the provided result cannot fail (i.e. `E` is `never`), `onFailure` is\n * not required.\n */\nexport const match: {\n <Item, E, V, W, X, Y, Z = never>(\n options: MatchOptions<Item, E, V, W, X, Y, Z>,\n ): (self: Variants<Item, E>) => MatchReturns<E, V, W, X, Y, Z>;\n <Item, E, V, W, X, Y, Z = never>(\n self: Variants<Item, E>,\n options: MatchOptions<Item, E, V, W, X, Y, Z>,\n ): MatchReturns<E, V, W, X, Y, Z>;\n} = Function.dual(\n 2,\n <Item, E, V, W, X, Y, Z = never>(\n self: Variants<Item, E>,\n options: MatchOptions<Item, E, V, W, X, Y, Z>,\n ): MatchReturns<E, V, W, X, Y, Z> =>\n Match.value(self).pipe(\n Match.tag(\"LoadingFirstPage\", (loadingFirstPage_) =>\n options.onLoadingFirstPage(loadingFirstPage_.skipped),\n ),\n Match.tag(\"LoadingMore\", (loadingMore_) =>\n options.onLoadingMore(loadingMore_.results),\n ),\n Match.tag(\"CanLoadMore\", (canLoadMore_) =>\n options.onCanLoadMore(canLoadMore_.results, canLoadMore_.loadMore),\n ),\n Match.tag(\"Exhausted\", (exhausted_) =>\n options.onExhausted(exhausted_.results),\n ),\n Match.tag(\"Failure\", (failure_) => {\n if (Predicate.hasProperty(options, \"onFailure\")) {\n return options.onFailure(failure_.error, failure_.results);\n }\n throw new Error(\n \"`onFailure` is required when error schema is provided\",\n );\n }),\n Match.exhaustive,\n ) as MatchReturns<E, V, W, X, Y, Z>,\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,SAAS;AAwHf,MAAa,0BACX,MACoC,UAAU,YAAY,GAAG,MAAM;AAErE,MAAM,4BAA4B;EAC/B,SAAS;CACV,KAA+B,GAAG,MAA8B;EAC9D,OAAO,SAAS,cACd,MACA,IACF;CACF;;;;;;CAMA,CAAC,MAAM,QAAkC,MAAmC;EAC1E,IAAI,KAAK,SAAS,KAAK,MACrB,OAAO;EAET,OAAO,MAAM,MAAM,IAAI,CAAC,CAAC,KACvB,MAAM,IACJ,qBACC,SAAS,KAAK,YAAa,KAAoC,OAClE,GACA,MAAM,IAAI,eAAe,eAAe,cAAc,SACpD,MAAM,OAAO,KAAK,SAAS,KAAK,OAAO,CACzC,GACA,MAAM,IACJ,YACC,SACC,MAAM,OAAO,KAAK,OAAQ,KAA2B,KAAK,KAC1D,MAAM,OAAO,KAAK,SAAU,KAA2B,OAAO,CAClE,GACA,MAAM,UACR;CACF;CACA,CAAC,KAAK,UAA0C;EAC9C,MAAM,UAAU,KAAK,OAAO,KAAK,IAAI;EACrC,OAAO,MAAM,MAAM,IAAI,CAAC,CAAC,KACvB,MAAM,IAAI,qBAAqB,SAC7B,KAAK,QAAQ,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,OAAO,CAAC,CAC/C,GACA,MAAM,IAAI,eAAe,eAAe,cAAc,SACpD,KAAK,QAAQ,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,OAAO,CAAC,CAC/C,GACA,MAAM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IAAI,gBAAgB,iBACxB,QAAQ,cAAc,aAAa,OAAO,CAC5C,GACA,MAAM,IAAI,gBAAgB,iBACxB,QAAQ,cAAc,aAAa,SAAS,aAAa,QAAQ,CACnE,GACA,MAAM,IAAI,cAAc,eACtB,QAAQ,YAAY,WAAW,OAAO,CACxC,GACA,MAAM,IAAI,YAAY,aAAa;CACjC,IAAI,UAAU,YAAY,SAAS,WAAW,GAC5C,OAAO,QAAQ,UAAU,SAAS,OAAO,SAAS,OAAO;CAE3D,MAAM,IAAI,MACR,uDACF;AACF,CAAC,GACD,MAAM,UACR,CACJ"}
@@ -4,7 +4,8 @@ type TypeId = typeof TypeId;
4
4
  /**
5
5
  * A `QueryResult` represents the result of a Confect query.
6
6
  *
7
- * @typeParam A - The type of the decoded `returns` value in the `Success` variant.
7
+ * @typeParam A - The type of the decoded `returns` value in the `Success`
8
+ * variant.
8
9
  * @typeParam E - The type of the decoded typed error in the `Failure` variant.
9
10
  */
10
11
  export type QueryResult<A, E = never> = Loading<A, E> | Success<A, E> | Failure<A, E>;
@@ -53,12 +54,11 @@ type MatchReturns<E, X, Y, Z> = [E] extends [never] ? X | Y : X | Y | Z;
53
54
  * not required.
54
55
  *
55
56
  * @example
56
- * ```tsx
57
- * const result = QueryResult.match(queryResult, {
58
- * onLoading: (skipped) => skipped ? null : <p>Loading…</p>,
59
- * onSuccess: (value) => <p>{value.text}</p>,
60
- * onFailure: (error) => <p>Error: {error.message}</p>,
61
- * });
57
+ * const result = QueryResult.match(queryResult, {
58
+ * onLoading: (skipped) => (skipped ? null : <p>Loading…</p>),
59
+ * onSuccess: (value) => <p>{value.text}</p>,
60
+ * onFailure: (error) => <p>Error: {error.message}</p>,
61
+ * });
62
62
  */
63
63
  export declare const match: {
64
64
  <A, E, X, Y, Z = never>(options: MatchOptions<A, E, X, Y, Z>): (self: QueryResult<A, E>) => MatchReturns<E, X, Y, Z>;
@@ -1 +1 @@
1
- {"version":3,"file":"QueryResult.d.ts","sourceRoot":"","sources":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