convex 1.43.0 → 1.44.0
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 +130 -113
- package/dist/browser.bundle.js +1 -1
- package/dist/browser.bundle.js.map +1 -1
- package/dist/cjs/cli/codegen_templates/component_server.js +4 -3
- package/dist/cjs/cli/codegen_templates/component_server.js.map +2 -2
- package/dist/cjs/cli/codegen_templates/server.js +24 -12
- package/dist/cjs/cli/codegen_templates/server.js.map +2 -2
- package/dist/cjs/cli/lib/login.js +12 -8
- package/dist/cjs/cli/lib/login.js.map +2 -2
- package/dist/cjs/cli/login.js +52 -7
- package/dist/cjs/cli/login.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/ConvexAuthState.js +30 -32
- package/dist/cjs/react/ConvexAuthState.js.map +2 -2
- package/dist/cjs/server/impl/actions_impl.js +12 -0
- package/dist/cjs/server/impl/actions_impl.js.map +2 -2
- package/dist/cjs/server/index.js +3 -0
- package/dist/cjs/server/index.js.map +2 -2
- package/dist/cjs/server/schema.js +69 -1
- package/dist/cjs/server/schema.js.map +2 -2
- package/dist/cjs-types/cli/codegen_templates/component_server.d.ts.map +1 -1
- package/dist/cjs-types/cli/codegen_templates/server.d.ts +1 -0
- package/dist/cjs-types/cli/codegen_templates/server.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/login.d.ts +5 -0
- package/dist/cjs-types/cli/lib/login.d.ts.map +1 -1
- package/dist/cjs-types/cli/login.d.ts.map +1 -1
- package/dist/cjs-types/cli/login.test.d.ts +2 -0
- package/dist/cjs-types/cli/login.test.d.ts.map +1 -0
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/react/ConvexAuthState.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/actions_impl.test.d.ts +2 -0
- package/dist/cjs-types/server/impl/actions_impl.test.d.ts.map +1 -0
- package/dist/cjs-types/server/index.d.ts +2 -2
- package/dist/cjs-types/server/index.d.ts.map +1 -1
- package/dist/cjs-types/server/schema.d.ts +83 -5
- package/dist/cjs-types/server/schema.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +1277 -570
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/cli/codegen_templates/component_server.js +8 -4
- package/dist/esm/cli/codegen_templates/component_server.js.map +2 -2
- package/dist/esm/cli/codegen_templates/server.js +22 -11
- package/dist/esm/cli/codegen_templates/server.js.map +2 -2
- package/dist/esm/cli/lib/login.js +11 -8
- package/dist/esm/cli/lib/login.js.map +2 -2
- package/dist/esm/cli/login.js +54 -10
- package/dist/esm/cli/login.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react/ConvexAuthState.js +31 -32
- package/dist/esm/react/ConvexAuthState.js.map +2 -2
- package/dist/esm/server/impl/actions_impl.js +11 -0
- package/dist/esm/server/impl/actions_impl.js.map +2 -2
- package/dist/esm/server/index.js +2 -1
- package/dist/esm/server/index.js.map +2 -2
- package/dist/esm/server/schema.js +67 -0
- package/dist/esm/server/schema.js.map +2 -2
- package/dist/esm-types/cli/codegen_templates/component_server.d.ts.map +1 -1
- package/dist/esm-types/cli/codegen_templates/server.d.ts +1 -0
- package/dist/esm-types/cli/codegen_templates/server.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/login.d.ts +5 -0
- package/dist/esm-types/cli/lib/login.d.ts.map +1 -1
- package/dist/esm-types/cli/login.d.ts.map +1 -1
- package/dist/esm-types/cli/login.test.d.ts +2 -0
- package/dist/esm-types/cli/login.test.d.ts.map +1 -0
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/react/ConvexAuthState.d.ts.map +1 -1
- package/dist/esm-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/esm-types/server/impl/actions_impl.test.d.ts +2 -0
- package/dist/esm-types/server/impl/actions_impl.test.d.ts.map +1 -0
- package/dist/esm-types/server/index.d.ts +2 -2
- package/dist/esm-types/server/index.d.ts.map +1 -1
- package/dist/esm-types/server/schema.d.ts +83 -5
- package/dist/esm-types/server/schema.d.ts.map +1 -1
- package/dist/react.bundle.js +31 -33
- package/dist/react.bundle.js.map +2 -2
- package/package.json +3 -4
- package/src/cli/codegen_templates/component_server.ts +12 -6
- package/src/cli/codegen_templates/server.ts +36 -19
- package/src/cli/lib/login.ts +20 -9
- package/src/cli/login.test.ts +261 -0
- package/src/cli/login.ts +88 -13
- package/src/index.ts +1 -1
- package/src/react/ConvexAuthState.tsx +15 -7
- package/src/server/impl/actions_impl.test.ts +59 -0
- package/src/server/impl/actions_impl.ts +23 -0
- package/src/server/index.ts +7 -1
- package/src/server/schema.test.ts +98 -0
- package/src/server/schema.ts +178 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,63 +1,74 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
## 1.44.0
|
|
4
|
+
|
|
5
|
+
- `schema.doc(tableName)` returns the validator for whole documents of a table:
|
|
6
|
+
the table's own validator with the `_id` and `_creationTime` system fields
|
|
7
|
+
added (to each member, for tables defined with a union).
|
|
8
|
+
`schema.id(tableName)` is `v.id(tableName)` restricted to the table names in
|
|
9
|
+
the schema. `docValidator(tableName, tableDefinition)` from `convex/server`
|
|
10
|
+
does the same as `schema.doc` when you only have a table definition.
|
|
11
|
+
- The server-provided environment variables `CONVEX_SITE_URL` and
|
|
12
|
+
`CONVEX_CLOUD_URL` are now available on `env` by default in
|
|
13
|
+
`_generated/server.d.ts`, along with other environment variables specified in
|
|
14
|
+
`convex/convex.config.ts`.
|
|
15
|
+
- Fixed a bug where the context value provided by `ConvexProviderWithAuth` was
|
|
16
|
+
not referentially stable.
|
|
17
|
+
- Fixed a bug where `npx convex login status` would report misleading results
|
|
18
|
+
when the user is logged in but does not have access to the current project.
|
|
19
|
+
|
|
20
|
+
## 1.43.0
|
|
21
|
+
|
|
22
|
+
- Added new `npx convex deployment usage` and
|
|
23
|
+
`npx convex deployment usage-limits` CLI commands to view a deployment’s
|
|
24
|
+
current resource usage, and view or edit deployment usage limits.
|
|
25
|
+
- When defining hourly cron jobs, you can now omit the `minuteUTC` parameter.
|
|
26
|
+
When omitted, Convex will automatically choose a stable start time within the
|
|
27
|
+
scheduled hour, avoiding concentrating jobs at the top of the hour.
|
|
12
28
|
- Mutations can now reference their upcoming
|
|
13
|
-
[
|
|
29
|
+
[commit timestamp](https://docs.convex.dev/database/advanced/commit-timestamp)
|
|
14
30
|
with `ctx.db.vars.commitTs`. While the mutation is running,
|
|
15
|
-
`ctx.db.vars.commitTs` is a placeholder symbol that is
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
where page splits were handled incorrectly.
|
|
31
|
+
`ctx.db.vars.commitTs` is a placeholder symbol that is replaced with a Int64
|
|
32
|
+
value at commit time that is guaranteed to strictly follow commit order,
|
|
33
|
+
unlike the `_creationTime` system field. This low-level primitive is helpful
|
|
34
|
+
for advanced use cases such as implementing efficient FIFO queues.
|
|
35
|
+
- Added a new `v.commitTs()` validator that accepts either the upcoming commit
|
|
36
|
+
timestamp placeholder, or a Int64 commit timestamp.
|
|
37
|
+
- The Convex CLI is now able to find the right TypeScript compiler when using
|
|
38
|
+
side-by-side TypeScript 6 and 7 installation. (This setup is used in codebases
|
|
39
|
+
that want to use the native TypeScript 7 compiler but still need access to the
|
|
40
|
+
TypeScript compiler JavaScript API.)
|
|
41
|
+
- Deprecated the `typescriptCompiler` parameter in `convex.json`. This parameter
|
|
42
|
+
was only necessary when using the TypeScript Native Preview
|
|
43
|
+
(@typescript/native-preview). With TypeScript 7, Convex automatically picks
|
|
44
|
+
the right binary.
|
|
45
|
+
- When a component only uses environment variables that are all optional, it’s
|
|
46
|
+
now possible to omit the `env` argument from `app.use(component, { … })`.
|
|
47
|
+
- Fixed a bug where `app.use()` failed to require a second argument when a
|
|
48
|
+
component has required environment variables (e.g.
|
|
49
|
+
`app.use(component, { env: { REQUIRED_VAR: "value" } })`).
|
|
50
|
+
- Fixed a bug in `usePaginatedQuery_experimental` where page splits were handled
|
|
51
|
+
incorrectly.
|
|
37
52
|
|
|
38
53
|
## 1.42.3
|
|
39
54
|
|
|
40
|
-
- Fixed a bug where the codegen would not sort module paths in
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
applied in 1.42.2.
|
|
55
|
+
- Fixed a bug where the codegen would not sort module paths in an order
|
|
56
|
+
consistent with other platforms when running on Windows. This completes a fix
|
|
57
|
+
that was only partially applied in 1.42.2.
|
|
44
58
|
|
|
45
59
|
## 1.42.2
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`ctx.meta.getRequestMetadata()`.
|
|
49
|
-
- Fixed a circular import in `convex/browser` that caused issues
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
the CLI now returns an error message immediately instead of
|
|
59
|
-
first asking the user to select a project and then failing
|
|
60
|
-
later.
|
|
60
|
+
|
|
61
|
+
- Mutations and actions can now read the raw authentication token used in the
|
|
62
|
+
request by accessing `authToken` in `ctx.meta.getRequestMetadata()`.
|
|
63
|
+
- Fixed a circular import in `convex/browser` that caused issues when using the
|
|
64
|
+
`ConvexHttpClient` in some JavaScript environments.
|
|
65
|
+
- Fixed a bug in `ConvexProviderWithClerk` that caused the Convex client to
|
|
66
|
+
ignore session changes in some situations.
|
|
67
|
+
- Fixed a bug where the codegen would not sort module paths in an order
|
|
68
|
+
consistent with other platforms when running on Windows.
|
|
69
|
+
- When running `npx convex dev` outside a Convex project, the CLI now returns an
|
|
70
|
+
error message immediately instead of first asking the user to select a project
|
|
71
|
+
and then failing later.
|
|
61
72
|
|
|
62
73
|
## 1.42.1
|
|
63
74
|
|
|
@@ -68,66 +79,67 @@
|
|
|
68
79
|
|
|
69
80
|
## 1.42.0
|
|
70
81
|
|
|
71
|
-
- Added a new `npx convex project create` command that can be used
|
|
72
|
-
|
|
73
|
-
- Added a new `--names-only` flag to `npx convex env list`
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(e.g. `db.get("users", userId)`).
|
|
88
|
-
- Fixed an issue where the CLI would not surface permission errors
|
|
89
|
-
correctly when the user or token doesn’t have permission to do something.
|
|
82
|
+
- Added a new `npx convex project create` command that can be used to create new
|
|
83
|
+
projects programmatically.
|
|
84
|
+
- Added a new `--names-only` flag to `npx convex env list` (and
|
|
85
|
+
`npx convex env default list`). This flag shows the names of the env vars that
|
|
86
|
+
are set, without the values. It can be useful to let AI coding agents know the
|
|
87
|
+
variables that are set on a deployment, without giving them the actual values.
|
|
88
|
+
- Added a new `useStaleSnapshot` option to the arguments for `runQuery`. This is
|
|
89
|
+
an advanced feature that can be used to allow mutations to avoid optimistic
|
|
90
|
+
concurrency control (OCC) conflicts in some cases where they can commit even
|
|
91
|
+
though they depend on conflicting reads. This change allows us to improve the
|
|
92
|
+
performance of some of the official Convex components, including Workpool.
|
|
93
|
+
- Improved the documentation of `db.*` methods to more clearly explain the
|
|
94
|
+
difference between the old APIs without table names (e.g. `db.get(userId)`)
|
|
95
|
+
and the new APIs with table names (e.g. `db.get("users", userId)`).
|
|
96
|
+
- Fixed an issue where the CLI would not surface permission errors correctly
|
|
97
|
+
when the user or token doesn’t have permission to do something.
|
|
90
98
|
- Exposes the current scheduled function's ID as `scheduledFunctionId` in
|
|
91
99
|
`ctx.meta.getRequestMetadata()`.
|
|
92
|
-
- `npx convex insights` has a new `--json` flag that makes the command
|
|
93
|
-
|
|
94
|
-
- File storage: marked a few TypeScript types in `convex/server` as
|
|
95
|
-
(`FileMetadata`, `FileStorageId`, `StorageId`). These types are
|
|
96
|
-
only by file storage APIs that were deprecated in `convex@1.6.0`,
|
|
97
|
-
|
|
100
|
+
- `npx convex insights` has a new `--json` flag that makes the command output
|
|
101
|
+
easier to parse programmatically.
|
|
102
|
+
- File storage: marked a few TypeScript types in `convex/server` as
|
|
103
|
+
`@deprecated` (`FileMetadata`, `FileStorageId`, `StorageId`). These types are
|
|
104
|
+
used only by file storage APIs that were deprecated in `convex@1.6.0`, so we
|
|
105
|
+
also marked them as `@deprecated` for clarity.
|
|
98
106
|
- Bumps the `ws` peer dependency to avoid a vulnerable range.
|
|
99
107
|
|
|
100
108
|
## 1.41.0
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
We made this change to avoid
|
|
109
|
+
|
|
110
|
+
- It is now possible to set limits on nested queries and mutations with the new
|
|
111
|
+
`transactionLimits` option in `runQuery`/`runMutation`.
|
|
112
|
+
- `npx convex ai-files` now installs skills with separate copies of each skill
|
|
113
|
+
for each coding agent instead of using symlinks. We made this change to avoid
|
|
114
|
+
known issues with symlinks on Windows.
|
|
106
115
|
- When using Convex in anonymous mode (without a Convex account),
|
|
107
|
-
`npx convex dev` now starts a different dashboard server for each
|
|
108
|
-
|
|
109
|
-
|
|
116
|
+
`npx convex dev` now starts a different dashboard server for each deployment.
|
|
117
|
+
This ensures the dashboard always connects to the right deployment when
|
|
118
|
+
multiple deployments are running at the same time.
|
|
110
119
|
|
|
111
120
|
## 1.40.0
|
|
121
|
+
|
|
112
122
|
- You can now create a local deployment in a specific Convex cloud project with
|
|
113
123
|
`npx convex deployment create team-slug:project-slug:local`.
|
|
114
|
-
- You can now move a local deployment to another cloud project
|
|
115
|
-
|
|
116
|
-
when it moves the deployment to another project.
|
|
117
|
-
- The CLI now shows more clearly which deployment is targeted when running
|
|
118
|
-
such as `npx convex dev` and `npx convex deploy`.
|
|
119
|
-
- Added a new `<AuthRefreshing />` helper component, used to show indicators
|
|
120
|
-
function calls are paused because the authentication token is refreshing.
|
|
121
|
-
- Removed `--local` and `--cloud` flags from `npx convex dev`. The behavior of
|
|
122
|
-
was misleading when a deployment was already selected. Instead,
|
|
123
|
-
`npx convex deployment select local` to use a local deployment, and
|
|
124
|
+
- You can now move a local deployment to another cloud project using
|
|
125
|
+
`npx convex deployment select team-slug:project-slug:local`. This command
|
|
126
|
+
warns when it moves the deployment to another project.
|
|
127
|
+
- The CLI now shows more clearly which deployment is targeted when running
|
|
128
|
+
commands such as `npx convex dev` and `npx convex deploy`.
|
|
129
|
+
- Added a new `<AuthRefreshing />` helper component, used to show indicators
|
|
130
|
+
when function calls are paused because the authentication token is refreshing.
|
|
131
|
+
- Removed `--local` and `--cloud` flags from `npx convex dev`. The behavior of
|
|
132
|
+
these flags was misleading when a deployment was already selected. Instead,
|
|
133
|
+
use `npx convex deployment select local` to use a local deployment, and
|
|
124
134
|
`npx convex deployment select dev` to use your personal cloud dev deployment.
|
|
125
|
-
- The CLI now provides guidance when TypeScript type checking is taking too
|
|
135
|
+
- The CLI now provides guidance when TypeScript type checking is taking too
|
|
136
|
+
long.
|
|
126
137
|
- Improved the CLI command documentation to include more details and examples.
|
|
127
|
-
- `npx convex logs`: `--tail` is now accepted as an alias for the `--history`
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
variables
|
|
138
|
+
- `npx convex logs`: `--tail` is now accepted as an alias for the `--history`
|
|
139
|
+
flag.
|
|
140
|
+
- When creating a local deployment, the CLI now skips importing the default
|
|
141
|
+
environment variables from the Convex cloud project if you don’t have
|
|
142
|
+
permission to view the default environment variables instead of crashing.
|
|
131
143
|
|
|
132
144
|
## 1.39.1
|
|
133
145
|
|
|
@@ -135,28 +147,31 @@
|
|
|
135
147
|
|
|
136
148
|
## 1.39.0
|
|
137
149
|
|
|
138
|
-
- Apps and components may now declare typesafe env vars that they require. Both
|
|
139
|
-
and `defineComponent` now accept an `env` object with string keys
|
|
140
|
-
Declared environment variables must be present and match
|
|
150
|
+
- Apps and components may now declare typesafe env vars that they require. Both
|
|
151
|
+
`defineApp` and `defineComponent` now accept an `env` object with string keys
|
|
152
|
+
and validator values. Declared environment variables must be present and match
|
|
153
|
+
the validators before deployment.
|
|
141
154
|
- Allow `--local-cloud-port`, `--local-site-port`, `--local-backend-version` and
|
|
142
|
-
`--local-force-upgrade` options to `npx convex dev` to be used whenever using
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
155
|
+
`--local-force-upgrade` options to `npx convex dev` to be used whenever using
|
|
156
|
+
a local deployment.
|
|
157
|
+
- The `AsyncLocalStorage` and `AsyncResource` APIs from `node:async_hooks` are
|
|
158
|
+
now available in the standard Convex runtime. Note that stored values will not
|
|
159
|
+
be threaded through calls to `ctx.runQuery`/`ctx.runMutation`/`ctx.runAction`.
|
|
146
160
|
|
|
147
161
|
## 1.38.0
|
|
148
162
|
|
|
149
|
-
- Adds `ctx.meta.getRequestMetadata()` to access request metadata in mutations
|
|
150
|
-
request ID, client IP, and client User-Agent.
|
|
163
|
+
- Adds `ctx.meta.getRequestMetadata()` to access request metadata in mutations
|
|
164
|
+
and actions: request ID, client IP, and client User-Agent.
|
|
151
165
|
- Default env vars are now imported when creating a new local deployment.
|
|
152
|
-
- Allows creating new local deployments using
|
|
153
|
-
|
|
154
|
-
|
|
166
|
+
- Allows creating new local deployments using
|
|
167
|
+
`npx convex deployment select local`.
|
|
168
|
+
- Adds support for `--expiry` and `--expires` aliases for `--expiration` in
|
|
169
|
+
`npx convex deployment create`.
|
|
155
170
|
- Supports using `import "server-only"` to mark files as server-only.
|
|
156
171
|
- Removes the `npx convex disable-local-deployments` command.
|
|
157
172
|
- Fixes an issue where stdout/stderr would be truncated after exit in the CLI.
|
|
158
|
-
- Updated `usePaginatedQuery_experimental` overload that has an object-based API
|
|
159
|
-
to `useQuery_experimental`.
|
|
173
|
+
- Updated `usePaginatedQuery_experimental` overload that has an object-based API
|
|
174
|
+
similar to `useQuery_experimental`.
|
|
160
175
|
|
|
161
176
|
## 1.37.0
|
|
162
177
|
|
|
@@ -480,6 +495,8 @@
|
|
|
480
495
|
confirmation before deleting large indexes. This change is helpful for
|
|
481
496
|
avoiding situations where an index is accidentally deleted and backfilling it
|
|
482
497
|
takes a long time.
|
|
498
|
+
- You can use `v.nullable` as a convenient alias for `v.union(v.null(), ...)`
|
|
499
|
+
when defining validators.
|
|
483
500
|
|
|
484
501
|
## 1.29.1
|
|
485
502
|
|