Skip to content

Commit b0e5a41

Browse files
sshaderConvex, Inc.
authored and
Convex, Inc.
committed
Clean up some deprecated type in our npm package (#23044)
These are things like `DatabaseReader` which have been replaced with `GenericDatabaseReader` (and the codegen-ed data model specific `DatabaseReader`). This is a breaking change, but one I believe we should be fine with (some TS users will have to update their types as part of upgrading, the types have been marked deprecated for several months). GitOrigin-RevId: 4326460172b5f8435a3e567f01ac57a2d1206c1b
1 parent 11273c4 commit b0e5a41

File tree

5 files changed

+11
-88
lines changed

5 files changed

+11
-88
lines changed

npm-packages/convex/src/browser/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
export { BaseConvexClient } from "./sync/client.js";
2020
export type {
21-
ClientOptions,
2221
BaseConvexClientOptions,
2322
MutationOptions,
2423
SubscribeOptions,

npm-packages/convex/src/browser/sync/client.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,6 @@ import { getMarksReport, mark, MarkName } from "./metrics.js";
3939
import { parseArgs, validateDeploymentUrl } from "../../common/index.js";
4040
import { ConvexError } from "../../values/errors.js";
4141

42-
/**
43-
* Options for {@link BaseConvexClient}.
44-
*
45-
* @deprecated Use ConvexReactClientOptions, ConvexClientOptions, or BaseConvexClientOptions.
46-
*
47-
* @public
48-
*/
49-
export interface ClientOptions extends BaseConvexClientOptions {}
50-
5142
/**
5243
* Options for {@link BaseConvexClient}.
5344
*
@@ -680,12 +671,6 @@ export class BaseConvexClient {
680671
return this.webSocketManager.stop();
681672
}
682673

683-
private _logVerbose(message: string) {
684-
if (this.verbose) {
685-
console.debug(`${new Date().toISOString()} ${message}`);
686-
}
687-
}
688-
689674
// Instance property so that `mark()` doesn't need to be called as a method.
690675
private mark = (name: MarkName) => {
691676
if (this.debug) {

npm-packages/convex/src/server/database.ts

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ import {
1212
WithoutSystemFields,
1313
} from "./system_fields.js";
1414

15-
/**
16-
*
17-
* @deprecated If you're using code generation, use the `DatabaseReader` type in
18-
* `convex/_generated/server.d.ts` which is typed for your data model.
19-
* If you need an unparameterized DatabaseReader use GenericDatabaseReader.
20-
*
21-
* @public
22-
*/
23-
export interface DatabaseReader<DataModel extends GenericDataModel>
24-
extends BaseDatabaseReader<DataModel> {}
25-
2615
interface BaseDatabaseReader<DataModel extends GenericDataModel> {
2716
/**
2817
* Fetch a single document from the database by its {@link values.GenericId}.
@@ -79,7 +68,7 @@ interface BaseDatabaseReader<DataModel extends GenericDataModel> {
7968
* @public
8069
*/
8170
export interface GenericDatabaseReader<DataModel extends GenericDataModel>
82-
extends DatabaseReader<DataModel> {
71+
extends BaseDatabaseReader<DataModel> {
8372
/**
8473
* An interface to read from the system tables within Convex query functions
8574
*
@@ -94,13 +83,20 @@ export interface GenericDatabaseReader<DataModel extends GenericDataModel>
9483
}
9584

9685
/**
97-
* @deprecated If you're using code generation, use the `DatabaseWriter` type in
86+
* An interface to read from and write to the database within Convex mutation
87+
* functions.
88+
*
89+
* Convex guarantees that all writes within a single mutation are
90+
* executed atomically, so you never have to worry about partial writes leaving
91+
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
92+
* for the guarantees Convex provides your functions.
93+
*
94+
* If you're using code generation, use the `DatabaseReader` type in
9895
* `convex/_generated/server.d.ts` which is typed for your data model.
99-
* If you need an unparameterized DatabaseWriter use GenericDatabaseWriter.
10096
*
10197
* @public
10298
*/
103-
export interface DatabaseWriter<DataModel extends GenericDataModel>
99+
export interface GenericDatabaseWriter<DataModel extends GenericDataModel>
104100
extends GenericDatabaseReader<DataModel> {
105101
/**
106102
* Insert a new document into a table.
@@ -149,20 +145,3 @@ export interface DatabaseWriter<DataModel extends GenericDataModel>
149145
*/
150146
delete(id: GenericId<TableNamesInDataModel<DataModel>>): Promise<void>;
151147
}
152-
153-
/**
154-
* An interface to read from and write to the database within Convex mutation
155-
* functions.
156-
*
157-
* Convex guarantees that all writes within a single mutation are
158-
* executed atomically, so you never have to worry about partial writes leaving
159-
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
160-
* for the guarantees Convex provides your functions.
161-
*
162-
* If you're using code generation, use the `DatabaseReader` type in
163-
* `convex/_generated/server.d.ts` which is typed for your data model.
164-
*
165-
* @public
166-
*/
167-
export interface GenericDatabaseWriter<DataModel extends GenericDataModel>
168-
extends DatabaseWriter<DataModel> {}

npm-packages/convex/src/server/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export * from "./pagination.js";
101101
export type { OrderedQuery, Query, QueryInitializer } from "./query.js";
102102
export type {
103103
ActionBuilder,
104-
ActionCtx,
105104
ArgsArray,
106105
DefaultFunctionArgs,
107106
HttpActionBuilder,
@@ -111,12 +110,10 @@ export type {
111110
GenericQueryCtx,
112111
MutationBuilder,
113112
PublicHttpAction,
114-
MutationCtx,
115113
RegisteredAction,
116114
RegisteredMutation,
117115
RegisteredQuery,
118116
QueryBuilder,
119-
QueryCtx,
120117
UnvalidatedFunction,
121118
ValidatedFunction,
122119
} from "./registration.js";

npm-packages/convex/src/server/registration.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,6 @@ export interface GenericMutationCtx<DataModel extends GenericDataModel> {
5656
scheduler: Scheduler;
5757
}
5858

59-
/**
60-
* If you're using code generation, use the `MutationCtx` type in
61-
* `convex/_generated/server.d.ts` which is typed for your data model.
62-
*
63-
* If you need an unparameterized MutationCtx use GenericMutationCtx.
64-
*
65-
* @public
66-
* @deprecated
67-
*/
68-
export interface MutationCtx<DataModel extends GenericDataModel>
69-
extends GenericMutationCtx<DataModel> {}
70-
7159
/**
7260
* A set of services for use within Convex query functions.
7361
*
@@ -97,18 +85,6 @@ export interface GenericQueryCtx<DataModel extends GenericDataModel> {
9785
storage: StorageReader;
9886
}
9987

100-
/**
101-
* If you're using code generation, use the `QueryCtx` type in
102-
* `convex/_generated/server.d.ts` which is typed for your data model.
103-
*
104-
* If you need an unparameterized QueryCtx use GenericQueryCtx.
105-
*
106-
* @public
107-
* @deprecated
108-
*/
109-
export interface QueryCtx<DataModel extends GenericDataModel>
110-
extends GenericQueryCtx<DataModel> {}
111-
11288
/**
11389
* A set of services for use within Convex action functions.
11490
*
@@ -205,19 +181,6 @@ export interface GenericActionCtx<DataModel extends GenericDataModel> {
205181
): Promise<Array<{ _id: Id<TableName>; _score: number }>>;
206182
}
207183

208-
/**
209-
* If you're using code generation, use the `ActionCtx` type in
210-
* `convex/_generated/server.d.ts` which is typed for your data model.
211-
*
212-
* If you need an unparameterized ActionCtx use GenericActionCtx.
213-
*
214-
* @public
215-
* @deprecated
216-
*/
217-
export interface ActionCtx<
218-
DataModel extends GenericDataModel = GenericDataModel,
219-
> extends GenericActionCtx<DataModel> {}
220-
221184
/**
222185
* The default arguments type for a Convex query, mutation, or action function.
223186
*

0 commit comments

Comments
 (0)