@gaganref/confect-server 0.0.0-stage → 10.3.1-fork.10
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 +2119 -0
- package/LICENSE +7 -0
- package/README.md +16 -2
- package/dist/ActionCtx.d.ts +10 -0
- package/dist/ActionCtx.d.ts.map +1 -0
- package/dist/ActionCtx.js +18 -0
- package/dist/ActionCtx.js.map +1 -0
- package/dist/ActionRunner.d.ts +16 -0
- package/dist/ActionRunner.d.ts.map +1 -0
- package/dist/ActionRunner.js +18 -0
- package/dist/ActionRunner.js.map +1 -0
- package/dist/AiGatewayDecisionClient.d.ts +20 -0
- package/dist/AiGatewayDecisionClient.d.ts.map +1 -0
- package/dist/AiGatewayDecisionClient.js +31 -0
- package/dist/AiGatewayDecisionClient.js.map +1 -0
- package/dist/AiGatewayDecisionModel.d.ts +24 -0
- package/dist/AiGatewayDecisionModel.d.ts.map +1 -0
- package/dist/AiGatewayDecisionModel.js +27 -0
- package/dist/AiGatewayDecisionModel.js.map +1 -0
- package/dist/AiGatewayLanguageClient.d.ts +21 -0
- package/dist/AiGatewayLanguageClient.d.ts.map +1 -0
- package/dist/AiGatewayLanguageClient.js +32 -0
- package/dist/AiGatewayLanguageClient.js.map +1 -0
- package/dist/AiGatewayLanguageModel.d.ts +95 -0
- package/dist/AiGatewayLanguageModel.d.ts.map +1 -0
- package/dist/AiGatewayLanguageModel.js +42 -0
- package/dist/AiGatewayLanguageModel.js.map +1 -0
- package/dist/Auth.d.ts +20 -0
- package/dist/Auth.d.ts.map +1 -0
- package/dist/Auth.js +31 -0
- package/dist/Auth.js.map +1 -0
- package/dist/BlobNotFoundError.d.ts +9 -0
- package/dist/BlobNotFoundError.d.ts.map +1 -0
- package/dist/BlobNotFoundError.js +13 -0
- package/dist/BlobNotFoundError.js.map +1 -0
- package/dist/Callback.d.ts +31 -0
- package/dist/Callback.d.ts.map +1 -0
- package/dist/Callback.js +182 -0
- package/dist/Callback.js.map +1 -0
- package/dist/ComponentCtx.d.ts +71 -0
- package/dist/ComponentCtx.d.ts.map +1 -0
- package/dist/ComponentCtx.js +0 -0
- package/dist/ConvexConfigProvider.d.ts +21 -0
- package/dist/ConvexConfigProvider.d.ts.map +1 -0
- package/dist/ConvexConfigProvider.js +36 -0
- package/dist/ConvexConfigProvider.js.map +1 -0
- package/dist/ConvexFunctionDefinitions.d.ts +25 -0
- package/dist/ConvexFunctionDefinitions.d.ts.map +1 -0
- package/dist/ConvexFunctionDefinitions.js +25 -0
- package/dist/ConvexFunctionDefinitions.js.map +1 -0
- package/dist/ConvexLogger.d.ts +17 -0
- package/dist/ConvexLogger.d.ts.map +1 -0
- package/dist/ConvexLogger.js +33 -0
- package/dist/ConvexLogger.js.map +1 -0
- package/dist/CronJob.d.ts +14 -0
- package/dist/CronJob.d.ts.map +1 -0
- package/dist/CronJob.js +22 -0
- package/dist/CronJob.js.map +1 -0
- package/dist/CronJobs.d.ts +22 -0
- package/dist/CronJobs.d.ts.map +1 -0
- package/dist/CronJobs.js +83 -0
- package/dist/CronJobs.js.map +1 -0
- package/dist/DataModel.d.ts +28 -0
- package/dist/DataModel.d.ts.map +1 -0
- package/dist/DataModel.js +7 -0
- package/dist/DataModel.js.map +1 -0
- package/dist/DatabaseReader.d.ts +26 -0
- package/dist/DatabaseReader.d.ts.map +1 -0
- package/dist/DatabaseReader.js +33 -0
- package/dist/DatabaseReader.js.map +1 -0
- package/dist/DatabaseSchema.d.ts +67 -0
- package/dist/DatabaseSchema.d.ts.map +1 -0
- package/dist/DatabaseSchema.js +61 -0
- package/dist/DatabaseSchema.js.map +1 -0
- package/dist/DatabaseWriter.d.ts +44 -0
- package/dist/DatabaseWriter.d.ts.map +1 -0
- package/dist/DatabaseWriter.js +47 -0
- package/dist/DatabaseWriter.js.map +1 -0
- package/dist/Document.d.ts +37 -0
- package/dist/Document.d.ts.map +1 -0
- package/dist/Document.js +54 -0
- package/dist/Document.js.map +1 -0
- package/dist/ExecutionMetadata.d.ts +13 -0
- package/dist/ExecutionMetadata.d.ts.map +1 -0
- package/dist/ExecutionMetadata.js +19 -0
- package/dist/ExecutionMetadata.js.map +1 -0
- package/dist/FunctionImpl.d.ts +39 -0
- package/dist/FunctionImpl.d.ts.map +1 -0
- package/dist/FunctionImpl.js +46 -0
- package/dist/FunctionImpl.js.map +1 -0
- package/dist/FunctionRegistryItem.d.ts +36 -0
- package/dist/FunctionRegistryItem.d.ts.map +1 -0
- package/dist/FunctionRegistryItem.js +34 -0
- package/dist/FunctionRegistryItem.js.map +1 -0
- package/dist/GroupImpl.d.ts +77 -0
- package/dist/GroupImpl.d.ts.map +1 -0
- package/dist/GroupImpl.js +81 -0
- package/dist/GroupImpl.js.map +1 -0
- package/dist/GroupRegistry.d.ts +8 -0
- package/dist/GroupRegistry.d.ts.map +1 -0
- package/dist/GroupRegistry.js +26 -0
- package/dist/GroupRegistry.js.map +1 -0
- package/dist/Handler.d.ts +47 -0
- package/dist/Handler.d.ts.map +1 -0
- package/dist/Handler.js +7 -0
- package/dist/Handler.js.map +1 -0
- package/dist/HttpRouter.d.ts +80 -0
- package/dist/HttpRouter.d.ts.map +1 -0
- package/dist/HttpRouter.js +195 -0
- package/dist/HttpRouter.js.map +1 -0
- package/dist/MiddlewareImpl.d.ts +79 -0
- package/dist/MiddlewareImpl.d.ts.map +1 -0
- package/dist/MiddlewareImpl.js +58 -0
- package/dist/MiddlewareImpl.js.map +1 -0
- package/dist/MiddlewareRegistryItem.d.ts +12 -0
- package/dist/MiddlewareRegistryItem.d.ts.map +1 -0
- package/dist/MiddlewareRegistryItem.js +15 -0
- package/dist/MiddlewareRegistryItem.js.map +1 -0
- package/dist/MutationCtx.d.ts +10 -0
- package/dist/MutationCtx.d.ts.map +1 -0
- package/dist/MutationCtx.js +18 -0
- package/dist/MutationCtx.js.map +1 -0
- package/dist/MutationRunner.d.ts +27 -0
- package/dist/MutationRunner.d.ts.map +1 -0
- package/dist/MutationRunner.js +28 -0
- package/dist/MutationRunner.js.map +1 -0
- package/dist/MutationTransactionContext.d.ts +17 -0
- package/dist/MutationTransactionContext.d.ts.map +1 -0
- package/dist/MutationTransactionContext.js +20 -0
- package/dist/MutationTransactionContext.js.map +1 -0
- package/dist/OrderedQuery.d.ts +32 -0
- package/dist/OrderedQuery.d.ts.map +1 -0
- package/dist/OrderedQuery.js +36 -0
- package/dist/OrderedQuery.js.map +1 -0
- package/dist/QueryCtx.d.ts +10 -0
- package/dist/QueryCtx.d.ts.map +1 -0
- package/dist/QueryCtx.js +18 -0
- package/dist/QueryCtx.js.map +1 -0
- package/dist/QueryInitializer.d.ts +75 -0
- package/dist/QueryInitializer.d.ts.map +1 -0
- package/dist/QueryInitializer.js +105 -0
- package/dist/QueryInitializer.js.map +1 -0
- package/dist/QueryRunner.d.ts +46 -0
- package/dist/QueryRunner.d.ts.map +1 -0
- package/dist/QueryRunner.js +30 -0
- package/dist/QueryRunner.js.map +1 -0
- package/dist/QueryStream.d.ts +678 -0
- package/dist/QueryStream.d.ts.map +1 -0
- package/dist/QueryStream.js +943 -0
- package/dist/QueryStream.js.map +1 -0
- package/dist/QueryStreamCursor.d.ts +39 -0
- package/dist/QueryStreamCursor.d.ts.map +1 -0
- package/dist/QueryStreamCursor.js +52 -0
- package/dist/QueryStreamCursor.js.map +1 -0
- package/dist/QueryStreamIndexPrefix.d.ts +48 -0
- package/dist/QueryStreamIndexPrefix.d.ts.map +1 -0
- package/dist/QueryStreamIndexPrefix.js +38 -0
- package/dist/QueryStreamIndexPrefix.js.map +1 -0
- package/dist/QueryStreamIndexRange.d.ts +193 -0
- package/dist/QueryStreamIndexRange.d.ts.map +1 -0
- package/dist/QueryStreamIndexRange.js +241 -0
- package/dist/QueryStreamIndexRange.js.map +1 -0
- package/dist/QueryStreamKey.d.ts +64 -0
- package/dist/QueryStreamKey.d.ts.map +1 -0
- package/dist/QueryStreamKey.js +69 -0
- package/dist/QueryStreamKey.js.map +1 -0
- package/dist/QueryStreamKeyBounds.d.ts +136 -0
- package/dist/QueryStreamKeyBounds.d.ts.map +1 -0
- package/dist/QueryStreamKeyBounds.js +208 -0
- package/dist/QueryStreamKeyBounds.js.map +1 -0
- package/dist/QueryStreamKeyLabels.d.ts +27 -0
- package/dist/QueryStreamKeyLabels.d.ts.map +1 -0
- package/dist/QueryStreamKeyLabels.js +22 -0
- package/dist/QueryStreamKeyLabels.js.map +1 -0
- package/dist/QueryStreamKeyLayout.d.ts +179 -0
- package/dist/QueryStreamKeyLayout.d.ts.map +1 -0
- package/dist/QueryStreamKeyLayout.js +167 -0
- package/dist/QueryStreamKeyLayout.js.map +1 -0
- package/dist/QueryStreamKeyValues.d.ts +40 -0
- package/dist/QueryStreamKeyValues.d.ts.map +1 -0
- package/dist/QueryStreamKeyValues.js +57 -0
- package/dist/QueryStreamKeyValues.js.map +1 -0
- package/dist/QueryStreamOrderDirection.d.ts +24 -0
- package/dist/QueryStreamOrderDirection.d.ts.map +1 -0
- package/dist/QueryStreamOrderDirection.js +11 -0
- package/dist/QueryStreamOrderDirection.js.map +1 -0
- package/dist/QueryStreamPagination.d.ts +264 -0
- package/dist/QueryStreamPagination.d.ts.map +1 -0
- package/dist/QueryStreamPagination.js +172 -0
- package/dist/QueryStreamPagination.js.map +1 -0
- package/dist/QueryStreamReadBudget.d.ts +63 -0
- package/dist/QueryStreamReadBudget.d.ts.map +1 -0
- package/dist/QueryStreamReadBudget.js +81 -0
- package/dist/QueryStreamReadBudget.js.map +1 -0
- package/dist/QueryTransactionContext.d.ts +16 -0
- package/dist/QueryTransactionContext.d.ts.map +1 -0
- package/dist/QueryTransactionContext.js +17 -0
- package/dist/QueryTransactionContext.js.map +1 -0
- package/dist/RegisteredConvexFunction.d.ts +359 -0
- package/dist/RegisteredConvexFunction.d.ts.map +1 -0
- package/dist/RegisteredConvexFunction.js +154 -0
- package/dist/RegisteredConvexFunction.js.map +1 -0
- package/dist/RegisteredFunction.d.ts +143 -0
- package/dist/RegisteredFunction.d.ts.map +1 -0
- package/dist/RegisteredFunction.js +125 -0
- package/dist/RegisteredFunction.js.map +1 -0
- package/dist/RegisteredFunctions.d.ts +57 -0
- package/dist/RegisteredFunctions.d.ts.map +1 -0
- package/dist/RegisteredFunctions.js +32 -0
- package/dist/RegisteredFunctions.js.map +1 -0
- package/dist/RegisteredNodeFunction.d.ts +11 -0
- package/dist/RegisteredNodeFunction.d.ts.map +1 -0
- package/dist/RegisteredNodeFunction.js +45 -0
- package/dist/RegisteredNodeFunction.js.map +1 -0
- package/dist/Registry.d.ts +12 -0
- package/dist/Registry.d.ts.map +1 -0
- package/dist/Registry.js +17 -0
- package/dist/Registry.js.map +1 -0
- package/dist/RegistryItems.d.ts +21 -0
- package/dist/RegistryItems.d.ts.map +1 -0
- package/dist/RegistryItems.js +27 -0
- package/dist/RegistryItems.js.map +1 -0
- package/dist/RequestMetadata.d.ts +12 -0
- package/dist/RequestMetadata.d.ts.map +1 -0
- package/dist/RequestMetadata.js +16 -0
- package/dist/RequestMetadata.js.map +1 -0
- package/dist/ResolvedMiddleware.d.ts +24 -0
- package/dist/ResolvedMiddleware.d.ts.map +1 -0
- package/dist/ResolvedMiddleware.js +34 -0
- package/dist/ResolvedMiddleware.js.map +1 -0
- package/dist/Scheduler.d.ts +31 -0
- package/dist/Scheduler.d.ts.map +1 -0
- package/dist/Scheduler.js +35 -0
- package/dist/Scheduler.js.map +1 -0
- package/dist/Storage.d.ts +22 -0
- package/dist/Storage.d.ts.map +1 -0
- package/dist/Storage.js +27 -0
- package/dist/Storage.js.map +1 -0
- package/dist/StorageActionWriter.d.ts +35 -0
- package/dist/StorageActionWriter.d.ts.map +1 -0
- package/dist/StorageActionWriter.js +24 -0
- package/dist/StorageActionWriter.js.map +1 -0
- package/dist/StorageReader.d.ts +26 -0
- package/dist/StorageReader.d.ts.map +1 -0
- package/dist/StorageReader.js +22 -0
- package/dist/StorageReader.js.map +1 -0
- package/dist/StorageWriter.d.ts +29 -0
- package/dist/StorageWriter.d.ts.map +1 -0
- package/dist/StorageWriter.js +24 -0
- package/dist/StorageWriter.js.map +1 -0
- package/dist/Table.d.ts +274 -0
- package/dist/Table.d.ts.map +1 -0
- package/dist/Table.js +70 -0
- package/dist/Table.js.map +1 -0
- package/dist/TableInfo.d.ts +44 -0
- package/dist/TableInfo.d.ts.map +1 -0
- package/dist/TableInfo.js +7 -0
- package/dist/TableInfo.js.map +1 -0
- package/dist/TransactionMetadata.d.ts +12 -0
- package/dist/TransactionMetadata.d.ts.map +1 -0
- package/dist/TransactionMetadata.js +16 -0
- package/dist/TransactionMetadata.js.map +1 -0
- package/dist/VectorSearch.d.ts +23 -0
- package/dist/VectorSearch.d.ts.map +1 -0
- package/dist/VectorSearch.js +17 -0
- package/dist/VectorSearch.js.map +1 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/internal/AiGatewayDecisionClient.d.ts +7 -0
- package/dist/internal/AiGatewayDecisionClient.d.ts.map +1 -0
- package/dist/internal/AiGatewayDecisionClient.js +19 -0
- package/dist/internal/AiGatewayDecisionClient.js.map +1 -0
- package/dist/internal/AiGatewayLanguageClient.d.ts +7 -0
- package/dist/internal/AiGatewayLanguageClient.d.ts.map +1 -0
- package/dist/internal/AiGatewayLanguageClient.js +19 -0
- package/dist/internal/AiGatewayLanguageClient.js.map +1 -0
- package/dist/internal/AiGatewayServiceToken.d.ts +46 -0
- package/dist/internal/AiGatewayServiceToken.d.ts.map +1 -0
- package/dist/internal/AiGatewayServiceToken.js +62 -0
- package/dist/internal/AiGatewayServiceToken.js.map +1 -0
- package/dist/internal/constants.d.ts +2 -0
- package/dist/internal/constants.d.ts.map +1 -0
- package/dist/internal/constants.js +6 -0
- package/dist/internal/constants.js.map +1 -0
- package/dist/internal/utils.d.ts +13 -0
- package/dist/internal/utils.d.ts.map +1 -0
- package/dist/internal/utils.js +50 -0
- package/dist/internal/utils.js.map +1 -0
- package/dist/node.d.ts +2 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +1 -0
- package/package.json +68 -3
- package/src/ActionCtx.ts +45 -0
- package/src/ActionRunner.ts +36 -0
- package/src/AiGatewayDecisionClient.ts +40 -0
- package/src/AiGatewayDecisionModel.ts +46 -0
- package/src/AiGatewayLanguageClient.ts +41 -0
- package/src/AiGatewayLanguageModel.ts +61 -0
- package/src/Auth.ts +51 -0
- package/src/BlobNotFoundError.ts +12 -0
- package/src/Callback.ts +313 -0
- package/src/ComponentCtx.ts +192 -0
- package/src/ConvexConfigProvider.ts +39 -0
- package/src/ConvexFunctionDefinitions.ts +91 -0
- package/src/ConvexLogger.ts +43 -0
- package/src/CronJob.ts +42 -0
- package/src/CronJobs.ts +165 -0
- package/src/DataModel.ts +81 -0
- package/src/DatabaseReader.ts +118 -0
- package/src/DatabaseSchema.ts +139 -0
- package/src/DatabaseWriter.ts +232 -0
- package/src/Document.ts +146 -0
- package/src/ExecutionMetadata.ts +26 -0
- package/src/FunctionImpl.ts +96 -0
- package/src/FunctionRegistryItem.ts +85 -0
- package/src/GroupImpl.ts +167 -0
- package/src/GroupRegistry.ts +41 -0
- package/src/Handler.ts +191 -0
- package/src/HttpRouter.ts +388 -0
- package/src/MiddlewareImpl.ts +247 -0
- package/src/MiddlewareRegistryItem.ts +21 -0
- package/src/MutationCtx.ts +45 -0
- package/src/MutationRunner.ts +66 -0
- package/src/MutationTransactionContext.ts +48 -0
- package/src/OrderedQuery.ts +136 -0
- package/src/QueryCtx.ts +45 -0
- package/src/QueryInitializer.ts +537 -0
- package/src/QueryRunner.ts +91 -0
- package/src/QueryStream.ts +2476 -0
- package/src/QueryStreamCursor.ts +99 -0
- package/src/QueryStreamIndexPrefix.ts +79 -0
- package/src/QueryStreamIndexRange.ts +489 -0
- package/src/QueryStreamKey.ts +118 -0
- package/src/QueryStreamKeyBounds.ts +395 -0
- package/src/QueryStreamKeyLabels.ts +56 -0
- package/src/QueryStreamKeyLayout.ts +382 -0
- package/src/QueryStreamKeyValues.ts +112 -0
- package/src/QueryStreamOrderDirection.ts +29 -0
- package/src/QueryStreamPagination.ts +357 -0
- package/src/QueryStreamReadBudget.ts +167 -0
- package/src/QueryTransactionContext.ts +37 -0
- package/src/RegisteredConvexFunction.ts +415 -0
- package/src/RegisteredFunction.ts +391 -0
- package/src/RegisteredFunctions.ts +88 -0
- package/src/RegisteredNodeFunction.ts +120 -0
- package/src/Registry.ts +17 -0
- package/src/RegistryItems.ts +40 -0
- package/src/RequestMetadata.ts +20 -0
- package/src/ResolvedMiddleware.ts +70 -0
- package/src/Scheduler.ts +85 -0
- package/src/Storage.ts +37 -0
- package/src/StorageActionWriter.ts +59 -0
- package/src/StorageReader.ts +59 -0
- package/src/StorageWriter.ts +58 -0
- package/src/Table.ts +156 -0
- package/src/TableInfo.ts +106 -0
- package/src/TransactionMetadata.ts +20 -0
- package/src/VectorSearch.ts +75 -0
- package/src/index.ts +87 -0
- package/src/internal/AiGatewayDecisionClient.ts +16 -0
- package/src/internal/AiGatewayLanguageClient.ts +16 -0
- package/src/internal/AiGatewayServiceToken.ts +129 -0
- package/src/internal/constants.ts +1 -0
- package/src/internal/utils.ts +89 -0
- package/src/node.ts +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,2119 @@
|
|
|
1
|
+
# @confect/server
|
|
2
|
+
|
|
3
|
+
## 10.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3aeb1ad: Correct the AI gateway error guidance to explain how authenticated, project-linked local deployments can use the gateway.
|
|
8
|
+
|
|
9
|
+
## 10.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 924004d: Require `effect` 4.0.4 or newer in the 4.x series for the CLI and server, alongside updated `@effect/platform-node`, `@effect/ai-openai-compat`, and `@effect/ai-openrouter` dependencies.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 2a2c076: Reduce Convex deployment analysis overhead for generated functions while retaining source maps and existing validation and handler behavior. After upgrading, regenerate with `confect codegen` or `confect dev` before typechecking or deploying existing projects.
|
|
18
|
+
|
|
19
|
+
## 10.2.0
|
|
20
|
+
|
|
21
|
+
No changes in this release.
|
|
22
|
+
|
|
23
|
+
## 10.1.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- b7a9b62: Update the CLI's `@effect/platform-node` dependency to `^4.0.1` and `exsolve` to `^1.1.3`, and update the server's `@effect/ai-openai-compat` and `@effect/ai-openrouter` dependencies to `4.0.1`.
|
|
28
|
+
|
|
29
|
+
Raise the `effect` peer requirement for `@confect/cli` and `@confect/server` from `^4.0.0` to `^4.0.1`. Applications using either package must install Effect 4.0.1 or a newer compatible 4.x release.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- c3b783f: Clarify in the published `QueryStream` documentation that stream querying remains experimental in stable releases, and consistently label its exports as experimental.
|
|
34
|
+
|
|
35
|
+
## 10.0.0
|
|
36
|
+
|
|
37
|
+
### Major Changes
|
|
38
|
+
|
|
39
|
+
- c05ae0b: Migrate Confect to Effect 4, add middleware, experimental composable query streams, Foldkit bindings, and Convex AI gateway integrations. This release requires changes to function argument declarations, HTTP routers, runner calls, and test setup when upgrading from v9.
|
|
40
|
+
|
|
41
|
+
### Requirements
|
|
42
|
+
- All Confect packages require Node.js 24 or later and `effect ^4.0.0`.
|
|
43
|
+
- `@confect/server` requires `convex ^1.45.0`.
|
|
44
|
+
- `@confect/server`'s optional `@effect/platform-node` peer requires `^4.0.0` for Node actions.
|
|
45
|
+
- The new `@confect/foldkit` package requires `foldkit ^0.165.0`.
|
|
46
|
+
|
|
47
|
+
Confect no longer depends on `@effect/platform` or `@effect/cli`. Run `confect codegen` to regenerate the v10 bindings after updating your Confect declarations.
|
|
48
|
+
|
|
49
|
+
### Breaking changes
|
|
50
|
+
|
|
51
|
+
#### Declare function arguments as lazy field maps
|
|
52
|
+
|
|
53
|
+
Pass a callback returning the fields of an argument object, rather than a callback returning `Schema.Struct`. This applies to queries, mutations, actions, and paginated queries. You can omit `args` when a function takes no arguments; Confect supplies an empty object. Keep `returns`, `item`, and `error` as callbacks returning schemas.
|
|
54
|
+
|
|
55
|
+
**Before:**
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { FunctionSpec } from "@confect/core";
|
|
59
|
+
import * as Schema from "effect/Schema";
|
|
60
|
+
|
|
61
|
+
FunctionSpec.publicQuery({
|
|
62
|
+
name: "greet",
|
|
63
|
+
args: () => Schema.Struct({ name: Schema.String }),
|
|
64
|
+
returns: () => Schema.String,
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**After:**
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { FunctionSpec } from "@confect/core";
|
|
72
|
+
import * as Schema from "effect/Schema";
|
|
73
|
+
|
|
74
|
+
FunctionSpec.publicQuery({
|
|
75
|
+
name: "greet",
|
|
76
|
+
args: () => ({ name: Schema.String }),
|
|
77
|
+
returns: () => Schema.String,
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### Keep table declarations client-safe
|
|
82
|
+
|
|
83
|
+
Import `Table` from `@confect/core` in your table declarations. Specs can then return a generated table's `Doc` without pulling server code into the client. `confect codegen` rejects value imports of `@confect/server` anywhere reachable from a spec, including table and generated modules. Type-only imports remain allowed.
|
|
84
|
+
|
|
85
|
+
**Before:**
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import { Table } from "@confect/server";
|
|
89
|
+
import * as Schema from "effect/Schema";
|
|
90
|
+
|
|
91
|
+
export default Table.make(() => Schema.Struct({ text: Schema.String }));
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**After:**
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import { Table } from "@confect/core";
|
|
98
|
+
import * as Schema from "effect/Schema";
|
|
99
|
+
|
|
100
|
+
export default Table.make(() => Schema.Struct({ text: Schema.String }));
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Table declarations still return a schema, not the field maps now used by function arguments. The server's `Table` re-exports remain available for server-only use. Run `confect codegen` to regenerate the deploy schema and client-safe table bindings.
|
|
104
|
+
|
|
105
|
+
#### Use serializable schemas and handle updated errors
|
|
106
|
+
|
|
107
|
+
Confect function schemas must encode to Convex values. Use a serializable codec such as `Schema.OptionFromNullOr(...)` for an `Option` crossing that boundary: `Schema.Option` no longer provides the serialized representation expected there.
|
|
108
|
+
|
|
109
|
+
Table schemas support object-shaped transformations, encoded-key mappings, brands, suspended schemas, and unions of those schemas while retaining Convex system fields. Every step must remain object-shaped; class schemas such as `Schema.Class` are not valid table schemas.
|
|
110
|
+
|
|
111
|
+
Decode failures now use `Schema.SchemaError` instead of `ParseError`, including JavaScript clients, React hooks, and test helpers. React `useMutation` and `useAction` calls with declared errors return Effect `Result` values instead of `Either` values. Update matching and error annotations accordingly.
|
|
112
|
+
|
|
113
|
+
#### Replace HTTP API mounts with route layers
|
|
114
|
+
|
|
115
|
+
Replace Confect's `HttpApi.make` with `HttpRouter.make`. The old record of path prefixes and `apiLive`, `middleware`, and `scalar` options is replaced by one layer registering all routes. Build API routes with Effect's `HttpApiBuilder.layer`, provide each group's handlers, and add Scalar documentation explicitly.
|
|
116
|
+
|
|
117
|
+
For an API named `Api` and its group handler layer `ApiLive`:
|
|
118
|
+
|
|
119
|
+
**Before:**
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
import { HttpApi as ConfectHttpApi } from "@confect/server";
|
|
123
|
+
import * as HttpApiBuilder from "@effect/platform/HttpApiBuilder";
|
|
124
|
+
import * as Layer from "effect/Layer";
|
|
125
|
+
|
|
126
|
+
export default ConfectHttpApi.make({
|
|
127
|
+
"/api/": {
|
|
128
|
+
apiLive: HttpApiBuilder.api(Api).pipe(Layer.provide(ApiLive)),
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**After:**
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
import { HttpRouter as ConfectHttpRouter } from "@confect/server";
|
|
137
|
+
import * as Layer from "effect/Layer";
|
|
138
|
+
import * as HttpApiBuilder from "effect/http-api/HttpApiBuilder";
|
|
139
|
+
import * as HttpApiScalar from "effect/http-api/HttpApiScalar";
|
|
140
|
+
|
|
141
|
+
export default ConfectHttpRouter.make(
|
|
142
|
+
Layer.mergeAll(
|
|
143
|
+
HttpApiBuilder.layer(Api).pipe(Layer.provide(ApiLive)),
|
|
144
|
+
HttpApiScalar.layer(Api, { path: "/api/docs" }),
|
|
145
|
+
),
|
|
146
|
+
);
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Put the endpoint prefix on the Effect API itself, for example with `.prefix("/api")`. For interactive documentation, configure Scalar's `baseServerURL` with your deployment's site URL. Missing API handler groups are compile-time errors. You can merge plain routes from `effect/http/HttpRouter.add` and global middleware from `HttpRouter.middleware` into the same layer.
|
|
150
|
+
|
|
151
|
+
The returned Convex router serves Effect routes through a catch-all at `/`; plain Convex routes added to it still take precedence. Route-layer construction, handlers, and middleware can read Convex environment variables through Confect's configuration provider.
|
|
152
|
+
|
|
153
|
+
#### Call named runner methods
|
|
154
|
+
|
|
155
|
+
`QueryRunner`, `MutationRunner`, and `ActionRunner` are no longer callable services. Destructure `runQuery`, `runMutation`, or `runAction` instead.
|
|
156
|
+
|
|
157
|
+
**Before:**
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import * as Effect from "effect/Effect";
|
|
161
|
+
|
|
162
|
+
const firstNote = Effect.gen(function* () {
|
|
163
|
+
const runQuery = yield* QueryRunner;
|
|
164
|
+
return yield* runQuery(refs.public.notes.getFirst, {});
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**After:**
|
|
169
|
+
|
|
170
|
+
```ts
|
|
171
|
+
import * as Effect from "effect/Effect";
|
|
172
|
+
|
|
173
|
+
const firstNote = Effect.gen(function* () {
|
|
174
|
+
const { runQuery } = yield* QueryRunner;
|
|
175
|
+
return yield* runQuery(refs.public.notes.getFirst, {});
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Runner availability is unchanged. Inside queries or mutations, `runQuery` also accepts a third argument such as `{ transactionLimits: { documentsRead: 100 } }`. Inside mutations, `runMutation` accepts limits such as `{ transactionLimits: { documentsWritten: 10 } }`, and `runQuery` can request `useStaleSnapshot`. Supplying `useStaleSnapshot` requires a mutation context even when it is `false`. Actions and HTTP handlers use runners without transaction options; `runAction` has no options argument.
|
|
180
|
+
|
|
181
|
+
#### Yield upload URL generation directly
|
|
182
|
+
|
|
183
|
+
`StorageWriter.generateUploadUrl` is an Effect value instead of a zero-argument function.
|
|
184
|
+
|
|
185
|
+
**Before:**
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
import * as Effect from "effect/Effect";
|
|
189
|
+
|
|
190
|
+
const uploadUrl = Effect.gen(function* () {
|
|
191
|
+
const storage = yield* StorageWriter;
|
|
192
|
+
return yield* storage.generateUploadUrl();
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**After:**
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
import * as Effect from "effect/Effect";
|
|
200
|
+
|
|
201
|
+
const uploadUrl = Effect.gen(function* () {
|
|
202
|
+
const storage = yield* StorageWriter;
|
|
203
|
+
return yield* storage.generateUploadUrl;
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Methods that take arguments, such as `delete(storageId)`, remain functions.
|
|
208
|
+
|
|
209
|
+
#### Provide test layers without an extra call
|
|
210
|
+
|
|
211
|
+
`TestConfect.layer(schema, convexSchema, modules)` now returns a layer directly instead of a function returning that layer. For a project that exports the result as `TestConfect.layer`:
|
|
212
|
+
|
|
213
|
+
**Before:**
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
const test = testEffect.pipe(Effect.provide(TestConfect.layer()));
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**After:**
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
const test = testEffect.pipe(Effect.provide(TestConfect.layer));
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Each separate provision still creates a fresh test database.
|
|
226
|
+
|
|
227
|
+
#### Update handwritten container annotations
|
|
228
|
+
|
|
229
|
+
Read assembled groups with `Spec.groups(spec)` instead of `spec.groups`, and tables with `DatabaseSchema.tables(schema)` instead of `schema.tables`. Explicit `Spec.Spec`, `DatabaseSchema.DatabaseSchema`, and `DataModel.DataModel` annotations now take a record keyed by name rather than a union of members.
|
|
230
|
+
|
|
231
|
+
**Before:**
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
type AppSpec = Spec.Spec<typeof notesGroup>;
|
|
235
|
+
type AppSchema = DatabaseSchema.DatabaseSchema<typeof notesTable>;
|
|
236
|
+
type AppDataModel = DataModel.DataModel<typeof notesTable>;
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**After:**
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
type AppSpec = Spec.Spec<{ readonly notes: typeof notesGroup }>;
|
|
243
|
+
type AppSchema = DatabaseSchema.DatabaseSchema<{
|
|
244
|
+
readonly notes: typeof notesTable;
|
|
245
|
+
}>;
|
|
246
|
+
type AppDataModel = DataModel.DataModel<{
|
|
247
|
+
readonly notes: typeof notesTable;
|
|
248
|
+
}>;
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Ordinary builder calls are unchanged, and `DataModel.FromTables` still accepts a table union. Adding a group under an existing name replaces both its value and its inferred type. Run `confect codegen` rather than editing generated annotations.
|
|
252
|
+
|
|
253
|
+
#### Review configuration and time-dependent queries
|
|
254
|
+
|
|
255
|
+
Confect's configuration provider now treats empty-string environment variables as missing values, so `Config.withDefault` and `Config.option` recover from them.
|
|
256
|
+
|
|
257
|
+
Raw `Date.now()` calls in queries now observe time and invalidate Convex's query cache instead of returning v9's globally stubbed value. Explicit Effect clock reads such as `Clock.currentTimeMillis` and `Clock.currentTimeNanos` continue to opt into time tracking. Effect's internal timestamps for logging and tracing do not invalidate the cache.
|
|
258
|
+
|
|
259
|
+
### Middleware with typed services and errors
|
|
260
|
+
|
|
261
|
+
Add reusable policies in `confect/middleware/`, with a client-safe `<Name>.spec.ts` and a server-side `<Name>.impl.ts`. This directory is reserved and can no longer contain ordinary function groups.
|
|
262
|
+
|
|
263
|
+
Declare a policy with `MiddlewareSpec.MiddlewareSpec`, including its provided services, error schema, and explicit query/mutation/action coverage. Attach it with `.middleware(Policy)` on a group or individual function, or declare an `options` schema and use `.middleware(Policy, options)`. Options are validated without coercion and must be client-safe because generated refs carry them.
|
|
264
|
+
|
|
265
|
+
Implement policies with `MiddlewareImpl.make`, `MiddlewareImpl.makeByFunctionType`, or `MiddlewareImpl.provides`, then supply the implementation to the group layer. Callbacks receive `{ invocation }`, plus `options` when declared. Policies run after argument decoding, with group policies before function policies, and can supply services to later policies and handlers. Typed policy failures reach clients alongside function errors and short-circuit the remaining chain.
|
|
266
|
+
|
|
267
|
+
The same policy can run more than once with different options; equivalent attachments are rejected. Coverage and service dependencies are checked, missing implementations fail codegen, middleware does not propagate to subgroups, and plain Convex functions cannot have Confect middleware attached.
|
|
268
|
+
|
|
269
|
+
### Experimental composable query streams
|
|
270
|
+
|
|
271
|
+
Use `reader.table(...).stream(index, range?, order?)` and `QueryStream` from `@confect/server` to merge, filter, map, join, deduplicate, narrow, and reverse indexed queries while retaining cursor pagination. Ordering compatibility is checked, joins can provide left-join placeholders, effectful filters and maps support ordered concurrency, and reversing a distinct stream preserves its selected representatives.
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
import { QueryStream } from "@confect/server";
|
|
275
|
+
import * as Effect from "effect/Effect";
|
|
276
|
+
|
|
277
|
+
const firstPage = Effect.gen(function* () {
|
|
278
|
+
const reader = yield* DatabaseReader;
|
|
279
|
+
const stream = reader.table("notes").stream("by_creation_time");
|
|
280
|
+
return yield* QueryStream.paginate(stream, {
|
|
281
|
+
cursor: null,
|
|
282
|
+
numItems: 20,
|
|
283
|
+
maximumRowsRead: 1000,
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Read budgets count underlying reads, including documents filtered out of the result; byte budgets are estimates. Invalid page sizes and read limits are rejected before reads. If a budget prevents safe progress or splitting, pagination fails rather than skipping results. Increase the budget or reduce the query's read requirements.
|
|
289
|
+
|
|
290
|
+
Use React's new `useStreamPaginatedQuery` for stream-backed paginated queries. It pins loaded page ranges, handles page splits, and restarts on invalid cursors. Foldkit pagination also preserves page ranges during navigation. Ordinary paginated queries and `usePaginatedQuery` remain available.
|
|
291
|
+
|
|
292
|
+
All `QueryStream` APIs are experimental. Treat cursors as opaque continuation values, but do not treat them as confidential: they expose order-key values. Avoid public pagination over sensitive indexed fields unless those fields are fixed with `eq`.
|
|
293
|
+
|
|
294
|
+
### Foldkit client bindings
|
|
295
|
+
|
|
296
|
+
Add `@confect/foldkit` for Foldkit applications. `Client.layer` provides the scoped client; `Command.query`, `Command.mutation`, and `Command.action` turn Confect calls into commands with declared messages and required success/error handlers. The factories support Foldkit interruption, and the corresponding `queryEffect`, `mutationEffect`, and `actionEffect` helpers support handwritten command definitions.
|
|
297
|
+
|
|
298
|
+
`Subscription.reactiveQuery` follows optional arguments derived from your model and manages the live query subscription. `PaginatedQuery` and `Subscription.paginatedQuery` provide reactive next/previous-page navigation, preserve the last complete page while refreshing, ignore superseded settlements, and recover from invalid cursors. Failed refreshes retain stale data, and typed function errors remain available to your message handlers.
|
|
299
|
+
|
|
300
|
+
### Convex AI gateway models
|
|
301
|
+
|
|
302
|
+
Use `AiGatewayLanguageClient` and `AiGatewayLanguageModel` to call language models through the Convex AI gateway from actions without supplying provider API keys. Use `AiGatewayDecisionClient` and `AiGatewayDecisionModel` with Effect's `DecisionModel` to classify inputs, apply rubrics, and estimate probabilities.
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
import {
|
|
306
|
+
AiGatewayLanguageClient,
|
|
307
|
+
AiGatewayLanguageModel,
|
|
308
|
+
} from "@confect/server";
|
|
309
|
+
import * as Layer from "effect/Layer";
|
|
310
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
311
|
+
|
|
312
|
+
const Claude = AiGatewayLanguageModel.model(
|
|
313
|
+
"anthropic/claude-sonnet-4.5",
|
|
314
|
+
).pipe(
|
|
315
|
+
Layer.provide(AiGatewayLanguageClient.layer),
|
|
316
|
+
Layer.provide(FetchHttpClient.layer),
|
|
317
|
+
);
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Provide the model to Effect AI operations from `effect/ai`. Disabled or unavailable gateways report typed errors during client construction. Both gateway clients obtain current service credentials before each request, including when reused in long-running actions.
|
|
321
|
+
|
|
322
|
+
### Storage, metadata, logging, and authentication
|
|
323
|
+
- Use the unified generated `Storage` service for download URLs, upload URLs, deletion, blob reads, and blob writes. Each operation retains its context restrictions; the existing storage services remain supported.
|
|
324
|
+
- Cancel scheduled functions with `Scheduler.cancel(id)`, using the ID returned by `runAfter` or `runAt`.
|
|
325
|
+
- Read function and deployment information with `ExecutionMetadata`, request information with `RequestMetadata`, and transaction metrics with `TransactionMetadata`. Generated services expose them only in the contexts that support each capability.
|
|
326
|
+
- `Effect.log*` output uses matching Convex severities in functions and HTTP routes while preserving Effect metadata and custom loggers. `ConvexLogger` is available for explicit configuration, and logs remain associated with the current invocation when Node actions reuse a process.
|
|
327
|
+
- JavaScript `WebSocketClient` and Foldkit `Client` authentication callbacks can require Effect services. Supply them when running `setAuth` and keep scoped dependencies alive while authentication is registered; later token refreshes use the supplied services.
|
|
328
|
+
- JavaScript clients support per-module imports such as `@confect/js/WebSocketClient` and `@confect/js/HttpClient`; root imports are unchanged.
|
|
329
|
+
|
|
330
|
+
### Fixes and diagnostics
|
|
331
|
+
- Preserve precise function error types when `exactOptionalPropertyTypes` is disabled, rather than widening functions without declared errors to `any`.
|
|
332
|
+
- Exclude `_id` and `_creationTime` from patch value types derived from full documents.
|
|
333
|
+
- Preserve `ConvexError.data` when a handler throws a `ConvexError` inside an Effect.
|
|
334
|
+
- Reject non-finite values in Confect's schemas for system timestamps, stored file sizes, and pagination options. User-authored `Schema.Number` fields can still represent Convex's non-finite numbers.
|
|
335
|
+
- Keep queries, mutations, and module initialization compatible with Convex's timer restrictions during long Effect computations.
|
|
336
|
+
- Fail codegen with a descriptive error for malformed `convex.json` instead of silently ignoring it.
|
|
337
|
+
- Add tracing spans for client calls, server functions, database writes and pagination, stream consumers, and code-generation passes.
|
|
338
|
+
|
|
339
|
+
## 10.0.0-next.27
|
|
340
|
+
|
|
341
|
+
### Minor Changes
|
|
342
|
+
|
|
343
|
+
- 6424f03: Require stable `effect@^4.0.0` and matching Effect platform and AI provider packages. `@confect/foldkit` now requires `foldkit@^0.165.0`, which supports Effect 4.0.0 without a peer-dependency override.
|
|
344
|
+
|
|
345
|
+
## 10.0.0-next.26
|
|
346
|
+
|
|
347
|
+
### Major Changes
|
|
348
|
+
|
|
349
|
+
- 84acb99: Add nested transaction controls to runner methods and replace callable runner services with objects exposing named methods.
|
|
350
|
+
|
|
351
|
+
### Breaking Changes
|
|
352
|
+
- `QueryRunner`, `MutationRunner`, and `ActionRunner` are no longer callable. Use their `runQuery`, `runMutation`, and `runAction` methods instead.
|
|
353
|
+
|
|
354
|
+
To migrate, destructure the named method from the service. Apply the same change to mutation and action runners; their availability in handlers is unchanged.
|
|
355
|
+
|
|
356
|
+
**Before:**
|
|
357
|
+
|
|
358
|
+
```ts
|
|
359
|
+
const firstNote = Effect.gen(function* () {
|
|
360
|
+
const runQuery = yield* QueryRunner;
|
|
361
|
+
return yield* runQuery(refs.public.notes.getFirst, {});
|
|
362
|
+
});
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
**After:**
|
|
366
|
+
|
|
367
|
+
```ts
|
|
368
|
+
const firstNote = Effect.gen(function* () {
|
|
369
|
+
const { runQuery } = yield* QueryRunner;
|
|
370
|
+
return yield* runQuery(refs.public.notes.getFirst, {});
|
|
371
|
+
});
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
Pass `{ transactionLimits: { documentsRead: 100 } }` as the third argument to `runQuery` in queries or mutations. For `runMutation`, pass `{ transactionLimits: { documentsWritten: 10 } }` inside mutations. `runQuery` also accepts `useStaleSnapshot` inside mutations; supplying it requires a mutation context even when its value is `false`. `runAction` has no options parameter, and action and HTTP handlers continue using runners without transaction options.
|
|
375
|
+
|
|
376
|
+
- 16aacfe: Rename `AiGatewayClient` to `AiGatewayLanguageClient` to distinguish language-model requests from `AiGatewayDecisionClient` requests.
|
|
377
|
+
|
|
378
|
+
To migrate, replace `AiGatewayClient` with `AiGatewayLanguageClient` in imports and references, including the `@confect/server/AiGatewayClient` subpath.
|
|
379
|
+
|
|
380
|
+
**Before:**
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
import { AiGatewayClient } from "@confect/server";
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**After:**
|
|
387
|
+
|
|
388
|
+
```ts
|
|
389
|
+
import { AiGatewayLanguageClient } from "@confect/server";
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Minor Changes
|
|
393
|
+
|
|
394
|
+
- 2cb72ec: Add a unified `Storage` service, available from generated services, for retrieving download URLs, generating upload URLs, deleting files, and reading or storing blobs. Each operation retains its existing context restrictions, and the previous storage services remain available for compatibility.
|
|
395
|
+
|
|
396
|
+
```ts
|
|
397
|
+
import * as Effect from "effect/Effect";
|
|
398
|
+
import { Storage } from "./_generated/services";
|
|
399
|
+
|
|
400
|
+
const uploadUrl = Effect.gen(function* () {
|
|
401
|
+
const storage = yield* Storage;
|
|
402
|
+
return yield* storage.generateUploadUrl;
|
|
403
|
+
});
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### Patch Changes
|
|
407
|
+
|
|
408
|
+
- 9323fe2: Obtain the current Convex service token before each request made by `AiGatewayLanguageClient` or `AiGatewayDecisionClient`, so clients reused within a long-running action can use refreshed credentials.
|
|
409
|
+
|
|
410
|
+
Construction still reports disabled or unavailable gateways through the existing typed errors. Token acquisition failures on later requests use the client's HTTP/AI error channel, and the request is not sent.
|
|
411
|
+
|
|
412
|
+
## 10.0.0-next.25
|
|
413
|
+
|
|
414
|
+
### Minor Changes
|
|
415
|
+
|
|
416
|
+
- 0d85daf: Add `ExecutionMetadata`, `RequestMetadata`, and `TransactionMetadata` services for reading function and deployment metadata, request metadata, and current transaction metrics. Generated services expose each capability to the function contexts that support it, including middleware and HTTP handlers where applicable.
|
|
417
|
+
|
|
418
|
+
```ts
|
|
419
|
+
import * as Effect from "effect/Effect";
|
|
420
|
+
import {
|
|
421
|
+
ExecutionMetadata,
|
|
422
|
+
TransactionMetadata,
|
|
423
|
+
} from "./_generated/services";
|
|
424
|
+
|
|
425
|
+
const queryDetails = Effect.gen(function* () {
|
|
426
|
+
const execution = yield* ExecutionMetadata;
|
|
427
|
+
const transaction = yield* TransactionMetadata;
|
|
428
|
+
const fn = yield* execution.getFunction();
|
|
429
|
+
const metrics = yield* transaction.getMetrics();
|
|
430
|
+
|
|
431
|
+
return {
|
|
432
|
+
functionName: fn.name,
|
|
433
|
+
remainingReads: metrics.documentsRead.remaining,
|
|
434
|
+
};
|
|
435
|
+
});
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
- 8be1af3: Add `AiGatewayDecisionClient` and `AiGatewayDecisionModel` to classify input, rate it against a rubric, and estimate probabilities with Effect AI through Convex's AI gateway, without configuring a provider API key.
|
|
439
|
+
|
|
440
|
+
```ts
|
|
441
|
+
import {
|
|
442
|
+
AiGatewayDecisionClient,
|
|
443
|
+
AiGatewayDecisionModel,
|
|
444
|
+
} from "@confect/server";
|
|
445
|
+
import * as Layer from "effect/Layer";
|
|
446
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
447
|
+
|
|
448
|
+
const Jev = AiGatewayDecisionModel.model("typesafe/jev-1.13").pipe(
|
|
449
|
+
Layer.provide(AiGatewayDecisionClient.layer),
|
|
450
|
+
Layer.provide(FetchHttpClient.layer),
|
|
451
|
+
);
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
Provide `Jev` to `DecisionModel.decide` inside a Convex action to evaluate named decisions in one request.
|
|
455
|
+
|
|
456
|
+
- 4aa5154: Add a `cancel()` method to the `Scheduler` service that cancels a scheduled function using the ID returned by `runAfter()` or `runAt()`.
|
|
457
|
+
- 35845bb: Route `Effect.log*` output to matching Convex log severities in function handlers and HTTP routes, retaining Effect metadata and custom logger overrides. Add `ConvexLogger` for explicit logger configuration, and keep logs attached to the current invocation when Node actions reuse a process.
|
|
458
|
+
|
|
459
|
+
### Patch Changes
|
|
460
|
+
|
|
461
|
+
- f9958b9: Require `effect@^4.0.0-rc.118` and matching Effect platform packages. Upgrade Effect alongside Confect and replace `effect/unstable/*` imports with `effect/*`, using `effect/http-api` for HTTP API imports.
|
|
462
|
+
- 6e19a2f: Exclude `_id` and `_creationTime` from patch value types derived from full documents.
|
|
463
|
+
- 891cbcf: Reuse document decoders consistently across database reads and updates.
|
|
464
|
+
|
|
465
|
+
## 10.0.0-next.24
|
|
466
|
+
|
|
467
|
+
### Patch Changes
|
|
468
|
+
|
|
469
|
+
- 850a3c3: Require `effect@^4.0.0-rc.117` across `@confect/*` and `@effect/platform-node@^4.0.0-rc.117` for `@confect/server`'s optional Node integration. Upgrade these dependencies alongside Confect; existing Confect call sites are unchanged.
|
|
470
|
+
|
|
471
|
+
## 10.0.0-next.23
|
|
472
|
+
|
|
473
|
+
### Major Changes
|
|
474
|
+
|
|
475
|
+
- 09f9f55: Use `Spec.groups(spec)` and `DatabaseSchema.tables(schema)` to inspect assembled group and table records. Adding a group at an existing spec name now replaces its inferred type as well as its runtime value.
|
|
476
|
+
|
|
477
|
+
### Breaking Changes
|
|
478
|
+
- The `Spec.groups` and `DatabaseSchema.tables` accessors replace the corresponding instance properties.
|
|
479
|
+
- `Spec.Spec`, `DatabaseSchema.DatabaseSchema`, and `DataModel.DataModel` take a record type instead of a union of its members. The separate `~Groups` and `~Tables` phantom properties on these containers are removed; the `Groups` and `Tables` type helpers remain available.
|
|
480
|
+
|
|
481
|
+
Run `confect codegen` to update generated spec and schema annotations. Ordinary `Spec.make().add(...)`, `Spec.make().addAt(...)`, and `DatabaseSchema.make({ ... })` calls keep their existing syntax. `DataModel.FromTables` continues to accept a table union.
|
|
482
|
+
|
|
483
|
+
For handwritten annotations, use `Spec.Spec<{ readonly notes: typeof notesGroup }>` or `DatabaseSchema.DatabaseSchema<{ readonly notes: typeof notesTable }>` in place of the corresponding member-union parameter.
|
|
484
|
+
|
|
485
|
+
- e291835: Preserve ID tiebreakers through `QueryStream` joins, empty streams, and renaming, and use `keyValues` for bounds and annotated elements. `QueryStream.merge` and `QueryStream.flatMap` reject incompatible orderings, including inner streams produced on later rows or later runs. Reused and narrowed streams preserve their index constraints, and `QueryStream.narrow` rejects bounds wider than the stream's ordering key before executing a query.
|
|
486
|
+
|
|
487
|
+
Ordering mismatch errors expose `expectedKeyLayout`, `actualKeyLayout`, `expectedOrderDirection`, and `actualOrderDirection`, as applicable.
|
|
488
|
+
|
|
489
|
+
### Breaking Changes
|
|
490
|
+
- `QueryStream.narrow` endpoints and annotated elements replace `key` with `keyValues`.
|
|
491
|
+
- `QueryStream.empty` accepts a compatible stream's `keyLayout` instead of field names.
|
|
492
|
+
- `QueryStream.flatMap` replaces `innerKey` with `innerKeyLayout`.
|
|
493
|
+
- A query stream's `order` property is renamed to `orderDirection`.
|
|
494
|
+
- Explicit `QueryStream` type annotations require branded ordering labels instead of plain label tuples. Inferred stream types need no changes.
|
|
495
|
+
- `QueryStream.paginate` uses a new cursor format. Restart pagination with `cursor: null` after upgrading; continuation cursors from earlier prereleases are no longer accepted.
|
|
496
|
+
|
|
497
|
+
To migrate from the previous prerelease, replace `key` with `keyValues` in each `start` and `end` endpoint and when constructing or reading annotated elements.
|
|
498
|
+
|
|
499
|
+
**Before:**
|
|
500
|
+
|
|
501
|
+
```ts
|
|
502
|
+
QueryStream.narrow(stream, {
|
|
503
|
+
start: { key: [startTime], inclusive: true },
|
|
504
|
+
end: { key: [endTime], inclusive: false },
|
|
505
|
+
});
|
|
506
|
+
const element = { doc, key };
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
**After:**
|
|
510
|
+
|
|
511
|
+
```ts
|
|
512
|
+
QueryStream.narrow(stream, {
|
|
513
|
+
start: { keyValues: [startTime], inclusive: true },
|
|
514
|
+
end: { keyValues: [endTime], inclusive: false },
|
|
515
|
+
});
|
|
516
|
+
const element = { doc, keyValues: key };
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
For empty streams and joins, reuse the `keyLayout` of a stream with the required ordering. Creating a stream does not read documents. `QueryStream.distinct` and `QueryStream.renameKey` continue to accept label tuples directly.
|
|
520
|
+
|
|
521
|
+
**Before:**
|
|
522
|
+
|
|
523
|
+
```ts
|
|
524
|
+
QueryStream.empty<NotesDoc>()(["_creationTime"]);
|
|
525
|
+
QueryStream.flatMap(notes, commentsOn, { innerKey: ["_creationTime"] });
|
|
526
|
+
notes.order;
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
**After:**
|
|
530
|
+
|
|
531
|
+
```ts
|
|
532
|
+
import { QueryStream } from "@confect/server";
|
|
533
|
+
|
|
534
|
+
const byTime = reader.table("notes").stream("by_creation_time");
|
|
535
|
+
QueryStream.empty<NotesDoc>()(byTime.keyLayout);
|
|
536
|
+
|
|
537
|
+
const commentsByTime = reader.table("comments").stream("by_creation_time");
|
|
538
|
+
QueryStream.flatMap(notes, commentsOn, {
|
|
539
|
+
innerKeyLayout: commentsByTime.keyLayout,
|
|
540
|
+
});
|
|
541
|
+
notes.orderDirection;
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
Prefer deriving stream type aliases from an inferred stream, such as `type NoteStream = typeof byTime`, rather than spelling out the ordering-label type parameter.
|
|
545
|
+
|
|
546
|
+
### Patch Changes
|
|
547
|
+
|
|
548
|
+
- 7db812a: Reject negative, fractional, or non-finite `numItems` in `QueryStream.paginate` before reading documents.
|
|
549
|
+
- 6798e79: Reject negative, fractional, or non-finite read limits in `QueryStream.paginate` before reading documents.
|
|
550
|
+
|
|
551
|
+
## 10.0.0-next.22
|
|
552
|
+
|
|
553
|
+
### Major Changes
|
|
554
|
+
|
|
555
|
+
- 9dbe49e: Move `QueryStream`'s `Direction` type parameter from fifth to third. Update explicit type annotations to place the direction before the error and service requirements; inferred types and runtime behavior are unchanged.
|
|
556
|
+
|
|
557
|
+
**Before:**
|
|
558
|
+
|
|
559
|
+
```ts
|
|
560
|
+
QueryStream<Doc, Key, Error, Requirements, Direction>;
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
**After:**
|
|
564
|
+
|
|
565
|
+
```ts
|
|
566
|
+
QueryStream<Doc, Key, Direction, Error, Requirements>;
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
If an annotation previously omitted `Direction` but specified an error or requirements, insert `QueryStreamOrderDirection.QueryStreamOrderDirection` as the third argument to continue accepting either direction.
|
|
570
|
+
|
|
571
|
+
- 6cc5834: Add experimental stream querying with reactive pagination, configurable middleware policies, and broader tracing.
|
|
572
|
+
|
|
573
|
+
### Stream queries and pagination
|
|
574
|
+
|
|
575
|
+
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.
|
|
576
|
+
|
|
577
|
+
`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.
|
|
578
|
+
|
|
579
|
+
Use React's new `useStreamPaginatedQuery` for these queries:
|
|
580
|
+
|
|
581
|
+
```ts
|
|
582
|
+
import { useStreamPaginatedQuery } from "@confect/react";
|
|
583
|
+
|
|
584
|
+
const { results, status, loadMore } = useStreamPaginatedQuery(
|
|
585
|
+
refs.public.notes.feed,
|
|
586
|
+
{},
|
|
587
|
+
{
|
|
588
|
+
initialNumItems: 10,
|
|
589
|
+
maximumRowsRead: 1000,
|
|
590
|
+
maximumBytesRead: 512 * 1024,
|
|
591
|
+
},
|
|
592
|
+
);
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
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.
|
|
596
|
+
|
|
597
|
+
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.
|
|
598
|
+
|
|
599
|
+
### Middleware options
|
|
600
|
+
|
|
601
|
+
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.
|
|
602
|
+
|
|
603
|
+
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.
|
|
604
|
+
|
|
605
|
+
### Breaking changes
|
|
606
|
+
|
|
607
|
+
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`:
|
|
608
|
+
|
|
609
|
+
**Before:**
|
|
610
|
+
|
|
611
|
+
```ts
|
|
612
|
+
(effect, { name, args }) => effect;
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
**After:**
|
|
616
|
+
|
|
617
|
+
```ts
|
|
618
|
+
(effect, { invocation: { name, args } }) => effect;
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
Middleware with an options schema also receives `options` alongside `invocation`; middleware without one keeps its single-argument attachment API and receives only `{ invocation }`.
|
|
622
|
+
|
|
623
|
+
### Fixes and tracing
|
|
624
|
+
- Preserve `ConvexError.data` when a handler throws a `ConvexError` inside an Effect instead of returning it as a typed failure.
|
|
625
|
+
- 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.
|
|
626
|
+
|
|
627
|
+
### Patch Changes
|
|
628
|
+
|
|
629
|
+
- 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.
|
|
630
|
+
|
|
631
|
+
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.
|
|
632
|
+
|
|
633
|
+
- 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.
|
|
634
|
+
- f721d2c: Remove spaces around em dashes and separator slashes in API documentation and `confect codegen` diagnostics.
|
|
635
|
+
|
|
636
|
+
## 10.0.0-next.21
|
|
637
|
+
|
|
638
|
+
### Major Changes
|
|
639
|
+
|
|
640
|
+
- a6425c5: Raise the minimum supported Node.js version to 24.
|
|
641
|
+
|
|
642
|
+
### Breaking Changes
|
|
643
|
+
- `engines.node` is now `>=24` on every `@confect/*` package, raised from `>=22`.
|
|
644
|
+
|
|
645
|
+
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.
|
|
646
|
+
|
|
647
|
+
### Patch Changes
|
|
648
|
+
|
|
649
|
+
- d5bc6aa: Fix `patch` rejecting `undefined` for optional fields under `exactOptionalPropertyTypes`.
|
|
650
|
+
|
|
651
|
+
Setting an optional field to `undefined` unsets it, but `writer.table("notes").patch(noteId, { tag: undefined })` was a type error in projects with `exactOptionalPropertyTypes` enabled. Optional fields now accept `undefined`; required fields still don't, since unsetting one would leave a document the table's schema rejects.
|
|
652
|
+
|
|
653
|
+
## 10.0.0-next.20
|
|
654
|
+
|
|
655
|
+
### Minor Changes
|
|
656
|
+
|
|
657
|
+
- 0dc4816: Add `AiGatewayClient` and `AiGatewayLanguageModel`, an Effect AI `LanguageModel` provider for calling models through the Convex AI gateway from actions without configuring provider API keys.
|
|
658
|
+
|
|
659
|
+
```ts
|
|
660
|
+
import { AiGatewayClient, AiGatewayLanguageModel } from "@confect/server";
|
|
661
|
+
import * as Layer from "effect/Layer";
|
|
662
|
+
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
663
|
+
|
|
664
|
+
const Claude = AiGatewayLanguageModel.model(
|
|
665
|
+
"anthropic/claude-sonnet-4.5",
|
|
666
|
+
).pipe(
|
|
667
|
+
Layer.provide(AiGatewayClient.layer),
|
|
668
|
+
Layer.provide(FetchHttpClient.layer),
|
|
669
|
+
);
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
`@confect/server` now requires `convex ^1.45.0` for AI gateway service-token support.
|
|
673
|
+
|
|
674
|
+
## 10.0.0-next.19
|
|
675
|
+
|
|
676
|
+
## 10.0.0-next.18
|
|
677
|
+
|
|
678
|
+
### Minor Changes
|
|
679
|
+
|
|
680
|
+
- 91aebe4: Move `Table.make` to `@confect/core` so a spec that returns `notes.Doc` from `_generated/tables/notes` no longer ships `@confect/server` to the client.
|
|
681
|
+
|
|
682
|
+
```ts confect/tables/notes.ts
|
|
683
|
+
import { Table } from "@confect/core";
|
|
684
|
+
import * as Schema from "effect/Schema";
|
|
685
|
+
|
|
686
|
+
export default Table.make(() =>
|
|
687
|
+
Schema.Struct({
|
|
688
|
+
text: Schema.String,
|
|
689
|
+
}),
|
|
690
|
+
);
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
`confect codegen` now fails if any module a spec reaches value-imports `@confect/server`, including `confect/tables/` and `_generated/`. Type-only imports remain allowed.
|
|
694
|
+
|
|
695
|
+
## 10.0.0-next.17
|
|
696
|
+
|
|
697
|
+
### Minor Changes
|
|
698
|
+
|
|
699
|
+
- 126548a: Add middleware: reusable logic that runs around a group's function handlers, provides Effect services to them, and fails with typed errors that reach clients.
|
|
700
|
+
|
|
701
|
+
Middleware lives in a reserved `confect/middleware/` directory, one `<Name>.spec.ts`/`<Name>.impl.ts` pair per middleware. Confect no longer scans that directory for function groups, so a group can no longer be defined at `confect/middleware/...`.
|
|
702
|
+
|
|
703
|
+
Declare a middleware's client-safe interface with `MiddlewareSpec.MiddlewareSpec`—its `provides` service (type-level), its `error` schema, and the function types it may cover (`functionTypes`, one required boolean flag per function type, so every spec states its coverage outright)—and attach it in a group spec with `GroupSpec.middleware`:
|
|
704
|
+
|
|
705
|
+
```ts confect/middleware/RequireUser.spec.ts
|
|
706
|
+
import { MiddlewareSpec } from "@confect/core";
|
|
707
|
+
|
|
708
|
+
export class CurrentUser extends Context.Service<
|
|
709
|
+
CurrentUser,
|
|
710
|
+
{
|
|
711
|
+
readonly user: User;
|
|
712
|
+
}
|
|
713
|
+
>()("confect/middleware/RequireUser.spec/CurrentUser") {}
|
|
714
|
+
|
|
715
|
+
export class NotSignedIn extends Schema.TaggedError<NotSignedIn>()(
|
|
716
|
+
"NotSignedIn",
|
|
717
|
+
{},
|
|
718
|
+
) {}
|
|
719
|
+
|
|
720
|
+
export default class RequireUser extends MiddlewareSpec.MiddlewareSpec<
|
|
721
|
+
RequireUser,
|
|
722
|
+
{
|
|
723
|
+
provides: CurrentUser;
|
|
724
|
+
}
|
|
725
|
+
>()("RequireUser", {
|
|
726
|
+
error: () => NotSignedIn,
|
|
727
|
+
functionTypes: { query: true, mutation: true, action: false },
|
|
728
|
+
}) {}
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
```ts confect/notes.spec.ts
|
|
732
|
+
import RequireUser from "./middleware/RequireUser.spec";
|
|
733
|
+
|
|
734
|
+
export default GroupSpec.make()
|
|
735
|
+
.middleware(RequireUser)
|
|
736
|
+
.addFunction(FunctionSpec.publicMutation({ ... }));
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
Handlers of covered functions can then consume the provided service—a handler requiring `CurrentUser` type-checks exactly when a middleware providing it is attached to the group. Implement the middleware server-side with `MiddlewareImpl.make` (one strategy for all declared function types), `MiddlewareImpl.makeByFunctionType` (one per function type—the recommended shape for database-touching middleware that also covers actions), or the `MiddlewareImpl.provides` shorthand, and provide it to the group's impl layer like any function implementation:
|
|
740
|
+
|
|
741
|
+
```ts confect/middleware/RequireUser.impl.ts
|
|
742
|
+
import { MiddlewareImpl } from "@confect/server";
|
|
743
|
+
|
|
744
|
+
export default MiddlewareImpl.provides(
|
|
745
|
+
databaseSchema,
|
|
746
|
+
RequireUser,
|
|
747
|
+
CurrentUser,
|
|
748
|
+
Effect.gen(function* () {
|
|
749
|
+
// load the user; `return yield* new NotSignedIn()` short-circuits
|
|
750
|
+
return { user };
|
|
751
|
+
}),
|
|
752
|
+
);
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
```ts confect/notes.impl.ts
|
|
756
|
+
import RequireUser from "./middleware/RequireUser.impl";
|
|
757
|
+
|
|
758
|
+
export default GroupImpl.make(databaseSchema, group).pipe(
|
|
759
|
+
Layer.provide(createNote),
|
|
760
|
+
Layer.provide(RequireUser), // omitting this is a compile error at `GroupImpl.finalize`
|
|
761
|
+
GroupImpl.finalize,
|
|
762
|
+
);
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
Middleware runs per invocation, after args are decoded and before the handler, in attachment order; a middleware failure short-circuits the rest of the chain. Its errors join the covered functions' error unions end to end: `useQuery`/`useMutation` and the `@confect/js` clients surface them as typed errors with no client-side changes.
|
|
766
|
+
|
|
767
|
+
Middleware can also attach to a single function with `.middleware()` on the function spec—it runs inside the group-attached chain, immediately around the handler, and its errors join only that function's error union:
|
|
768
|
+
|
|
769
|
+
```ts
|
|
770
|
+
FunctionSpec.publicMutation({ name: "deleteAll", ... }).middleware(RequireAdmin);
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
A middleware can depend on one that runs earlier in the chain by declaring `requires` in its `Config` type parameter—its implementation may then consume the required service (e.g. `RequireAdmin` reading the `CurrentUser` that `RequireUser` provides). Satisfaction is type-checked at `GroupSpec.middleware` for group attachments and at `GroupImpl.make` for whole groups.
|
|
774
|
+
|
|
775
|
+
Attaching the same middleware twice (including once at group level and once at function level), attaching one whose `functionTypes` don't cover a covered function's type, attaching any middleware to a plain-Convex function, or attaching to a group containing a matching-type plain-Convex function are all type errors. Middleware does not propagate to subgroups. `confect codegen` fails with an explicit error when a group's spec attaches a middleware its impl never provides.
|
|
776
|
+
|
|
777
|
+
Because every `*.spec.ts` is reachable from `_generated/refs.ts`, which clients import, a spec's whole import graph is bundled into the browser—so an implementation co-located with its declaration ships server logic (table names, index names, authorization checks) to users. `confect codegen` now fails when any module a spec reaches value-imports `@confect/server`, outside the `tables/` and `_generated/` directories that legitimately need it. Type-only imports are erased before bundling and remain allowed.
|
|
778
|
+
|
|
779
|
+
### Patch Changes
|
|
780
|
+
|
|
781
|
+
- 8e4962e: Raise the required `effect` peer version to `^4.0.0-rc.111` (from `^4.0.0-rc.110`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
|
|
782
|
+
|
|
783
|
+
No Confect API changed, and no call-site edits are needed. `rc.111` is a patch release of Effect with nothing removed or renamed, so upgrading is a matter of installing it alongside `@confect/*`.
|
|
784
|
+
|
|
785
|
+
## 10.0.0-next.16
|
|
786
|
+
|
|
787
|
+
### Major Changes
|
|
788
|
+
|
|
789
|
+
- Migrate to Effect v4. All `@confect/*` packages now require `effect@^4.0.0-beta.97`; `@effect/platform` and `@effect/cli` are no longer dependencies (their functionality moved into `effect` core and `effect/unstable/*`).
|
|
790
|
+
|
|
791
|
+
Breaking changes for users:
|
|
792
|
+
|
|
793
|
+
- **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.
|
|
794
|
+
- **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.
|
|
795
|
+
- **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.
|
|
796
|
+
- **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`).
|
|
797
|
+
- **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.
|
|
798
|
+
- **Node actions** use `effect/unstable/process` (`ChildProcessSpawner`) and `@effect/platform-node`'s `NodeServices` in place of `@effect/platform` `Command`/`NodeContext`.
|
|
799
|
+
- **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.
|
|
800
|
+
- **CLI**: a malformed `convex.json` now fails codegen with a descriptive error instead of being silently ignored.
|
|
801
|
+
- 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.
|
|
802
|
+
|
|
803
|
+
- `StorageWriter.generateUploadUrl` is now an `Effect` rather than a function returning one. Yield it directly instead of calling it.
|
|
804
|
+
|
|
805
|
+
Before:
|
|
806
|
+
|
|
807
|
+
```ts
|
|
808
|
+
Effect.gen(function* () {
|
|
809
|
+
const url = yield* storage.generateUploadUrl();
|
|
810
|
+
});
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
After:
|
|
814
|
+
|
|
815
|
+
```ts
|
|
816
|
+
Effect.gen(function* () {
|
|
817
|
+
const url = yield* storage.generateUploadUrl;
|
|
818
|
+
});
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
`StorageWriter.delete` is unchanged—it takes a storage ID, so it remains a function.
|
|
822
|
+
|
|
823
|
+
### Patch Changes
|
|
824
|
+
|
|
825
|
+
- Raise the required `effect` peer version to `^4.0.0-beta.100` (from `^4.0.0-beta.99`).
|
|
826
|
+
|
|
827
|
+
This is a peer-range-only change with no consumer-visible API consequences. The `beta.100` release only touches `Cron` internals (month/weekday alias normalization, day/weekday rollover, and equality/hashing), CLI error message formatting (`InvalidValue` prefixes), and `Schema.toTaggedUnion` discriminants that Confect doesn't use.
|
|
828
|
+
|
|
829
|
+
- Raise the required `effect` peer version to `^4.0.0-beta.101` (from `^4.0.0-beta.100`).
|
|
830
|
+
|
|
831
|
+
This is a peer-range-only change with no consumer-visible API consequences. The `beta.101` release only touches fiber/concurrency internals (interrupt handling in concurrent traversal, stack frame annotations, `awaitAllChildren` linearization, `interruptibleMask` interrupt delivery), a `MutableList.filter` fix for empty buckets, a `Schema.Struct` required-readonly-field type display simplification, and an `HttpRouter.toWebHandler` middleware type-inference tightening that Confect doesn't need to accommodate.
|
|
832
|
+
|
|
833
|
+
- 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.
|
|
834
|
+
- 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.
|
|
835
|
+
|
|
836
|
+
`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.
|
|
837
|
+
|
|
838
|
+
`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.
|
|
839
|
+
|
|
840
|
+
`beta.104` renames Effect's schema error constructors to match their `Data` counterparts, which affects any error schema you declare for a Confect function:
|
|
841
|
+
|
|
842
|
+
**Before:**
|
|
843
|
+
|
|
844
|
+
```ts
|
|
845
|
+
export class NoteNotFound extends Schema.TaggedErrorClass<NoteNotFound>()(
|
|
846
|
+
"NoteNotFound",
|
|
847
|
+
{ noteId: Id("notes") },
|
|
848
|
+
) {}
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
**After:**
|
|
852
|
+
|
|
853
|
+
```ts
|
|
854
|
+
export class NoteNotFound extends Schema.TaggedError<NoteNotFound>()(
|
|
855
|
+
"NoteNotFound",
|
|
856
|
+
{ noteId: Id("notes") },
|
|
857
|
+
) {}
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
`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.
|
|
861
|
+
|
|
862
|
+
`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.
|
|
863
|
+
|
|
864
|
+
- Raise the required `effect` peer version to `^4.0.0-beta.106` (from `^4.0.0-beta.105`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
|
|
865
|
+
|
|
866
|
+
`beta.106` is a patch-only Effect release. Nothing in Confect's own API changes, and your table, argument, and returns schemas still compile to the same Convex validators.
|
|
867
|
+
|
|
868
|
+
One Effect change needs a call-site edit if you derive property-test generators from those schemas: `Schema.toArbitrary` now returns a factory that takes the `fast-check` module instead of returning an arbitrary directly, and `Schema.toArbitraryLazy` and the `{ report: true }` option are gone.
|
|
869
|
+
|
|
870
|
+
**Before:**
|
|
871
|
+
|
|
872
|
+
```ts
|
|
873
|
+
const NoteArbitrary = Schema.toArbitrary(Note);
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
**After:**
|
|
877
|
+
|
|
878
|
+
```ts
|
|
879
|
+
import * as FastCheck from "fast-check";
|
|
880
|
+
|
|
881
|
+
const NoteArbitrary = Schema.toArbitrary(Note)(FastCheck);
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
HTTP actions written against `HttpRouter` also inherit Effect's stricter multipart handling: a request that exceeds the configured part count, part size, or field size limits now stops being parsed at the limit rather than being read to completion first.
|
|
885
|
+
|
|
886
|
+
- 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.
|
|
887
|
+
|
|
888
|
+
`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.
|
|
889
|
+
|
|
890
|
+
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.
|
|
891
|
+
|
|
892
|
+
- Raise the required `effect` peer version to `^4.0.0-beta.98` (from `^4.0.0-beta.97`).
|
|
893
|
+
|
|
894
|
+
`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.
|
|
895
|
+
|
|
896
|
+
- Raise the required `effect` peer version to `^4.0.0-beta.99` (from `^4.0.0-beta.98`).
|
|
897
|
+
|
|
898
|
+
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.
|
|
899
|
+
|
|
900
|
+
- Raise the required `effect` peer version to `^4.0.0-rc.108` (from `^4.0.0-beta.107`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise. Effect v4 has left beta for release candidates, so `effect@rc` is now the tag to install alongside `@confect/*`.
|
|
901
|
+
|
|
902
|
+
No Confect API changed, and no call-site edits are needed for Confect itself. One Effect change can reach your code: the standalone `effect/SchemaError` module is gone, and `SchemaError` is now exported from `Schema`. Confect still fails decoding with the same error, so this only matters if you name the type when handling it.
|
|
903
|
+
|
|
904
|
+
Before:
|
|
905
|
+
|
|
906
|
+
```ts
|
|
907
|
+
import type { SchemaError } from "effect/SchemaError";
|
|
908
|
+
```
|
|
909
|
+
|
|
910
|
+
After:
|
|
911
|
+
|
|
912
|
+
```ts
|
|
913
|
+
import type { SchemaError } from "effect/Schema";
|
|
914
|
+
```
|
|
915
|
+
|
|
916
|
+
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.
|
|
917
|
+
|
|
918
|
+
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.
|
|
919
|
+
|
|
920
|
+
- 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.
|
|
921
|
+
|
|
922
|
+
No Confect API changed, and no call-site edits are needed. `rc.109` is a patch release of Effect with nothing removed or renamed, so upgrading is a matter of installing it alongside `@confect/*`.
|
|
923
|
+
|
|
924
|
+
- 8e4962e: Raise the required `effect` peer version to `^4.0.0-rc.110` (from `^4.0.0-rc.109`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
|
|
925
|
+
|
|
926
|
+
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/*`.
|
|
927
|
+
|
|
928
|
+
- 3f0255c: Build and test against `convex` 1.44.0. The published `convex` peer ranges are unchanged, so no consumer action is required.
|
|
929
|
+
- The schemas Confect uses for values Convex itself produces now reject `NaN` and `±Infinity`: `_creationTime`, a scheduled function's `scheduledTime` and `completedTime`, a stored file's `size`, and the fields of `PaginationOptions`. Convex cannot return a non-finite value for any of them, so this rules out states that were never reachable.
|
|
930
|
+
|
|
931
|
+
The Convex validators these compile to are unchanged—each is still `v.float64()`—so nothing changes about what your deployment accepts. Only Confect's decoding is narrower. Your own table schemas are untouched: `Schema.Number` still accepts non-finite values wherever you use it, which matters because Convex stores them.
|
|
932
|
+
|
|
933
|
+
- Fix query and mutation handlers crashing with Convex's "Can't use setTimeout in queries and mutations" error once they performed enough Effect operations to trigger a cooperative fiber yield. Effect execution in queries and mutations now yields via the microtask queue instead of timer APIs, which Convex's isolate forbids. Actions are unchanged.
|
|
934
|
+
- Fix the remaining "Can't use setTimeout in queries and mutations" crash for apps whose function registration or schema compilation performs enough Effect operations to trigger a cooperative fiber yield. Convex evaluates a function's modules inside the same timer-restricted isolate as the handler, and Confect's module-scope Effect runs (registration layer builds and schema-to-validator compilation) could still dispatch a yield through timer APIs there. These now run with cooperative yielding disabled.
|
|
935
|
+
- Drop the `URL.canParse` polyfill that `@confect/server` installed on import in the `10.0.0-next.7` through `10.0.0-next.9` prereleases. It worked around the Convex UDF isolate's `URL` lacking the static `URL.canParse` that Effect's `Schema.URLFromString` decode relies on; the Convex runtime [now implements `URL.canParse` and `URL.parse`](https://github.com/get-convex/convex-backend/issues/510), so patching the global is no longer needed. `@confect/server`'s entry modules are side-effect-free again.
|
|
936
|
+
- Fix `StorageWriter.generateUploadUrl` and `StorageReader.getUrl` dying with `SchemaError: Expected URL, got "https://…"` on the URL strings Convex returns. Effect 4's `Schema.URL` is an `instanceof URL` check (in Effect 3 it was a string→URL transform), so the storage services now decode with `Schema.URLFromString` instead.
|
|
937
|
+
- Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.2–9.2.4—see those versions' changelog entries.
|
|
938
|
+
- Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.5—see that version's changelog entries.
|
|
939
|
+
- Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.3.0—see that version's changelog entries.
|
|
940
|
+
- Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.4.0—see that version's changelog entries.
|
|
941
|
+
|
|
942
|
+
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.
|
|
943
|
+
|
|
944
|
+
- Support Convex 1.41+, whose `runQuery`/`runMutation` on `GenericQueryCtx`/`GenericMutationCtx` gained a nested-transaction `transactionLimits` option that `GenericActionCtx`'s versions don't have. `QueryRunner.layer`/`MutationRunner.layer` were typed against the wider `GenericQueryCtx`/`GenericMutationCtx` signatures, so passing an action's `runQuery`/`runMutation` (the only way they're actually used to build an action's services) stopped typechecking against Convex 1.41+. They're now typed against `GenericActionCtx`, matching how they're actually called; no public API or behavior change.
|
|
945
|
+
- 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.
|
|
946
|
+
|
|
947
|
+
## 10.0.0-next.15
|
|
948
|
+
|
|
949
|
+
### Patch Changes
|
|
950
|
+
|
|
951
|
+
- 8e4962e: 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.
|
|
952
|
+
|
|
953
|
+
No Confect API changed, and no call-site edits are needed. `rc.109` is a patch release of Effect with nothing removed or renamed, so upgrading is a matter of installing it alongside `@confect/*`.
|
|
954
|
+
|
|
955
|
+
## 10.0.0-next.14
|
|
956
|
+
|
|
957
|
+
### Major Changes
|
|
958
|
+
|
|
959
|
+
- aede323: `StorageWriter.generateUploadUrl` is now an `Effect` rather than a function returning one. Yield it directly instead of calling it.
|
|
960
|
+
|
|
961
|
+
Before:
|
|
962
|
+
|
|
963
|
+
```ts
|
|
964
|
+
Effect.gen(function* () {
|
|
965
|
+
const url = yield* storage.generateUploadUrl();
|
|
966
|
+
});
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
After:
|
|
970
|
+
|
|
971
|
+
```ts
|
|
972
|
+
Effect.gen(function* () {
|
|
973
|
+
const url = yield* storage.generateUploadUrl;
|
|
974
|
+
});
|
|
975
|
+
```
|
|
976
|
+
|
|
977
|
+
`StorageWriter.delete` is unchanged—it takes a storage ID, so it remains a function.
|
|
978
|
+
|
|
979
|
+
### Patch Changes
|
|
980
|
+
|
|
981
|
+
- 9d51bd3: Raise the required `effect` peer version to `^4.0.0-rc.108` (from `^4.0.0-beta.107`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise. Effect v4 has left beta for release candidates, so `effect@rc` is now the tag to install alongside `@confect/*`.
|
|
982
|
+
|
|
983
|
+
No Confect API changed, and no call-site edits are needed for Confect itself. One Effect change can reach your code: the standalone `effect/SchemaError` module is gone, and `SchemaError` is now exported from `Schema`. Confect still fails decoding with the same error, so this only matters if you name the type when handling it.
|
|
984
|
+
|
|
985
|
+
Before:
|
|
986
|
+
|
|
987
|
+
```ts
|
|
988
|
+
import type { SchemaError } from "effect/SchemaError";
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
After:
|
|
992
|
+
|
|
993
|
+
```ts
|
|
994
|
+
import type { SchemaError } from "effect/Schema";
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
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.
|
|
998
|
+
|
|
999
|
+
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.
|
|
1000
|
+
|
|
1001
|
+
- aede323: The schemas Confect uses for values Convex itself produces now reject `NaN` and `±Infinity`: `_creationTime`, a scheduled function's `scheduledTime` and `completedTime`, a stored file's `size`, and the fields of `PaginationOptions`. Convex cannot return a non-finite value for any of them, so this rules out states that were never reachable.
|
|
1002
|
+
|
|
1003
|
+
The Convex validators these compile to are unchanged—each is still `v.float64()`—so nothing changes about what your deployment accepts. Only Confect's decoding is narrower. Your own table schemas are untouched: `Schema.Number` still accepts non-finite values wherever you use it, which matters because Convex stores them.
|
|
1004
|
+
|
|
1005
|
+
- 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.
|
|
1006
|
+
|
|
1007
|
+
## 10.0.0-next.13
|
|
1008
|
+
|
|
1009
|
+
### Patch Changes
|
|
1010
|
+
|
|
1011
|
+
- 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.
|
|
1012
|
+
|
|
1013
|
+
`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.
|
|
1014
|
+
|
|
1015
|
+
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.
|
|
1016
|
+
|
|
1017
|
+
## 10.0.0-next.12
|
|
1018
|
+
|
|
1019
|
+
### Patch Changes
|
|
1020
|
+
|
|
1021
|
+
- 661ee9b: Raise the required `effect` peer version to `^4.0.0-beta.106` (from `^4.0.0-beta.105`), and `@confect/server`'s optional `@effect/platform-node` peer version likewise.
|
|
1022
|
+
|
|
1023
|
+
`beta.106` is a patch-only Effect release. Nothing in Confect's own API changes, and your table, argument, and returns schemas still compile to the same Convex validators.
|
|
1024
|
+
|
|
1025
|
+
One Effect change needs a call-site edit if you derive property-test generators from those schemas: `Schema.toArbitrary` now returns a factory that takes the `fast-check` module instead of returning an arbitrary directly, and `Schema.toArbitraryLazy` and the `{ report: true }` option are gone.
|
|
1026
|
+
|
|
1027
|
+
**Before:**
|
|
1028
|
+
|
|
1029
|
+
```ts
|
|
1030
|
+
const NoteArbitrary = Schema.toArbitrary(Note);
|
|
1031
|
+
```
|
|
1032
|
+
|
|
1033
|
+
**After:**
|
|
1034
|
+
|
|
1035
|
+
```ts
|
|
1036
|
+
import * as FastCheck from "fast-check";
|
|
1037
|
+
|
|
1038
|
+
const NoteArbitrary = Schema.toArbitrary(Note)(FastCheck);
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
HTTP actions written against `HttpRouter` also inherit Effect's stricter multipart handling: a request that exceeds the configured part count, part size, or field size limits now stops being parsed at the limit rather than being read to completion first.
|
|
1042
|
+
|
|
1043
|
+
## 10.0.0-next.11
|
|
1044
|
+
|
|
1045
|
+
### Patch Changes
|
|
1046
|
+
|
|
1047
|
+
- 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.
|
|
1048
|
+
|
|
1049
|
+
`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.
|
|
1050
|
+
|
|
1051
|
+
`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.
|
|
1052
|
+
|
|
1053
|
+
`beta.104` renames Effect's schema error constructors to match their `Data` counterparts, which affects any error schema you declare for a Confect function:
|
|
1054
|
+
|
|
1055
|
+
**Before:**
|
|
1056
|
+
|
|
1057
|
+
```ts
|
|
1058
|
+
export class NoteNotFound extends Schema.TaggedErrorClass<NoteNotFound>()(
|
|
1059
|
+
"NoteNotFound",
|
|
1060
|
+
{ noteId: Id("notes") },
|
|
1061
|
+
) {}
|
|
1062
|
+
```
|
|
1063
|
+
|
|
1064
|
+
**After:**
|
|
1065
|
+
|
|
1066
|
+
```ts
|
|
1067
|
+
export class NoteNotFound extends Schema.TaggedError<NoteNotFound>()(
|
|
1068
|
+
"NoteNotFound",
|
|
1069
|
+
{ noteId: Id("notes") },
|
|
1070
|
+
) {}
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1073
|
+
`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.
|
|
1074
|
+
|
|
1075
|
+
`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.
|
|
1076
|
+
|
|
1077
|
+
- 2932d21: Drop the `URL.canParse` polyfill that `@confect/server` installed on import in the `10.0.0-next.7` through `10.0.0-next.9` prereleases. It worked around the Convex UDF isolate's `URL` lacking the static `URL.canParse` that Effect's `Schema.URLFromString` decode relies on; the Convex runtime [now implements `URL.canParse` and `URL.parse`](https://github.com/get-convex/convex-backend/issues/510), so patching the global is no longer needed. `@confect/server`'s entry modules are side-effect-free again.
|
|
1078
|
+
- Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.4.0—see that version's changelog entries.
|
|
1079
|
+
|
|
1080
|
+
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.
|
|
1081
|
+
|
|
1082
|
+
## 10.0.0-next.10
|
|
1083
|
+
|
|
1084
|
+
### Patch Changes
|
|
1085
|
+
|
|
1086
|
+
- Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.3.0—see that version's changelog entries.
|
|
1087
|
+
|
|
1088
|
+
## 10.0.0-next.9
|
|
1089
|
+
|
|
1090
|
+
### Patch Changes
|
|
1091
|
+
|
|
1092
|
+
- 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.
|
|
1093
|
+
- 25e8d19: Sync with `main`: this prerelease line now includes all changes released in `@confect/*` 9.2.5—see that version's changelog entries.
|
|
1094
|
+
|
|
1095
|
+
## 10.0.0-next.8
|
|
1096
|
+
|
|
1097
|
+
### Patch Changes
|
|
1098
|
+
|
|
1099
|
+
- 913d0e5: Raise the required `effect` peer version to `^4.0.0-beta.101` (from `^4.0.0-beta.100`).
|
|
1100
|
+
|
|
1101
|
+
This is a peer-range-only change with no consumer-visible API consequences. The `beta.101` release only touches fiber/concurrency internals (interrupt handling in concurrent traversal, stack frame annotations, `awaitAllChildren` linearization, `interruptibleMask` interrupt delivery), a `MutableList.filter` fix for empty buckets, a `Schema.Struct` required-readonly-field type display simplification, and an `HttpRouter.toWebHandler` middleware type-inference tightening that Confect doesn't need to accommodate.
|
|
1102
|
+
|
|
1103
|
+
## 10.0.0-next.7
|
|
1104
|
+
|
|
1105
|
+
### Patch Changes
|
|
1106
|
+
|
|
1107
|
+
- 41c1175: Fix `StorageWriter.generateUploadUrl` and `StorageReader.getUrl` dying with `SchemaError: Expected URL, got "https://…"` on the URL strings Convex returns. Effect 4's `Schema.URL` is an `instanceof URL` check (in Effect 3 it was a string→URL transform), so the storage services now decode with `Schema.URLFromString` instead.
|
|
1108
|
+
|
|
1109
|
+
`Schema.URLFromString` relies on `URL.canParse`, which the Convex UDF isolate's `URL` polyfill doesn't implement—so `@confect/server` now installs a spec-compliant `URL.canParse` polyfill when it's missing. The polyfill loads with the package's entry modules, so it also covers user schemas that use `Schema.URLFromString` (or `URL.canParse` directly) inside Convex queries and mutations.
|
|
1110
|
+
|
|
1111
|
+
## 10.0.0-next.6
|
|
1112
|
+
|
|
1113
|
+
### Patch Changes
|
|
1114
|
+
|
|
1115
|
+
- 360e99f: Support Convex 1.41+, whose `runQuery`/`runMutation` on `GenericQueryCtx`/`GenericMutationCtx` gained a nested-transaction `transactionLimits` option that `GenericActionCtx`'s versions don't have. `QueryRunner.layer`/`MutationRunner.layer` were typed against the wider `GenericQueryCtx`/`GenericMutationCtx` signatures, so passing an action's `runQuery`/`runMutation` (the only way they're actually used to build an action's services) stopped typechecking against Convex 1.41+. They're now typed against `GenericActionCtx`, matching how they're actually called; no public API or behavior change.
|
|
1116
|
+
|
|
1117
|
+
## 10.0.0-next.5
|
|
1118
|
+
|
|
1119
|
+
### Patch Changes
|
|
1120
|
+
|
|
1121
|
+
- 26c3b15: Fix the remaining "Can't use setTimeout in queries and mutations" crash for apps whose function registration or schema compilation performs enough Effect operations to trigger a cooperative fiber yield. Convex evaluates a function's modules inside the same timer-restricted isolate as the handler, and Confect's module-scope Effect runs (registration layer builds and schema-to-validator compilation) could still dispatch a yield through timer APIs there. These now run with cooperative yielding disabled.
|
|
1122
|
+
|
|
1123
|
+
## 10.0.0-next.4
|
|
1124
|
+
|
|
1125
|
+
### Patch Changes
|
|
1126
|
+
|
|
1127
|
+
- b27f12d: Fix query and mutation handlers crashing with Convex's "Can't use setTimeout in queries and mutations" error once they performed enough Effect operations to trigger a cooperative fiber yield. Effect execution in queries and mutations now yields via the microtask queue instead of timer APIs, which Convex's isolate forbids. Actions are unchanged.
|
|
1128
|
+
|
|
1129
|
+
## 10.0.0-next.3
|
|
1130
|
+
|
|
1131
|
+
### Patch Changes
|
|
1132
|
+
|
|
1133
|
+
- 5b63546: Raise the required `effect` peer version to `^4.0.0-beta.100` (from `^4.0.0-beta.99`).
|
|
1134
|
+
|
|
1135
|
+
This is a peer-range-only change with no consumer-visible API consequences. The `beta.100` release only touches `Cron` internals (month/weekday alias normalization, day/weekday rollover, and equality/hashing), CLI error message formatting (`InvalidValue` prefixes), and `Schema.toTaggedUnion` discriminants that Confect doesn't use.
|
|
1136
|
+
|
|
1137
|
+
## 10.0.0-next.2
|
|
1138
|
+
|
|
1139
|
+
### Patch Changes
|
|
1140
|
+
|
|
1141
|
+
- 35f7515: Raise the required `effect` peer version to `^4.0.0-beta.99` (from `^4.0.0-beta.98`).
|
|
1142
|
+
|
|
1143
|
+
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.
|
|
1144
|
+
|
|
1145
|
+
- 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.
|
|
1146
|
+
|
|
1147
|
+
## 10.0.0-next.1
|
|
1148
|
+
|
|
1149
|
+
### Patch Changes
|
|
1150
|
+
|
|
1151
|
+
- 4d98ea8: Raise the required `effect` peer version to `^4.0.0-beta.98` (from `^4.0.0-beta.97`).
|
|
1152
|
+
|
|
1153
|
+
`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.
|
|
1154
|
+
|
|
1155
|
+
- Updated dependencies [4d98ea8]
|
|
1156
|
+
- @confect/core@10.0.0-next.1
|
|
1157
|
+
|
|
1158
|
+
## 10.0.0-next.0
|
|
1159
|
+
|
|
1160
|
+
### Major Changes
|
|
1161
|
+
|
|
1162
|
+
- 70e313e: Migrate to Effect v4. All `@confect/*` packages now require `effect@^4.0.0-beta.97`; `@effect/platform` and `@effect/cli` are no longer dependencies (their functionality moved into `effect` core and `effect/unstable/*`).
|
|
1163
|
+
|
|
1164
|
+
Breaking changes for users:
|
|
1165
|
+
- **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.
|
|
1166
|
+
- **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.
|
|
1167
|
+
- **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.
|
|
1168
|
+
- **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`).
|
|
1169
|
+
- **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.
|
|
1170
|
+
- **Node actions** use `effect/unstable/process` (`ChildProcessSpawner`) and `@effect/platform-node`'s `NodeServices` in place of `@effect/platform` `Command`/`NodeContext`.
|
|
1171
|
+
- **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.
|
|
1172
|
+
- **CLI**: a malformed `convex.json` now fails codegen with a descriptive error instead of being silently ignored.
|
|
1173
|
+
- 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.
|
|
1174
|
+
|
|
1175
|
+
### Patch Changes
|
|
1176
|
+
|
|
1177
|
+
- Updated dependencies [70e313e]
|
|
1178
|
+
- @confect/core@10.0.0-next.0
|
|
1179
|
+
|
|
1180
|
+
## 9.4.2
|
|
1181
|
+
|
|
1182
|
+
### Patch Changes
|
|
1183
|
+
|
|
1184
|
+
- 32d0112: Fix `DatabaseWriter`'s `patch` rejecting `undefined` for optional fields under `exactOptionalPropertyTypes`.
|
|
1185
|
+
|
|
1186
|
+
Setting an optional field to `undefined` in a patch unsets it, but the argument was typed as a plain `Partial` of the document, so `writer.table("notes").patch(id, { tag: undefined })` was a type error in projects with `exactOptionalPropertyTypes` enabled. Optional fields now accept `undefined`; fields whose type does not already include `undefined` are unchanged.
|
|
1187
|
+
|
|
1188
|
+
## 9.4.1
|
|
1189
|
+
|
|
1190
|
+
### Patch Changes
|
|
1191
|
+
|
|
1192
|
+
- 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.
|
|
1193
|
+
|
|
1194
|
+
## 9.4.0
|
|
1195
|
+
|
|
1196
|
+
### Minor Changes
|
|
1197
|
+
|
|
1198
|
+
- 0526b5f: Raise `@confect/server`'s `@effect/platform` peer dependency floor to `^0.97.1`, and its optional `@effect/platform-node` peer to `^0.108.1`. If you are on `@effect/platform` 0.96.x, upgrade it alongside this release: the Effect ecosystem treats each `0.x` minor as its own compatibility line, so a project resolving both 0.96 and 0.97 gets duplicate-package type errors rather than a working install.
|
|
1199
|
+
|
|
1200
|
+
`@confect/cli` moves its own dependencies onto the same line—`@effect/cli` `^0.77.0`, `@effect/platform` `^0.97.1`, `@effect/platform-node` `^0.108.1`, `@effect/printer` and `@effect/printer-ansi` `^0.51.0`, and `exsolve` `^1.1.1`. No action is needed unless you depend on those packages directly.
|
|
1201
|
+
|
|
1202
|
+
## 9.3.0
|
|
1203
|
+
|
|
1204
|
+
### Minor Changes
|
|
1205
|
+
|
|
1206
|
+
- 16b5ad6: Add first-class paginated queries: declare one with `FunctionSpec.publicPaginatedQuery` (or `internalPaginatedQuery`) and read it with the new `usePaginatedQuery` hook from `@confect/react`.
|
|
1207
|
+
|
|
1208
|
+
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`.
|
|
1209
|
+
|
|
1210
|
+
```ts
|
|
1211
|
+
// confect/notes.spec.ts
|
|
1212
|
+
FunctionSpec.publicPaginatedQuery({
|
|
1213
|
+
name: "listByAuthor",
|
|
1214
|
+
args: () => Schema.Struct({ author: Schema.String }),
|
|
1215
|
+
item: () => notes.Doc,
|
|
1216
|
+
});
|
|
1217
|
+
|
|
1218
|
+
// confect/notes.impl.ts
|
|
1219
|
+
({ author, paginationOpts }) =>
|
|
1220
|
+
Effect.gen(function* () {
|
|
1221
|
+
const reader = yield* DatabaseReader;
|
|
1222
|
+
|
|
1223
|
+
return yield* reader
|
|
1224
|
+
.table("notes")
|
|
1225
|
+
.index("by_creation_time", "desc")
|
|
1226
|
+
.paginate(paginationOpts, (q) => q.eq(q.field("author"), author));
|
|
1227
|
+
}).pipe(Effect.orDie);
|
|
1228
|
+
```
|
|
1229
|
+
|
|
1230
|
+
Declaring `paginationOpts` in `args` yourself is a type and runtime error.
|
|
1231
|
+
|
|
1232
|
+
```tsx
|
|
1233
|
+
import { PaginatedQueryResult, usePaginatedQuery } from "@confect/react";
|
|
1234
|
+
|
|
1235
|
+
const notes = usePaginatedQuery(
|
|
1236
|
+
refs.public.notes.listByAuthor,
|
|
1237
|
+
{ author },
|
|
1238
|
+
{ initialNumItems: 10 },
|
|
1239
|
+
);
|
|
1240
|
+
|
|
1241
|
+
// `notes.results` holds the pages decoded through `item`.
|
|
1242
|
+
if (PaginatedQueryResult.isCanLoadMore(notes)) {
|
|
1243
|
+
notes.loadMore(10);
|
|
1244
|
+
}
|
|
1245
|
+
```
|
|
1246
|
+
|
|
1247
|
+
The hook returns a `PaginatedQueryResult<Item, E>`. `LoadingFirstPage`, `LoadingMore`, `CanLoadMore`, and `Exhausted` all carry `results` and `isLoading`; `loadMore` lives only on `CanLoadMore`, the one state it can make progress from. A declared `error` schema surfaces as a `Failure` variant carrying the decoded error instead of throwing during render, and `Failure` carries `results` too, so the pages loaded before it can still be rendered. Without an `error` schema, `Failure` is absent from the type entirely.
|
|
1248
|
+
|
|
1249
|
+
`paginate` in `@confect/server` now accepts Convex's full `PaginationOptions`, so a handler's `paginationOpts` passes straight through. `@confect/react` now requires `convex` >= 1.36.0.
|
|
1250
|
+
|
|
1251
|
+
## 9.2.5
|
|
1252
|
+
|
|
1253
|
+
### Patch Changes
|
|
1254
|
+
|
|
1255
|
+
- de717af: Support Convex 1.41+, whose `runQuery`/`runMutation` on `GenericQueryCtx`/`GenericMutationCtx` gained a nested-transaction `transactionLimits` option that `GenericActionCtx`'s versions don't have. `QueryRunner.layer`/`MutationRunner.layer` were typed against the wider `GenericQueryCtx`/`GenericMutationCtx` signatures, so passing an action's `runQuery`/`runMutation` (the only way they're actually used to build an action's services) stopped typechecking against Convex 1.41+. They're now typed against `GenericActionCtx`, matching how they're actually called; no public API or behavior change.
|
|
1256
|
+
|
|
1257
|
+
## 9.2.4
|
|
1258
|
+
|
|
1259
|
+
### Patch Changes
|
|
1260
|
+
|
|
1261
|
+
- 5107fa1: Fix a TypeScript 6 type mismatch for schemas with nested optional fields.
|
|
1262
|
+
|
|
1263
|
+
When compiled with TypeScript 6, the document types Confect derives for schemas containing nested optional fields (e.g. `{ foo: { bar?: number | undefined } }`) picked up a stray `| undefined` on those fields, so they no longer lined up with the types Convex infers for the equivalent validators. This could surface as type errors wherever a Confect-derived validator or document type meets a Convex one. The derived types are now identical under TypeScript 5.x and 6.x.
|
|
1264
|
+
|
|
1265
|
+
## 9.2.3
|
|
1266
|
+
|
|
1267
|
+
### Patch Changes
|
|
1268
|
+
|
|
1269
|
+
- @confect/core@9.2.3
|
|
1270
|
+
|
|
1271
|
+
## 9.2.2
|
|
1272
|
+
|
|
1273
|
+
### Patch Changes
|
|
1274
|
+
|
|
1275
|
+
- 7e7b2a4: Throw an error when a cron schedule specifies a non-UTC timezone
|
|
1276
|
+
|
|
1277
|
+
Convex evaluates all cron expressions in UTC, so specifying a timezone has no effect. Previously, a non-UTC timezone was silently ignored, which could produce a job that ran at the wrong time.
|
|
1278
|
+
|
|
1279
|
+
To prevent this silent misbehavior, a cron that specifies a non-UTC timezone now throws an error.
|
|
1280
|
+
- @confect/core@9.2.2
|
|
1281
|
+
|
|
1282
|
+
## 9.2.1
|
|
1283
|
+
|
|
1284
|
+
### Patch Changes
|
|
1285
|
+
|
|
1286
|
+
- @confect/core@9.2.1
|
|
1287
|
+
|
|
1288
|
+
## 9.2.0
|
|
1289
|
+
|
|
1290
|
+
### Patch Changes
|
|
1291
|
+
|
|
1292
|
+
- @confect/core@9.2.0
|
|
1293
|
+
|
|
1294
|
+
## 9.1.5
|
|
1295
|
+
|
|
1296
|
+
### Patch Changes
|
|
1297
|
+
|
|
1298
|
+
- @confect/core@9.1.5
|
|
1299
|
+
|
|
1300
|
+
## 9.1.4
|
|
1301
|
+
|
|
1302
|
+
### Patch Changes
|
|
1303
|
+
|
|
1304
|
+
- @confect/core@9.1.4
|
|
1305
|
+
|
|
1306
|
+
## 9.1.3
|
|
1307
|
+
|
|
1308
|
+
### Patch Changes
|
|
1309
|
+
|
|
1310
|
+
- Updated dependencies [8d63382]
|
|
1311
|
+
- @confect/core@9.1.3
|
|
1312
|
+
|
|
1313
|
+
## 9.1.2
|
|
1314
|
+
|
|
1315
|
+
### Patch Changes
|
|
1316
|
+
|
|
1317
|
+
- e2bb5ef: Fix `db.patch`, `db.replace`, and `db.insert` rejecting branch-specific fields on tables whose schema is a `Schema.Union`.
|
|
1318
|
+
|
|
1319
|
+
Writing a field that only exists on one member of the union (e.g. patching `status` on the `Dropship` branch of a union-typed `orders` table) failed to typecheck—only the fields common to every member were accepted. These operations now accept every branch's fields. This also unblocks consuming a Confect backend as a referenced/composite TypeScript project, which previously failed to emit declarations because of these errors.
|
|
1320
|
+
- @confect/core@9.1.2
|
|
1321
|
+
|
|
1322
|
+
## 9.1.1
|
|
1323
|
+
|
|
1324
|
+
### Patch Changes
|
|
1325
|
+
|
|
1326
|
+
- 308b347: Fix codegen emitting an invalid `interface … extends Document.Document<…>` in `_generated/docs.ts` for tables whose document type is not a single object.
|
|
1327
|
+
|
|
1328
|
+
`Document.Document<Schema, Table>` is a type alias that resolves to whatever the table's schema is, so for a `Schema.Union` table (or any non-object document: branded primitives, `Schema.transform` results, …) it resolves to a union. An `interface` cannot extend a union, so the generated `XDoc` tripped `TS2312` and collapsed to an unusable type, which then broke every reader/writer helper that printed it.
|
|
1329
|
+
|
|
1330
|
+
Codegen now emits a `type` alias per table—`export type NotesDoc = Document.Document<typeof schemaDefinition, "notes">;`—which keeps the named document type (so declaration emit still prints `NotesDoc` rather than the expanded row) while supporting every document shape. Runtime behaviour is unchanged.
|
|
1331
|
+
- @confect/core@9.1.1
|
|
1332
|
+
|
|
1333
|
+
## 9.1.0
|
|
1334
|
+
|
|
1335
|
+
### Minor Changes
|
|
1336
|
+
|
|
1337
|
+
- 8bbde87: Make Confect's public types declaration-emittable, fixing `TS7056` under `tsc --build` with `composite`/`declaration` (e.g. consuming a Confect backend as a referenced TypeScript project).
|
|
1338
|
+
|
|
1339
|
+
The schema-generic service tags (`DatabaseReader`, `DatabaseWriter`, `VectorSearch`, `QueryCtx`/`MutationCtx`/`ActionCtx`) now back their `Context.GenericTag` with named generic interfaces, and codegen annotates the `_generated/services.ts` exports with the corresponding tag aliases—so declaration emit prints the names by reference instead of re-expanding the whole data model (the example backend's `services.d.ts` drops from ~307 KB to ~5.6 KB).
|
|
1340
|
+
|
|
1341
|
+
Codegen also emits `_generated/docs.ts`—a nominal `interface` per table plus a `Docs` registry—threaded into the reader/writer tags via the `Document.Document<Schema, Table>` helper, so query/mutation helpers print named document types (e.g. `NotesDoc`) with no added annotations. Runtime behaviour is unchanged.
|
|
1342
|
+
|
|
1343
|
+
### Patch Changes
|
|
1344
|
+
|
|
1345
|
+
- Updated dependencies [4d8a568]
|
|
1346
|
+
- @confect/core@9.1.0
|
|
1347
|
+
|
|
1348
|
+
## 9.0.2
|
|
1349
|
+
|
|
1350
|
+
### Patch Changes
|
|
1351
|
+
|
|
1352
|
+
- dd33006: Fix a crash when `get` by index missed on an index over non-string fields.
|
|
1353
|
+
|
|
1354
|
+
`GetByIndexFailure` declared its `indexFieldValues` as `Schema.Array(Schema.String)` while the actual values can be any Convex value (numbers, bigints, booleans, ids, etc.). Because `Schema.TaggedError` constructors validate at runtime, a `get` by such an index would die with a `ParseError` defect whenever the lookup found no document—instead of failing with the catchable `GetByIndexFailure`. Lookups that found a document were unaffected, so the crash only surfaced on a miss.
|
|
1355
|
+
|
|
1356
|
+
`indexFieldValues` is now typed as an array of unknown values and carries the actual values used in the failed lookup. The error `message` renders them as JSON, handling every Convex value type including `bigint` values from `int64` index fields.
|
|
1357
|
+
- @confect/core@9.0.2
|
|
1358
|
+
|
|
1359
|
+
## 9.0.1
|
|
1360
|
+
|
|
1361
|
+
### Patch Changes
|
|
1362
|
+
|
|
1363
|
+
- 445ea9b: Loosen and align dependency ranges across all packages:
|
|
1364
|
+
- 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.
|
|
1365
|
+
- `@confect/server`'s `@effect/platform-node` peer dependency is now optional—it is only needed when using the `@confect/server/node` entrypoint.
|
|
1366
|
+
- `@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`.
|
|
1367
|
+
- `@confect/test` now accepts any `convex-test` release in `>=0.0.50 <0.1.0` instead of exactly 0.0.50.
|
|
1368
|
+
|
|
1369
|
+
- Updated dependencies [445ea9b]
|
|
1370
|
+
- @confect/core@9.0.1
|
|
1371
|
+
|
|
1372
|
+
## 9.0.0
|
|
1373
|
+
|
|
1374
|
+
### Major Changes
|
|
1375
|
+
|
|
1376
|
+
- a905072: Rearchitect Confect so that cold-starting a Convex function only evaluates its own group's module graph, cutting cold-start execution time on large projects. The change touches how you author tables, specs, and impls, and removes the project-wide aggregation that used to make every function evaluate every other function's code—and every table's schema—the first time it ran.
|
|
1377
|
+
|
|
1378
|
+
Convex bundles a deployment into a single artifact, but a function's cold start only _evaluates_ the module graph reachable from its own entry point. Previously, all impls were assembled into a single root `confect/impl.ts` that every generated `convex/` module imported, so cold-starting any one query, mutation, or action transitively evaluated the impl of every other function in the project, plus every function spec and every table schema, at module-load time. Cold-start execution time scaled with the size of the whole project. In v9, `confect codegen` emits one registry per group and each generated `convex/` module imports only its own group—so a function's cold-start work scales with its own group, not the project.
|
|
1379
|
+
|
|
1380
|
+
### Filesystem-driven groups
|
|
1381
|
+
|
|
1382
|
+
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.
|
|
1383
|
+
- Each `*.spec.ts` `export default`s its `GroupSpec` (named co-exports like error classes are still allowed).
|
|
1384
|
+
- 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.
|
|
1385
|
+
- 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.
|
|
1386
|
+
|
|
1387
|
+
### Tables are the source of truth, named by their filename
|
|
1388
|
+
|
|
1389
|
+
Your schema now lives entirely in `confect/tables/`, one `Table` per file, and **the filename is the table name**—`confect/tables/notes.ts` defines the `notes` table. `Table.make` no longer takes a name argument. The user-authored `confect/schema.ts` is removed; codegen scans `confect/tables/*.ts` and generates everything else.
|
|
1390
|
+
|
|
1391
|
+
Each table file is a default-export-only module, and its field schema is wrapped in a `() =>` callback so it is built lazily—a function only pays a table's schema-construction cost at cold start for tables it actually reads.
|
|
1392
|
+
|
|
1393
|
+
```ts confect/tables/notes.ts
|
|
1394
|
+
import { Table } from "@confect/server";
|
|
1395
|
+
import { Schema } from "effect";
|
|
1396
|
+
import { Id } from "../_generated/id";
|
|
1397
|
+
|
|
1398
|
+
export default Table.make(() =>
|
|
1399
|
+
Schema.Struct({
|
|
1400
|
+
userId: Schema.optional(Id("users")),
|
|
1401
|
+
text: Schema.String,
|
|
1402
|
+
}),
|
|
1403
|
+
);
|
|
1404
|
+
```
|
|
1405
|
+
|
|
1406
|
+
Codegen emits, alongside it:
|
|
1407
|
+
- `_generated/schema.ts`—the runtime `DatabaseSchema`. Never imports `convex/server`, so a runtime cold start no longer evaluates `defineSchema(...)`.
|
|
1408
|
+
- `_generated/convexSchema.ts`—the Convex deploy `SchemaDefinition`, re-exported from `convex/schema.ts`.
|
|
1409
|
+
- `_generated/id.ts`—a type-safe `Id` constructor whose argument is constrained to your table names. Use `Id("notes")` everywhere you previously wrote `GenericId.GenericId("notes")`; cross-table `_id` typos are now caught at compile time.
|
|
1410
|
+
- `_generated/tables/<name>.ts`—a thin wrapper that binds the filename to the table. Read a table's `Doc`, `Fields`, and `tableName` from this wrapper (`import notes from "../_generated/tables/notes"`), not from `confect/tables/`.
|
|
1411
|
+
|
|
1412
|
+
A bound table's `name` property is renamed to `tableName` (avoiding a collision with `Function.prototype.name`).
|
|
1413
|
+
|
|
1414
|
+
### Specs and impls: lazy schemas, and impls take the `DatabaseSchema`
|
|
1415
|
+
|
|
1416
|
+
`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.
|
|
1417
|
+
|
|
1418
|
+
**Before:**
|
|
1419
|
+
|
|
1420
|
+
```ts confect/notes.spec.ts
|
|
1421
|
+
export const notes = GroupSpec.make("notes").addFunction(
|
|
1422
|
+
FunctionSpec.publicQuery({
|
|
1423
|
+
name: "list",
|
|
1424
|
+
args: Schema.Struct({}),
|
|
1425
|
+
returns: Schema.Array(Notes.Doc),
|
|
1426
|
+
}),
|
|
1427
|
+
);
|
|
1428
|
+
```
|
|
1429
|
+
|
|
1430
|
+
```ts confect/notes.impl.ts
|
|
1431
|
+
const list = FunctionImpl.make(api, "notes", "list", handler);
|
|
1432
|
+
export const notes = GroupImpl.make(api, "notes").pipe(Layer.provide(list));
|
|
1433
|
+
```
|
|
1434
|
+
|
|
1435
|
+
**After:**
|
|
1436
|
+
|
|
1437
|
+
```ts confect/notes.spec.ts
|
|
1438
|
+
import notes from "./_generated/tables/notes";
|
|
1439
|
+
|
|
1440
|
+
export default GroupSpec.make().addFunction(
|
|
1441
|
+
FunctionSpec.publicQuery({
|
|
1442
|
+
name: "list",
|
|
1443
|
+
args: () => Schema.Struct({}),
|
|
1444
|
+
returns: () => Schema.Array(notes.Doc),
|
|
1445
|
+
}),
|
|
1446
|
+
);
|
|
1447
|
+
```
|
|
1448
|
+
|
|
1449
|
+
```ts confect/notes.impl.ts
|
|
1450
|
+
import databaseSchema from "./_generated/schema";
|
|
1451
|
+
import notes from "./notes.spec";
|
|
1452
|
+
|
|
1453
|
+
const list = FunctionImpl.make(databaseSchema, notes, "list", handler);
|
|
1454
|
+
export default GroupImpl.make(databaseSchema, notes).pipe(
|
|
1455
|
+
Layer.provide(list),
|
|
1456
|
+
GroupImpl.finalize,
|
|
1457
|
+
);
|
|
1458
|
+
```
|
|
1459
|
+
|
|
1460
|
+
### Node functions are first-class
|
|
1461
|
+
|
|
1462
|
+
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.
|
|
1463
|
+
- A Node group at `confect/email.spec.ts` is now reached at `refs.public.email.send` instead of `refs.public.node.email.send`.
|
|
1464
|
+
- `@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.
|
|
1465
|
+
|
|
1466
|
+
### Less work at cold start
|
|
1467
|
+
|
|
1468
|
+
Confect's own packages now import Effect from its submodule paths (`import * as Schema from "effect/Schema"`) instead of the `"effect"` barrel. A barrel import of a namespace re-export pulls the entire namespace into the module graph a function evaluates at cold start, even when only a small part is used; importing the submodule path evaluates only what's needed. On a minimal function this cut cold-start module-evaluation time by ~35%. This is an internal change with no effect on your code—but to get the full win, import Effect from its submodule paths in your own `confect/` files too, since a single barrel import anywhere in a function's module graph re-pins the whole namespace.
|
|
1469
|
+
|
|
1470
|
+
### Stable React hook results
|
|
1471
|
+
|
|
1472
|
+
`@confect/react` hooks now hold stable identities across renders, matching Convex's own hooks. `useQuery` memoizes the decoded `QueryResult` by the (referentially stable) Convex result, so unchanged data keeps the same `QueryResult` instead of a fresh one each render—fixing effect/memo loops (including `Maximum update depth exceeded`) for code that derives off the result. `useMutation` and `useAction` return a stable `useCallback`, and `Ref.getFunctionReference` caches the Convex function reference per function name.
|
|
1473
|
+
|
|
1474
|
+
### Codegen robustness
|
|
1475
|
+
|
|
1476
|
+
The codegen bundler now uses [`bundle-require`](https://github.com/egoist/bundle-require), so impls may import third-party packages and use `tsconfig.json` `paths` aliases (`~/*`, `@/*`, …) for their own source. A parent `confect/{path}.spec.ts` may now declare functions alongside a sibling `confect/{path}/` subdirectory of further specs, and codegen reports a clear error on a name collision between the two.
|
|
1477
|
+
|
|
1478
|
+
### Migration
|
|
1479
|
+
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`.
|
|
1480
|
+
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"`.
|
|
1481
|
+
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).
|
|
1482
|
+
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)`.
|
|
1483
|
+
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`.
|
|
1484
|
+
6. **Optional.** Adopt submodule Effect imports (`import * as Schema from "effect/Schema"`) in your own `confect/` files for the full cold-start savings.
|
|
1485
|
+
7. Run `confect codegen`. It re-emits the entire `convex/` tree and `confect/_generated/`, deleting any stale files from earlier versions.
|
|
1486
|
+
|
|
1487
|
+
### Patch Changes
|
|
1488
|
+
|
|
1489
|
+
- 9eec71c: Generate the published `.d.ts` declarations with the TypeScript compiler instead of tsdown's declaration bundler. tsdown now emits JavaScript only (`dts: false`); each package has a composite `tsconfig.src.json`, and `tsc -b` emits the declarations into `dist/` as part of the build. (`@confect/cli` is the exception: it ships only a binary, so it emits no declarations at all.)
|
|
1490
|
+
|
|
1491
|
+
The emitted types are equivalent to before—same exported surface, same inferred shapes—so no consumer-facing type changes. One incidental improvement comes with the switch: declaration maps (`.d.ts.map`) now ship alongside the types (with `src/` included in the published files, so "go to definition" lands on the original source).
|
|
1492
|
+
|
|
1493
|
+
- Updated dependencies [9eec71c]
|
|
1494
|
+
- Updated dependencies [a905072]
|
|
1495
|
+
- @confect/core@9.0.0
|
|
1496
|
+
|
|
1497
|
+
## 9.0.0-next.10
|
|
1498
|
+
|
|
1499
|
+
### Patch Changes
|
|
1500
|
+
|
|
1501
|
+
- 9eec71c: Generate the published `.d.ts` declarations with the TypeScript compiler instead of tsdown's declaration bundler. tsdown now emits JavaScript only (`dts: false`); each package has a composite `tsconfig.src.json`, and `tsc -b` emits the declarations into `dist/` as part of the build. (`@confect/cli` is the exception: it ships only a binary, so it emits no declarations at all.)
|
|
1502
|
+
|
|
1503
|
+
The emitted types are equivalent to before—same exported surface, same inferred shapes—so no consumer-facing type changes. One incidental improvement comes with the switch: declaration maps (`.d.ts.map`) now ship alongside the types (with `src/` included in the published files, so "go to definition" lands on the original source).
|
|
1504
|
+
|
|
1505
|
+
- Updated dependencies [9eec71c]
|
|
1506
|
+
- @confect/core@9.0.0-next.10
|
|
1507
|
+
|
|
1508
|
+
## 9.0.0-next.9
|
|
1509
|
+
|
|
1510
|
+
### Major Changes
|
|
1511
|
+
|
|
1512
|
+
- 4894959: Make Node-runtime functions first-class and remove the separate `node` namespace.
|
|
1513
|
+
|
|
1514
|
+
A function group's runtime is now declared solely by its spec—`GroupSpec.makeNode()` for a Node action group, `GroupSpec.make()` for a Convex group—exactly like vanilla Convex's per-file `"use node"` directive. The `confect/node/` directory is no longer special: Node specs/impls are ordinary colocated `.spec.ts`/`.impl.ts` pairs that can live anywhere in `confect/`, and codegen emits the `"use node"` directive into the generated `convex/` module based on the spec. This is safe because v9's per-group registries already isolate each Convex function's bundle from every other group's impl, so Node-only code can no longer leak into a Convex-runtime bundle regardless of namespace.
|
|
1515
|
+
|
|
1516
|
+
### Why
|
|
1517
|
+
|
|
1518
|
+
The `node` namespace existed only because the pre-v9 architecture aggregated every function's impl into one module that all generated `convex/` modules imported; Node functions had to be quarantined into a separate spec/impl/registry tree so Convex-runtime functions wouldn't transitively import Node-only code. v9's per-group isolation removed that constraint, so the namespace was no longer load-bearing—only ergonomic overhead that diverged from vanilla Convex (which identifies Node modules per-file, with no directory requirement).
|
|
1519
|
+
|
|
1520
|
+
### Breaking changes
|
|
1521
|
+
- **API namespace removed.** A Node group at `confect/email.spec.ts` is now referenced as `refs.public.email.send` instead of `refs.public.node.email.send`. Node groups are ordinary groups in the refs tree, nesting preserved like any other group.
|
|
1522
|
+
- **Generated layout changed.** Node modules are emitted at `convex/<path>.ts` (carrying `"use node"`) instead of `convex/node/<path>.ts`, and their registries at `confect/_generated/registeredFunctions/<path>.ts`. The single assembled `confect/_generated/spec.ts` now contains every group regardless of runtime; `confect/_generated/nodeSpec.ts` is no longer generated (codegen deletes any stale copy on upgrade).
|
|
1523
|
+
- **`@confect/core` API.** Removed `Spec.makeNode`, `Spec.merge`, and `Spec.isConvexSpec`/`Spec.isNodeSpec`. `Spec` is now a single mixed-runtime container (`Spec.make()` accepts groups of any runtime). `Refs.make(spec)` takes a single argument (the unified spec) instead of `(convexSpec, nodeSpec)`. `GroupSpec.makeNode()`/`makeNodeAt()` and `FunctionSpec.publicNodeAction()`/`internalNodeAction()` are unchanged; `GroupSpec` subgroups may now be of any runtime (a group is just a namespace for its children).
|
|
1524
|
+
|
|
1525
|
+
### Migration
|
|
1526
|
+
1. Move any `confect/node/<path>.spec.ts`/`.impl.ts` files to wherever you want them under `confect/` (e.g. `confect/<path>.spec.ts`); the `node/` directory has no special meaning anymore. Their specs already use `GroupSpec.makeNode()`, so no spec-body change is needed—only fix the impl's relative import of `_generated/schema` if its depth changed.
|
|
1527
|
+
2. Update call sites to drop the `node` segment: `refs.public.node.<group>.<fn>` → `refs.public.<group>.<fn>`.
|
|
1528
|
+
3. Replace `Refs.make(spec, nodeSpec)` with `Refs.make(spec)` (codegen does this for `_generated/refs.ts` automatically).
|
|
1529
|
+
4. Run `confect codegen`. The `convex/` tree and `confect/_generated/` are re-emitted; the stale `_generated/nodeSpec.ts` is removed.
|
|
1530
|
+
|
|
1531
|
+
### Patch Changes
|
|
1532
|
+
|
|
1533
|
+
- Updated dependencies [4894959]
|
|
1534
|
+
- @confect/core@9.0.0-next.9
|
|
1535
|
+
|
|
1536
|
+
## 9.0.0-next.8
|
|
1537
|
+
|
|
1538
|
+
### Patch Changes
|
|
1539
|
+
|
|
1540
|
+
- 3fec285: Import Effect from its submodule paths internally to shrink per-function cold-start bundles.
|
|
1541
|
+
|
|
1542
|
+
Confect's packages now import Effect modules from their submodule paths (`import * as Schema from "effect/Schema"`) instead of the `"effect"` barrel (`import { Schema } from "effect"`).
|
|
1543
|
+
|
|
1544
|
+
### Why
|
|
1545
|
+
|
|
1546
|
+
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.
|
|
1547
|
+
|
|
1548
|
+
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).
|
|
1549
|
+
|
|
1550
|
+
No API changes—your existing code keeps working.
|
|
1551
|
+
|
|
1552
|
+
### Getting the full win in your own code
|
|
1553
|
+
|
|
1554
|
+
This change shrinks the Confect code in every function bundle, but a function's bundle also includes your own `confect/tables/*` and `*.spec.ts` files. esbuild retains the union across all importers, so a single barrel import anywhere in a function's module graph re-pins the whole `effect/Schema` namespace and undoes the reduction. To get the full bundle/cold-start savings, import Effect from its submodule paths in your own Confect files too:
|
|
1555
|
+
|
|
1556
|
+
```diff
|
|
1557
|
+
- import { Schema } from "effect";
|
|
1558
|
+
+ import * as Schema from "effect/Schema";
|
|
1559
|
+
```
|
|
1560
|
+
|
|
1561
|
+
Bare helpers (`pipe`, `flow`, `identity`) come from `"effect/Function"`.
|
|
1562
|
+
|
|
1563
|
+
- Updated dependencies [3fec285]
|
|
1564
|
+
- @confect/core@9.0.0-next.8
|
|
1565
|
+
|
|
1566
|
+
## 9.0.0-next.7
|
|
1567
|
+
|
|
1568
|
+
### Patch Changes
|
|
1569
|
+
|
|
1570
|
+
- Updated dependencies [5d19484]
|
|
1571
|
+
- @confect/core@9.0.0-next.7
|
|
1572
|
+
|
|
1573
|
+
## 9.0.0-next.6
|
|
1574
|
+
|
|
1575
|
+
### Major Changes
|
|
1576
|
+
|
|
1577
|
+
- 46045a9: Reduce per-function cold-start cost: make `FunctionSpec` schemas lazy and keep each Convex function's bundle scoped to its own group.
|
|
1578
|
+
|
|
1579
|
+
Previously, loading a single Convex function still paid for the whole project—importing the codegen-assembled `_generated/spec.ts` ran `Schema.Struct(...)`/`Schema.Array(...)` for every function at module load, and each per-function bundle transitively imported `_generated/api.ts` → `_generated/spec.ts` (every spec). A function's cold-start cost now scales with its own group rather than the size of the project.
|
|
1580
|
+
|
|
1581
|
+
### Lazy `FunctionSpec` schemas
|
|
1582
|
+
|
|
1583
|
+
`FunctionSpec.*` (`publicQuery`/`internalQuery`/`publicMutation`/`internalMutation`/`publicAction`/`internalAction`/`publicNodeAction`/`internalNodeAction`) takes `args`, `returns`, and (optional) `error` as `() => Schema` thunks instead of bare schemas. The resulting provenance exposes them as sync lazy memoised getters (the same pattern `Table.make` uses), so importing `_generated/spec.ts` builds no schemas—construction is deferred to the first invocation that compiles validators or runs a codec.
|
|
1584
|
+
|
|
1585
|
+
Migration—wrap each schema in `() =>`:
|
|
1586
|
+
|
|
1587
|
+
```diff
|
|
1588
|
+
FunctionSpec.publicQuery({
|
|
1589
|
+
name: "list",
|
|
1590
|
+
- args: Schema.Struct({}),
|
|
1591
|
+
- returns: Schema.Array(notes.Doc),
|
|
1592
|
+
+ args: () => Schema.Struct({}),
|
|
1593
|
+
+ returns: () => Schema.Array(notes.Doc),
|
|
1594
|
+
})
|
|
1595
|
+
```
|
|
1596
|
+
|
|
1597
|
+
### Impls take the `DatabaseSchema`, and group paths resolve impl-side
|
|
1598
|
+
|
|
1599
|
+
`FunctionImpl.make` and `GroupImpl.make` now take the runtime `DatabaseSchema` (the default export of `_generated/schema.ts`) as their first argument instead of the whole `Api`. The handler's ctx-service types only ever depended on the database schema, and switching impls to import `_generated/schema` instead of `_generated/api` removes `_generated/spec.ts` (and the function specs it transitively imports) from every per-function bundle.
|
|
1600
|
+
|
|
1601
|
+
Each function also registers under a flat, single-segment key into a fresh, isolated `Registry` provided per group by `RegisteredFunctions.buildForGroup` (and the CLI's impl validation), so no group-path lookup against `api.spec` is needed. As a result `Spec#addPath`, `Spec#paths`, and `Api.resolveGroupPathUnsafe` are removed; `GroupImpl`/`FunctionImpl` drop their group-path type parameter; and the codegen-emitted `_generated/spec.ts`/`nodeSpec.ts` no longer contain a `.addPath(...)` chain (the `.addAt(...)`/`.addGroupAt(...)` assembly tree that `Refs.make` consumes is unchanged).
|
|
1602
|
+
|
|
1603
|
+
Migration—in each `*.impl.ts`, import the database schema and pass it where you passed `api`/`nodeApi`:
|
|
1604
|
+
|
|
1605
|
+
```diff
|
|
1606
|
+
- import api from "../_generated/api"; // (or nodeApi from "../_generated/nodeApi")
|
|
1607
|
+
+ import databaseSchema from "../_generated/schema";
|
|
1608
|
+
|
|
1609
|
+
- const insert = FunctionImpl.make(api, notes, "insert", handler);
|
|
1610
|
+
+ const insert = FunctionImpl.make(databaseSchema, notes, "insert", handler);
|
|
1611
|
+
|
|
1612
|
+
- export default GroupImpl.make(api, notes).pipe(Layer.provide(insert), GroupImpl.finalize);
|
|
1613
|
+
+ export default GroupImpl.make(databaseSchema, notes).pipe(Layer.provide(insert), GroupImpl.finalize);
|
|
1614
|
+
```
|
|
1615
|
+
|
|
1616
|
+
Node impls migrate identically (from `nodeApi` to the same `_generated/schema`); only their specs differ (`GroupSpec.makeNode()`). Hand-rolled tests that built a `Spec` via `.addPath(group, "dot.path")` should drop those calls.
|
|
1617
|
+
|
|
1618
|
+
### `buildForGroup` and the generated registries
|
|
1619
|
+
|
|
1620
|
+
`RegisteredFunctions.buildForGroup` takes the `DatabaseSchema` value plus the group's own `GroupSpec` as a single type argument (`buildForGroup<typeof groupSpec>(…)`, returning `RegisteredFunctionsForGroupSpec<Group>`); the `api`/`groupPath` parameters and the `ForGroupPath` dot-path navigation are gone. `RegisteredConvexFunction.make`/`RegisteredNodeFunction.make` take the `DatabaseSchema` rather than the `Api`. Each `_generated/registeredFunctions/{path}.ts` imports the runtime schema and references its group's leaf spec **type-only** (`typeof import("…/{group}.spec")["default"]`), so it never imports a spec module at runtime.
|
|
1621
|
+
|
|
1622
|
+
### `_generated/api.ts`/`nodeApi.ts` are no longer emitted, and `Api` is removed
|
|
1623
|
+
|
|
1624
|
+
Nothing imports them anymore, so `confect codegen` no longer emits `_generated/api.ts`/`_generated/nodeApi.ts` and deletes any copies left over from earlier versions. The `Api` module itself (`@confect/server/Api`—`Api.make`, the `Api` type, `Api.resolveGroupPathUnsafe`, etc.) is **removed entirely**: impls and the generated registries take the `DatabaseSchema` value and the spec directly, so the combined database-schema-plus-spec `Api` is no longer used anywhere.
|
|
1625
|
+
|
|
1626
|
+
### Net effect
|
|
1627
|
+
|
|
1628
|
+
A function's `convex/{path}.ts` bundle now imports only its own group's registry → its own `.impl` + `_generated/schema` (table schemas, built lazily) + its own group's spec. No `_generated/api.ts`, no project-wide `_generated/spec.ts`, and no sibling-group impls/specs. Re-run `confect codegen` after upgrading.
|
|
1629
|
+
|
|
1630
|
+
- 762f7eb: Split the deploy-time Convex schema from the runtime `DatabaseSchema`, make `confect/tables/` the single source of truth—including the table name, which is now derived from the filename—and make per-table schema construction lazy.
|
|
1631
|
+
|
|
1632
|
+
Previously, `confect/schema.ts` was user-authored and `DatabaseSchema` carried a `convexSchemaDefinition` field that was eagerly rebuilt on every `.addTable(...)`. That field was an `O(n²)` allocation for `n` tables, and it forced both the deploy CLI (which only needs `defineSchema(...)`) and the runtime (which only needs the table codec lookup) through the same module—so any runtime function bundle dragged in `convex/server`'s `defineSchema`. Issue 1.
|
|
1633
|
+
|
|
1634
|
+
Codegen now scans `confect/tables/*.ts` (every file must default-export a `Table`) and emits two siblings:
|
|
1635
|
+
- `confect/_generated/schema.ts`—the runtime `DatabaseSchema`, consumed by `_generated/api.ts`. Imports `@confect/server` but never `convex/server`.
|
|
1636
|
+
- `confect/_generated/convexSchema.ts`—the Convex deploy `SchemaDefinition`, re-exported one-line from `convex/schema.ts`. Imports `convex/server` but never `@confect/server`.
|
|
1637
|
+
|
|
1638
|
+
The `convexSchemaDefinition` field is removed from `DatabaseSchema` and `Api`. `TestConfect.layer` now takes the Convex schema definition as a separate argument so it can stay aligned with the deploy artifact without bringing the runtime schema along for the ride.
|
|
1639
|
+
|
|
1640
|
+
### Filename-derived table names
|
|
1641
|
+
|
|
1642
|
+
The table name is now derived from the file's basename—`confect/tables/notes.ts` defines a table called `notes`. `Table.make` no longer accepts a name argument and returns an _unnamed_ `Table` value; codegen invokes that value with the filename to produce the bound table.
|
|
1643
|
+
|
|
1644
|
+
This eliminates a class of subtle infelicities: the file basename and the table name can never drift out of sync, cross-table `_id` references are type-constrained against the actual set of declared tables (catching typos at compile time), and ESM cycle hazards for mutual cross-table `Id` references are gone because authoring files no longer transitively import each other.
|
|
1645
|
+
|
|
1646
|
+
Codegen now emits two new sets of files alongside `_generated/schema.ts` and `_generated/convexSchema.ts`:
|
|
1647
|
+
- `confect/_generated/id.ts`—a single `Id` constructor whose argument is type-constrained to the union of your table names. Use `Id("notes")` everywhere you previously wrote `GenericId.GenericId("notes")`.
|
|
1648
|
+
- `confect/_generated/tables/<name>.ts`—one thin wrapper per table that binds the unnamed value from `confect/tables/<name>.ts` to its filename. This is what other modules (specs, impls, HTTP handlers) default-import to reach a table's `Doc`, `Fields`, and `tableName`.
|
|
1649
|
+
|
|
1650
|
+
Table filenames must be valid JS identifiers, may not start with `_` (Convex reserves underscore-prefixed names for system tables), and may not collide with reserved JS keywords like `import.ts`. Pick a casing convention you like—Confect's example code uses `snake_case` (`notes.ts`, `user_profiles.ts`).
|
|
1651
|
+
|
|
1652
|
+
The bound `Table`'s `name` property has been renamed to `tableName`. This avoids a silent collision with the built-in `Function.prototype.name` that JavaScript carries on every function value (including the new unnamed-callable `UnnamedTable`).
|
|
1653
|
+
|
|
1654
|
+
### Lazy per-table schema construction
|
|
1655
|
+
|
|
1656
|
+
`Table.make` takes a `() => Schema.Struct({...})` callback rather than a bare struct, and a bound `Table`'s `Fields`, `Doc`, and `tableDefinition` are lazy memoised getters that only invoke that callback on first access.
|
|
1657
|
+
|
|
1658
|
+
Previously, every `confect/tables/<name>.ts` module ran `Schema.Struct({...})` (and the corresponding `compileTableSchema`/`defineTable` work) at module-load time. Because the codegen-emitted `_generated/schema.ts` is imported transitively from every per-group function bundle, loading any one function eagerly built _every_ table's schema graph—paying a cold-start cost proportional to the whole project, not just the function being invoked.
|
|
1659
|
+
|
|
1660
|
+
The bound `Table` now exposes `Fields`/`Doc`/`tableDefinition` as lazy getters that compute their value on first access, then replace themselves with a plain non-writable data property so second-and-subsequent accesses are observably indistinguishable from a plain property (and skip all function-call overhead). The result: a function bundle only pays the schema-construction cost for tables it actually touches via `db.table(name)` (which reaches `Fields` through `Document.decode`). The `UnnamedTable` callable no longer exposes `Fields` or `tableDefinition`—read these off the bound `Table` (the generated `_generated/tables/<name>.ts` wrapper already binds the name).
|
|
1661
|
+
|
|
1662
|
+
### Migration
|
|
1663
|
+
1. Delete your `confect/schema.ts`. Codegen will refuse to run while a stray copy is present.
|
|
1664
|
+
2. Rename each `confect/tables/<Name>.ts` to a valid JS identifier in your chosen casing convention (e.g. `confect/tables/notes.ts`). The basename becomes the table name; you no longer pass it as an argument.
|
|
1665
|
+
3. Convert each table file to a **default-export-only** unnamed module: drop the name argument from `Table.make`, wrap the field-schema struct in a `() => ...` callback, and switch any `GenericId.GenericId("users")` references to `Id("users")` imported from `../_generated/id`:
|
|
1666
|
+
|
|
1667
|
+
```diff
|
|
1668
|
+
- import { GenericId } from "@confect/core";
|
|
1669
|
+
import { Table } from "@confect/server";
|
|
1670
|
+
import { Schema } from "effect";
|
|
1671
|
+
+ import { Id } from "../_generated/id";
|
|
1672
|
+
|
|
1673
|
+
- export default Table.make(
|
|
1674
|
+
- "notes",
|
|
1675
|
+
- Schema.Struct({
|
|
1676
|
+
- userId: Schema.optional(GenericId.GenericId("users")),
|
|
1677
|
+
- text: Schema.String,
|
|
1678
|
+
- }),
|
|
1679
|
+
- );
|
|
1680
|
+
+ export default Table.make(() =>
|
|
1681
|
+
+ Schema.Struct({
|
|
1682
|
+
+ userId: Schema.optional(Id("users")),
|
|
1683
|
+
+ text: Schema.String,
|
|
1684
|
+
+ }),
|
|
1685
|
+
+ );
|
|
1686
|
+
```
|
|
1687
|
+
|
|
1688
|
+
4. Rewire every consumer site (specs, impls, integration tests, HTTP handlers, etc.) to import from the generated wrapper rather than directly from `tables/`. The wrapper is also where you now read `Doc`/`Fields`/`tableDefinition` (the unnamed `Table.make(...)` callable no longer exposes them):
|
|
1689
|
+
|
|
1690
|
+
```diff
|
|
1691
|
+
- import Notes from "../tables/Notes";
|
|
1692
|
+
+ import notes from "../_generated/tables/notes";
|
|
1693
|
+
|
|
1694
|
+
- returns: Schema.Array(Notes.Doc),
|
|
1695
|
+
+ returns: Schema.Array(notes.Doc),
|
|
1696
|
+
```
|
|
1697
|
+
|
|
1698
|
+
5. Replace every remaining `GenericId.GenericId("x")` call site with `Id("x")` from `_generated/id` (in spec `args`/`returns`, in `TaggedError` schemas, in `TestConfect.run`, etc.).
|
|
1699
|
+
6. If you read `table.name` anywhere off a bound `Table`, rename it to `table.tableName`.
|
|
1700
|
+
7. Re-run `confect codegen`. It will create `confect/_generated/schema.ts`, `confect/_generated/convexSchema.ts`, `confect/_generated/id.ts`, and one `confect/_generated/tables/<name>.ts` wrapper per table; and it will rewrite `convex/schema.ts` to a one-line re-export.
|
|
1701
|
+
8. If you use `@confect/test`, pass the generated Convex schema definition to `TestConfect.layer`:
|
|
1702
|
+
|
|
1703
|
+
```diff
|
|
1704
|
+
- import confectSchema from "./confect/schema";
|
|
1705
|
+
+ import confectSchema from "./confect/_generated/schema";
|
|
1706
|
+
+ import convexSchema from "./confect/_generated/convexSchema";
|
|
1707
|
+
|
|
1708
|
+
export const layer = TestConfect_.layer(
|
|
1709
|
+
confectSchema,
|
|
1710
|
+
+ convexSchema,
|
|
1711
|
+
import.meta.glob("./convex/**/!(*.*.*)*.*s"),
|
|
1712
|
+
);
|
|
1713
|
+
```
|
|
1714
|
+
|
|
1715
|
+
### New warning: no tables discovered
|
|
1716
|
+
|
|
1717
|
+
If a Confect project has no tables—either `confect/tables/` is missing entirely or it exists but contains no `.ts` files—codegen now emits a yellow `⚠` warning and continues, producing an empty `DatabaseSchema.make()`/`defineSchema({})`. Table-free backends (e.g. action-only proxies, webhook bridges) are still legal; the warning just catches the much more common case of a typoed directory name or files placed at the wrong path. To silence it, add at least one `Table.make(...)` module under `confect/tables/`.
|
|
1718
|
+
|
|
1719
|
+
### New error: invalid table filename
|
|
1720
|
+
|
|
1721
|
+
Codegen now rejects table files whose basename is not a valid JS identifier (e.g. `user-profiles.ts`), starts with `_` (reserved for Convex system tables), or shadows a reserved JS keyword (e.g. `import.ts`). Rename the offending file to fix it—for example, `user-profiles.ts` → `user_profiles.ts` or `userProfiles.ts`.
|
|
1722
|
+
|
|
1723
|
+
### Patch Changes
|
|
1724
|
+
|
|
1725
|
+
- Updated dependencies [46045a9]
|
|
1726
|
+
- Updated dependencies [762f7eb]
|
|
1727
|
+
- @confect/core@9.0.0-next.6
|
|
1728
|
+
|
|
1729
|
+
## 9.0.0-next.5
|
|
1730
|
+
|
|
1731
|
+
### Patch Changes
|
|
1732
|
+
|
|
1733
|
+
- @confect/core@9.0.0-next.5
|
|
1734
|
+
|
|
1735
|
+
## 9.0.0-next.4
|
|
1736
|
+
|
|
1737
|
+
### Patch Changes
|
|
1738
|
+
|
|
1739
|
+
- @confect/core@9.0.0-next.4
|
|
1740
|
+
|
|
1741
|
+
## 9.0.0-next.3
|
|
1742
|
+
|
|
1743
|
+
### Patch Changes
|
|
1744
|
+
|
|
1745
|
+
- 6d85210: Resolve `FunctionImpl`/`GroupImpl` group paths via an immutable `paths` map on `Spec` instead of identity-walking the assembled tree.
|
|
1746
|
+
|
|
1747
|
+
### Why
|
|
1748
|
+
|
|
1749
|
+
Since `9.0.0-next.1`, codegen has wrapped every parent leaf that has sibling subdirectory specs in `<parent>.addGroupAt("child", <child>)`. Because `GroupSpec.addGroupAt` is immutable, that produced a fresh object in the assembled tree, while the parent's `*.impl.ts` continued to hold a reference to the original imported leaf. The runtime resolver compared by `===`, so every such impl failed `validateImpl` with "Could not resolve group path for the provided GroupSpec." Child impls happened to work only because `GroupSpec.withName` was secretly mutating its argument in place to keep the child's identity stable—an asymmetry that was load-bearing for one half of the API and broken for the other.
|
|
1750
|
+
|
|
1751
|
+
### What changed
|
|
1752
|
+
- `@confect/core/Spec` carries a new `readonly paths: ReadonlyMap<GroupSpec.AnyWithProps, string>` field and exposes a chainable `Spec#addPath(group, path)` builder. `add`/`addAt`/`merge` propagate `paths` unchanged; `merge` re-prefixes a node spec's entries with `"node."` to match the merged tree.
|
|
1753
|
+
- `@confect/core/GroupSpec.withName` is now pure: it returns a fresh copy when the name differs and no longer rewrites the input in place. No new identity-tracking machinery is introduced.
|
|
1754
|
+
- `@confect/server/FunctionImpl.make` and `GroupImpl.make` resolve their group path via `api.spec.paths.get(group)`—an O(1) map lookup instead of a tree walk—and throw a clearer error pointing at `Spec.addPath` when the spec hasn't been registered.
|
|
1755
|
+
- `@confect/server/GroupPath` (the old identity-based resolver) is deleted.
|
|
1756
|
+
- `@confect/cli` codegen emits one `.addPath(<binding>, "<dot.path>")` call per leaf in `_generated/spec.ts` (and `_generated/nodeSpec.ts`) so the imported leaves carry their full paths into the assembled spec value.
|
|
1757
|
+
|
|
1758
|
+
### User-facing impact
|
|
1759
|
+
- Spec authoring (`*.spec.ts`) and impl authoring (`*.impl.ts`) APIs are unchanged. `FunctionImpl.make(api, spec, name, handler)` and `GroupImpl.make(api, spec)` keep their exact signatures.
|
|
1760
|
+
- Generated `_generated/spec.ts` (and `_generated/nodeSpec.ts`) pick up one `.addPath(...)` chain entry per leaf on the next `confect codegen` run. The shape is fully immutable—no module-load mutation, no hidden side effects.
|
|
1761
|
+
- Hand-rolled tests that construct a `Spec` and pass it to `Api.make` must now also call `.addPath(spec, "dot.path")` for any group they intend to look up.
|
|
1762
|
+
|
|
1763
|
+
### Fixes
|
|
1764
|
+
|
|
1765
|
+
This eliminates the runtime regression introduced in `9.0.0-next.1` for any project layout where a `confect/{path}.spec.ts` declares functions alongside a sibling `confect/{path}/` subdirectory of further specs.
|
|
1766
|
+
|
|
1767
|
+
- Updated dependencies [6d85210]
|
|
1768
|
+
- @confect/core@9.0.0-next.3
|
|
1769
|
+
|
|
1770
|
+
## 9.0.0-next.2
|
|
1771
|
+
|
|
1772
|
+
### Patch Changes
|
|
1773
|
+
|
|
1774
|
+
- @confect/core@9.0.0-next.2
|
|
1775
|
+
|
|
1776
|
+
## 9.0.0-next.1
|
|
1777
|
+
|
|
1778
|
+
### Patch Changes
|
|
1779
|
+
|
|
1780
|
+
- @confect/core@9.0.0-next.1
|
|
1781
|
+
|
|
1782
|
+
## 9.0.0-next.0
|
|
1783
|
+
|
|
1784
|
+
### Major Changes
|
|
1785
|
+
|
|
1786
|
+
- 6db3a3a: Derive Confect function paths from the filesystem layout of `confect/`. Each group lives in a colocated `*.spec.ts`/`*.impl.ts` pair, and the group's name is its path within `confect/` (file stem for top-level groups, dot-joined directory path for nested groups). See [Project Structure](https://confect.dev/concepts/project-structure), [File Naming Conventions](https://confect.dev/concepts/file-naming-conventions), and [The Spec/Impl Model](https://confect.dev/concepts/spec-impl-model) for the current model.
|
|
1787
|
+
|
|
1788
|
+
Each `*.spec.ts` default-exports its `GroupSpec`. Each `*.impl.ts` default-imports its sibling spec, builds its `GroupImpl`, and default-exports the result of `GroupImpl.finalize`. Named co-exports on `*.spec.ts` (such as error classes) remain allowed.
|
|
1789
|
+
|
|
1790
|
+
### Why
|
|
1791
|
+
|
|
1792
|
+
The previous model assembled every group's impl into a single root `confect/impl.ts` (plus `confect/nodeImpl.ts`), which `confect codegen` emitted as the aggregate `_generated/registeredFunctions.ts`. Every generated `convex/` module—one per Convex function—imported from that aggregate, so loading any single query, mutation, or action transitively loaded the impl module of every other Convex function in the project, along with all of their dependencies. For large projects this inflated each function's bundle and added meaningful cold-start cost on Convex.
|
|
1793
|
+
|
|
1794
|
+
Splitting impl across colocated `*.impl.ts` files is the vehicle for fixing that. With this change, `confect codegen` emits one `_generated/registeredFunctions/{path}.ts` per group, and each generated `convex/` module imports only its own group's per-group registry—which in turn imports only its own sibling `.impl.ts`. A Convex function's cold-start bundle now scales with its own group's impl rather than with the size of the whole project.
|
|
1795
|
+
|
|
1796
|
+
### Breaking changes
|
|
1797
|
+
- `GroupSpec.make()` and `GroupSpec.makeNode()` no longer take a name argument; the group name is derived from the spec file's path within `confect/`.
|
|
1798
|
+
- `FunctionImpl.make(api, groupSpec, fn, handler)` and `GroupImpl.make(api, groupSpec)` now take the imported sibling spec object as their second argument instead of a dot-path string.
|
|
1799
|
+
- Every `GroupImpl` pipeline must end with `GroupImpl.finalize`, which only typechecks once every function declared by the spec has a corresponding `FunctionImpl` provided to the group layer. `GroupImpl.finalize` snapshots the names of every registered function onto the produced `Finalized` `GroupImpl` service value, and `confect codegen` reads those names to verify per-function coverage against the spec at runtime.
|
|
1800
|
+
- The previously-exported `Impl.make` and `Impl.finalize` (used by the old root `impl.ts`/`nodeImpl.ts` files) are removed. Per-group completeness is now enforced by `GroupImpl.finalize`.
|
|
1801
|
+
- Root `confect/spec.ts`, `confect/impl.ts`, `confect/nodeSpec.ts`, `confect/nodeImpl.ts`, and any parent aggregator `*.spec.ts`/`*.impl.ts` files are no longer used. `confect codegen` deletes any of these on upgrade, along with the stale `_generated/registeredFunctions.ts` and `_generated/nodeRegisteredFunctions.ts`.
|
|
1802
|
+
- Every module under `convex/` is re-emitted to import from `_generated/registeredFunctions/{path}` instead of the previous aggregate file. Users who commit `convex/` to source control should expect a full rewrite of that directory on first codegen.
|
|
1803
|
+
|
|
1804
|
+
### Migration
|
|
1805
|
+
1. For each existing group, create a colocated `confect/{path}.spec.ts` and `confect/{path}.impl.ts` pair (under a subdirectory for nested groups).
|
|
1806
|
+
- In each spec, call `GroupSpec.make()` (or `GroupSpec.makeNode()`) without a name and `export default` the result.
|
|
1807
|
+
- In each impl, default-import the sibling spec (e.g. `import notes from "./notes.spec"`), pass it to `FunctionImpl.make`/`GroupImpl.make` in place of the previous dot-path string, append `GroupImpl.finalize` to the pipeline, and `export default` the resulting `GroupImpl` layer:
|
|
1808
|
+
```ts
|
|
1809
|
+
export default GroupImpl.make(api, notes).pipe(
|
|
1810
|
+
Layer.provide(list),
|
|
1811
|
+
Layer.provide(insert),
|
|
1812
|
+
GroupImpl.finalize,
|
|
1813
|
+
);
|
|
1814
|
+
```
|
|
1815
|
+
2. Delete root `confect/spec.ts`, `confect/impl.ts`, `confect/nodeSpec.ts`, `confect/nodeImpl.ts`, and any parent aggregator spec/impl files. (`confect codegen` will also delete any of these it finds, plus the stale `_generated/registeredFunctions.ts` and `_generated/nodeRegisteredFunctions.ts`, so this step can be skipped.)
|
|
1816
|
+
3. Run `confect codegen`. Every module under `convex/` will be re-emitted.
|
|
1817
|
+
|
|
1818
|
+
### Patch Changes
|
|
1819
|
+
|
|
1820
|
+
- Updated dependencies [6db3a3a]
|
|
1821
|
+
- @confect/core@9.0.0-next.0
|
|
1822
|
+
|
|
1823
|
+
## 8.0.0
|
|
1824
|
+
|
|
1825
|
+
### Major Changes
|
|
1826
|
+
|
|
1827
|
+
- 87b7207: Renamed `DatabaseSchema.isSchema` to `DatabaseSchema.isDatabaseSchema` for consistency with the `is<TypeName>` predicate convention used elsewhere (e.g. `Spec.isSpec`). `TypeId` and `Any` are now defined in `@confect/core/DatabaseSchema` and re-exported from `@confect/server`; the underlying brand string is unchanged, so existing schema values continue to be recognized. Migration: replace `DatabaseSchema.isSchema(x)` with `DatabaseSchema.isDatabaseSchema(x)`.
|
|
1828
|
+
|
|
1829
|
+
Internally, this removes a cyclic workspace dependency between `@confect/cli` and `@confect/server` that triggered a pnpm install warning. `@confect/cli` no longer peer-depends on `@confect/server`.
|
|
1830
|
+
|
|
1831
|
+
### Minor Changes
|
|
1832
|
+
|
|
1833
|
+
- 4bb2722: Bump Effect ecosystem to latest. `@effect/platform` is now `^0.96.1` and `@effect/platform-node` is now `^0.106.0` in `@confect/server`'s peer dependencies; `effect` peer is now `^3.21.2` across packages. Consumers must upgrade `@effect/platform`, `@effect/platform-node`, and `effect` in lockstep when bumping `@confect/server`.
|
|
1834
|
+
|
|
1835
|
+
### Patch Changes
|
|
1836
|
+
|
|
1837
|
+
- f308edd: Fix Convex query cache invalidation when handlers use `Effect.log`, `Effect.withSpan`, or other Effect features that read the clock through its `unsafe*` methods.
|
|
1838
|
+
|
|
1839
|
+
The `Clock` provided to confect-wrapped handlers previously implemented `unsafeCurrentTimeMillis`/`unsafeCurrentTimeNanos` by calling the real `Date.now`, so Effect internals (logging, span events, the default scheduler) would read real time during handler execution and invalidate Convex's per-query cache. Those unsafe methods now return constants (`0`/`0n`), making the only opt-in to cache invalidation the user-facing `Clock.currentTimeMillis`/`Clock.currentTimeNanos` effects, as originally intended.
|
|
1840
|
+
|
|
1841
|
+
- a02ef8a: Memoize `Document.decode` and `Document.encode` parsers in module-scoped `WeakMap` caches. Decoders are keyed by table schema and table name so shared schemas across tables get the correct `extendWithSystemFields` parser; encoders are keyed by schema only.
|
|
1842
|
+
- 40c1cff: Switch sibling `@confect/*` peer-dependency specifiers from `workspace:*` to `workspace:^`. Published peer ranges are now caret-based (e.g. `^7.0.0`) instead of exact-pinned, so non-major upgrades of one `@confect/*` package no longer fall out of range for its peer dependents.
|
|
1843
|
+
|
|
1844
|
+
Paired with the Changesets `onlyUpdatePeerDependentsWhenOutOfRange` flag, this prevents the entire `@confect/*` family from being promoted to a major bump on every release when only minor/patch changes are present.
|
|
1845
|
+
|
|
1846
|
+
`@confect/cli` additionally moves `@effect/platform` from `peerDependencies` to `dependencies`, since the CLI consumes it as an internal implementation detail (for `FileSystem`/`Path`) rather than exposing it in its public API. Consumers no longer need to install `@effect/platform` themselves to use the CLI.
|
|
1847
|
+
|
|
1848
|
+
- Updated dependencies [4bb2722]
|
|
1849
|
+
- Updated dependencies [40c1cff]
|
|
1850
|
+
- @confect/core@8.0.0
|
|
1851
|
+
|
|
1852
|
+
## 7.0.0
|
|
1853
|
+
|
|
1854
|
+
### Minor Changes
|
|
1855
|
+
|
|
1856
|
+
- 90094d0: Add typed errors to Confect functions (queries, mutations, and actions). Declare an optional `error` schema in `FunctionSpec` and recover it as a typed value at every call site—`useQuery`, `useMutation`, `useAction`, `HttpClient`, `WebSocketClient`, and `TestConfect`—without paying for it on functions that don't fail.
|
|
1857
|
+
|
|
1858
|
+
Typed errors travel across the function boundary as Convex's native [`ConvexError`](https://docs.convex.dev/functions/error-handling/application-errors#throwing-application-errors): the encoded error sits in `ConvexError.data`, leaving the `returns` channel unsullied and preserving native Convex semantics for non-Confect callers of the same API.
|
|
1859
|
+
|
|
1860
|
+
### Authoring a function with typed errors
|
|
1861
|
+
|
|
1862
|
+
`FunctionSpec` constructors now accept an optional `error` schema. To support multiple error shapes, combine them with `Schema.Union`.
|
|
1863
|
+
|
|
1864
|
+
```ts
|
|
1865
|
+
import { FunctionSpec, GenericId, GroupSpec } from "@confect/core";
|
|
1866
|
+
import { Schema } from "effect";
|
|
1867
|
+
|
|
1868
|
+
export class NoteNotFound extends Schema.TaggedError<NoteNotFound>()(
|
|
1869
|
+
"NoteNotFound",
|
|
1870
|
+
{ noteId: GenericId.GenericId("notes") },
|
|
1871
|
+
) {}
|
|
1872
|
+
|
|
1873
|
+
export const notes = GroupSpec.make("notes").addFunction(
|
|
1874
|
+
FunctionSpec.publicQuery({
|
|
1875
|
+
name: "getOrFail",
|
|
1876
|
+
args: Schema.Struct({ noteId: GenericId.GenericId("notes") }),
|
|
1877
|
+
returns: Notes.Doc,
|
|
1878
|
+
error: NoteNotFound,
|
|
1879
|
+
}),
|
|
1880
|
+
);
|
|
1881
|
+
```
|
|
1882
|
+
|
|
1883
|
+
The `FunctionImpl` for that ref can now `Effect.fail` (or `mapError` to) any value matching the declared schema. Whichever invocation path the caller takes—`useQuery`/`useMutation`/`useAction`, `HttpClient`, `WebSocketClient`, or `TestConfect`—Confect encodes the failure, transports it via `ConvexError`, and surfaces the decoded value in the appropriate channel for that call site.
|
|
1884
|
+
|
|
1885
|
+
```ts
|
|
1886
|
+
import { FunctionImpl } from "@confect/server";
|
|
1887
|
+
import { Effect } from "effect";
|
|
1888
|
+
import api from "../_generated/api";
|
|
1889
|
+
import { DatabaseReader } from "../_generated/services";
|
|
1890
|
+
import { NoteNotFound } from "./notes.spec";
|
|
1891
|
+
|
|
1892
|
+
const getOrFail = FunctionImpl.make(api, "notes", "getOrFail", ({ noteId }) =>
|
|
1893
|
+
Effect.gen(function* () {
|
|
1894
|
+
const reader = yield* DatabaseReader;
|
|
1895
|
+
return yield* reader
|
|
1896
|
+
.table("notes")
|
|
1897
|
+
.get(noteId)
|
|
1898
|
+
.pipe(Effect.mapError(() => new NoteNotFound({ noteId })));
|
|
1899
|
+
}),
|
|
1900
|
+
);
|
|
1901
|
+
```
|
|
1902
|
+
|
|
1903
|
+
### Consuming a typed error
|
|
1904
|
+
|
|
1905
|
+
`@confect/js` (`HttpClient`, `WebSocketClient`) and `@confect/test` (`TestConfect`) surface the decoded error in the `Effect` error channel alongside the existing `HttpClientError`/`WebSocketClientError`/`ParseError`:
|
|
1906
|
+
|
|
1907
|
+
```ts
|
|
1908
|
+
HttpClient.query(refs.public.notes.getOrFail, { noteId });
|
|
1909
|
+
// Effect.Effect<Note, NoteNotFound | HttpClientError | ParseError>
|
|
1910
|
+
```
|
|
1911
|
+
|
|
1912
|
+
### `@confect/react`—breaking changes
|
|
1913
|
+
|
|
1914
|
+
`useQuery`, `useMutation`, and `useAction` now expose typed errors, and `useQuery` returns a tagged result type instead of `Returns | undefined`.
|
|
1915
|
+
|
|
1916
|
+
**`useQuery` now returns `QueryResult<A, E>`.** Loading and (when an `error` schema is declared) failure are reified as variants alongside success. Match on the result with `QueryResult.match`:
|
|
1917
|
+
|
|
1918
|
+
Before:
|
|
1919
|
+
|
|
1920
|
+
```tsx
|
|
1921
|
+
const notes = useQuery(refs.public.notes.list, {});
|
|
1922
|
+
if (notes === undefined) return <p>Loading…</p>;
|
|
1923
|
+
return <NoteList notes={notes} />;
|
|
1924
|
+
```
|
|
1925
|
+
|
|
1926
|
+
After:
|
|
1927
|
+
|
|
1928
|
+
```tsx
|
|
1929
|
+
import { QueryResult, useQuery } from "@confect/react";
|
|
1930
|
+
|
|
1931
|
+
const notes = useQuery(refs.public.notes.list, {});
|
|
1932
|
+
return QueryResult.match(notes, {
|
|
1933
|
+
onLoading: (skipped) => (skipped ? null : <p>Loading…</p>),
|
|
1934
|
+
onSuccess: (notes) => <NoteList notes={notes} />,
|
|
1935
|
+
});
|
|
1936
|
+
```
|
|
1937
|
+
|
|
1938
|
+
The `Loading` variant carries a `skipped: boolean` flag, exposed as the argument to `onLoading`. It distinguishes a query that is genuinely in flight (`skipped: false`) from one that is sitting idle because `"skip"` was passed as its args (`skipped: true`)—a distinction `convex/react`'s plain `undefined` return value cannot make. Use it to render a loading indicator only when work is actually happening, and an empty/placeholder state otherwise.
|
|
1939
|
+
|
|
1940
|
+
When the ref declares an `error` schema, `onFailure` becomes required and receives the decoded typed error:
|
|
1941
|
+
|
|
1942
|
+
```tsx
|
|
1943
|
+
const lookup = useQuery(refs.public.notes.getOrFail, { noteId });
|
|
1944
|
+
QueryResult.match(lookup, {
|
|
1945
|
+
onLoading: (skipped) => (skipped ? null : "Looking up…"),
|
|
1946
|
+
onSuccess: (note) => `Found: ${note.text}`,
|
|
1947
|
+
onFailure: (error) => `Note ${error.noteId} not found.`,
|
|
1948
|
+
});
|
|
1949
|
+
```
|
|
1950
|
+
|
|
1951
|
+
`QueryResult` is a Confect-native type exported from `@confect/react`.
|
|
1952
|
+
|
|
1953
|
+
**`useMutation` and `useAction` return `Promise<Either<A, E>>` when the ref declares an `error` schema.** Refs without an `error` schema continue to resolve to `Promise<A>`, matching the prior shape and `convex/react`'s behavior.
|
|
1954
|
+
|
|
1955
|
+
```ts
|
|
1956
|
+
const deleteOrFail = useMutation(refs.public.notes.deleteOrFail);
|
|
1957
|
+
const result = await deleteOrFail({ noteId });
|
|
1958
|
+
// Either.Either<null, NoteNotFound | Forbidden>
|
|
1959
|
+
Either.match(result, {
|
|
1960
|
+
onLeft: (error) => /* typed error */,
|
|
1961
|
+
onRight: (value) => /* success */,
|
|
1962
|
+
});
|
|
1963
|
+
|
|
1964
|
+
const deleteNote = useMutation(refs.public.notes.delete_); // no `error` schema
|
|
1965
|
+
await deleteNote({ noteId }); // Promise<null>, as before
|
|
1966
|
+
```
|
|
1967
|
+
|
|
1968
|
+
Unspecified failures continue to reject the promise.
|
|
1969
|
+
|
|
1970
|
+
### Migration
|
|
1971
|
+
- For each `useQuery` call site, replace `result === undefined` checks and direct property access with `QueryResult.match` (or the lower-level `QueryResult.isLoading`/`isSuccess`/`isFailure` predicates).
|
|
1972
|
+
- For each `useMutation`/`useAction` call site whose ref now declares an `error` schema, unwrap the resolved `Either` (e.g. with `Either.match`); call sites against refs without an `error` schema need no change.
|
|
1973
|
+
|
|
1974
|
+
### Patch Changes
|
|
1975
|
+
|
|
1976
|
+
- Updated dependencies [90094d0]
|
|
1977
|
+
- @confect/core@7.0.0
|
|
1978
|
+
|
|
1979
|
+
## 6.0.0
|
|
1980
|
+
|
|
1981
|
+
### Major Changes
|
|
1982
|
+
|
|
1983
|
+
- 228589b: Fixed an issue where the cached value for any Confect query would be regularly busted by a hidden Effect dependency on `Date.now()`. This has been solved by stubbing `Date.now()` to always return the Unix epoch (`0`). If you previously relied on `Date.now()` in your queries, (1) try to rewrite them to avoid it (see [Convex best practices](https://docs.convex.dev/understanding/best-practices/#date-in-queries) on using dates in queries), or (2) use Effect's `Clock` service, which will still return an unstubbed timestamp.
|
|
1984
|
+
|
|
1985
|
+
### Minor Changes
|
|
1986
|
+
|
|
1987
|
+
- df95ce7: Add `Ref.OptionalArgs` type utility to `@confect/core` for conditionally optional function args. `QueryRunner`, `MutationRunner`, and `ActionRunner` now accept optional args for no-arg Confect functions. `useQuery`, `useMutation`, and `useAction` now accept optional args for no-arg Confect functions. `TestConfect` `query`/`mutation`/`action` helpers now accept optional args for no-arg Confect functions.
|
|
1988
|
+
|
|
1989
|
+
### Patch Changes
|
|
1990
|
+
|
|
1991
|
+
- a8083e8: Fix table field path inference when a schema has a `name` field and an optional Convex ID or bytes field.
|
|
1992
|
+
- Updated dependencies [df95ce7]
|
|
1993
|
+
- Updated dependencies [a8083e8]
|
|
1994
|
+
- @confect/core@6.0.0
|
|
1995
|
+
|
|
1996
|
+
## 5.0.0
|
|
1997
|
+
|
|
1998
|
+
### Minor Changes
|
|
1999
|
+
|
|
2000
|
+
- 8853cbf: Update `Scheduler` to accept Confect `Ref`s instead of Convex `SchedulableFunctionReference` values. `runAfter` and `runAt` now take a `Ref` to a mutation or action with typed args, aligning the Scheduler API with all other Confect function-calling APIs.
|
|
2001
|
+
|
|
2002
|
+
### Patch Changes
|
|
2003
|
+
|
|
2004
|
+
- @confect/core@5.0.0
|
|
2005
|
+
|
|
2006
|
+
## 4.0.0
|
|
2007
|
+
|
|
2008
|
+
### Major Changes
|
|
2009
|
+
|
|
2010
|
+
- 60be7e6: Add Effect-native cron job support via new `CronJob` and `CronJobs` modules.
|
|
2011
|
+
|
|
2012
|
+
Cron jobs are now defined using Effect's `Cron` (cron expressions) or `Duration` (fixed intervals) types instead of the vanilla Convex `cronJobs()` API. `CronJob.make` creates individual jobs with a unique identifier, schedule, and ref to an internal mutation or action. `CronJobs.make()` creates an empty collection with a chainable `.add()` method.
|
|
2013
|
+
|
|
2014
|
+
Interval schedules are represented in the largest whole unit possible (hours > minutes > seconds) to avoid floating-point precision issues with large durations.
|
|
2015
|
+
|
|
2016
|
+
- 8ae4d51: Standardize all Effect service tags to a consistent `@confect/{package}/{ServiceName}` format.
|
|
2017
|
+
|
|
2018
|
+
The `Storage` namespace export has been removed from `@confect/server`. `StorageReader`, `StorageWriter`, `StorageActionWriter`, and `BlobNotFoundError` are now exported as individual top-level namespaces. Replace `Storage.StorageReader` with `StorageReader.StorageReader`, etc. After upgrading, rerun `confect codegen` to regenerate the `services.ts` file.
|
|
2019
|
+
|
|
2020
|
+
### Minor Changes
|
|
2021
|
+
|
|
2022
|
+
- 641fd99: Add optional `filter` parameter to `OrderedQuery.paginate`. This allows applying a Convex filter directly at the pagination level—the one scenario where `.filter()` is recommended over index-based filtering. The filter callback receives a `FilterBuilder` and is applied to the underlying query before paginating.
|
|
2023
|
+
|
|
2024
|
+
### Patch Changes
|
|
2025
|
+
|
|
2026
|
+
- @confect/core@4.0.0
|
|
2027
|
+
|
|
2028
|
+
## 3.0.0
|
|
2029
|
+
|
|
2030
|
+
### Minor Changes
|
|
2031
|
+
|
|
2032
|
+
- 5fb6a61: Add support for plain Convex functions. Plain Convex queries, mutations, and actions can now be included in your Confect spec and impl tree using new `FunctionSpec.convexPublic*` and `FunctionSpec.convexInternal*` constructors. This enables interop with Convex components and libraries (such as Workpool, Workflow, Migrations, and Better Auth) that require user-defined or -provided Convex functions.
|
|
2033
|
+
|
|
2034
|
+
### Patch Changes
|
|
2035
|
+
|
|
2036
|
+
- Updated dependencies [5fb6a61]
|
|
2037
|
+
- @confect/core@3.0.0
|
|
2038
|
+
|
|
2039
|
+
## 2.0.0
|
|
2040
|
+
|
|
2041
|
+
### Minor Changes
|
|
2042
|
+
|
|
2043
|
+
- f78c58a: Add support for `Config` usage in Convex runtime functions. Effect's default `ConfigProvider` doesn't work because `process.env` is not enumerable in the Convex runtime. The new `ConvexConfigProvider` supports the same options as Effect's default `ConfigProvider.fromEnv`, but is also provided to Convex runtime functions by default. Configs which require enumeration are still unsupported, until/unless this Convex runtime limitation is removed.
|
|
2044
|
+
|
|
2045
|
+
### Patch Changes
|
|
2046
|
+
|
|
2047
|
+
- 69ce9c9: Improve type-checking performance of `SchemaToValidator` compilation.
|
|
2048
|
+
- @confect/core@2.0.0
|
|
2049
|
+
|
|
2050
|
+
## 1.0.3
|
|
2051
|
+
|
|
2052
|
+
### Patch Changes
|
|
2053
|
+
|
|
2054
|
+
- @confect/core@1.0.3
|
|
2055
|
+
|
|
2056
|
+
## 1.0.2
|
|
2057
|
+
|
|
2058
|
+
### Patch Changes
|
|
2059
|
+
|
|
2060
|
+
- c4f9d67: Fix return types of `MutationRunner` and `ActionRunner` services
|
|
2061
|
+
- @confect/core@1.0.2
|
|
2062
|
+
|
|
2063
|
+
## 1.0.1
|
|
2064
|
+
|
|
2065
|
+
### Patch Changes
|
|
2066
|
+
|
|
2067
|
+
- Updated dependencies [00b12a0]
|
|
2068
|
+
- @confect/core@1.0.1
|
|
2069
|
+
|
|
2070
|
+
## 1.0.0
|
|
2071
|
+
|
|
2072
|
+
### Major Changes
|
|
2073
|
+
|
|
2074
|
+
- 2ff70a7: Initial release.
|
|
2075
|
+
|
|
2076
|
+
## 1.0.0-next.4
|
|
2077
|
+
|
|
2078
|
+
### Patch Changes
|
|
2079
|
+
|
|
2080
|
+
- 46109fb: Support Node actions
|
|
2081
|
+
- Updated dependencies [46109fb]
|
|
2082
|
+
- @confect/core@1.0.0-next.4
|
|
2083
|
+
|
|
2084
|
+
## 1.0.0-next.3
|
|
2085
|
+
|
|
2086
|
+
### Patch Changes
|
|
2087
|
+
|
|
2088
|
+
- 9cd3cda: `confect/_generated/refs.ts` now default exports the `Refs` object, which now contains `public` and `internal` fields for each corresponding collection of Confect functions
|
|
2089
|
+
- 186c130: `FunctionSpec.query` becomes `FunctionSpec.publicQuery`, same for mutations and actions
|
|
2090
|
+
- Updated dependencies [9cd3cda]
|
|
2091
|
+
- Updated dependencies [186c130]
|
|
2092
|
+
- @confect/core@1.0.0-next.3
|
|
2093
|
+
|
|
2094
|
+
## 1.0.0-next.2
|
|
2095
|
+
|
|
2096
|
+
### Patch Changes
|
|
2097
|
+
|
|
2098
|
+
- 071b6ed: Upgrade deps
|
|
2099
|
+
- afc9fb4: Refactor `DatabaseWriter` API to match `DatabaseReader` (`writer.insert("notes", { text })` becomes `writer.table("notes").insert({ text })`, and so on)
|
|
2100
|
+
- Updated dependencies [071b6ed]
|
|
2101
|
+
- @confect/core@1.0.0-next.2
|
|
2102
|
+
|
|
2103
|
+
## 1.0.0-next.1
|
|
2104
|
+
|
|
2105
|
+
### Patch Changes
|
|
2106
|
+
|
|
2107
|
+
- Updated dependencies [5a4127f]
|
|
2108
|
+
- @confect/core@1.0.0-next.1
|
|
2109
|
+
|
|
2110
|
+
## 1.0.0-next.0
|
|
2111
|
+
|
|
2112
|
+
### Major Changes
|
|
2113
|
+
|
|
2114
|
+
- 2ff70a7: Initial release.
|
|
2115
|
+
|
|
2116
|
+
### Patch Changes
|
|
2117
|
+
|
|
2118
|
+
- Updated dependencies [2ff70a7]
|
|
2119
|
+
- @confect/core@1.0.0-next.0
|