convex 1.24.3 → 1.24.5
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 +8 -0
- package/dist/browser.bundle.js +12 -4
- package/dist/browser.bundle.js.map +2 -2
- package/dist/cjs/browser/simple_client.js +2 -2
- package/dist/cjs/browser/simple_client.js.map +2 -2
- package/dist/cjs/browser/sync/client.js +9 -1
- package/dist/cjs/browser/sync/client.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs-types/browser/simple_client.d.ts +2 -2
- package/dist/cjs-types/browser/simple_client.d.ts.map +1 -1
- package/dist/cjs-types/browser/sync/client.d.ts.map +1 -1
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cli.bundle.cjs +10 -2
- package/dist/cli.bundle.cjs.map +2 -2
- package/dist/esm/browser/simple_client.js +2 -2
- package/dist/esm/browser/simple_client.js.map +2 -2
- package/dist/esm/browser/sync/client.js +9 -1
- package/dist/esm/browser/sync/client.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm-types/browser/simple_client.d.ts +2 -2
- package/dist/esm-types/browser/simple_client.d.ts.map +1 -1
- package/dist/esm-types/browser/sync/client.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/react.bundle.js +10 -2
- package/dist/react.bundle.js.map +2 -2
- package/package.json +1 -1
- package/src/browser/simple_client.test.ts +65 -11
- package/src/browser/simple_client.ts +3 -1
- package/src/browser/sync/client.ts +9 -1
- package/src/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.24.4
|
|
4
|
+
|
|
5
|
+
- `ConvexClient.mutation()` now accepts a third `options` argument that can
|
|
6
|
+
contain an optimistic update.
|
|
7
|
+
|
|
8
|
+
- Log a warning when optimistic update handlers return a promise since they
|
|
9
|
+
should be sync.
|
|
10
|
+
|
|
3
11
|
## 1.24.3
|
|
4
12
|
|
|
5
13
|
- Add `.url` property to ConvexReactClient.
|
package/dist/browser.bundle.js
CHANGED
|
@@ -28,7 +28,7 @@ var convex = (() => {
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var version = "1.24.
|
|
31
|
+
var version = "1.24.5";
|
|
32
32
|
|
|
33
33
|
// src/values/base64.ts
|
|
34
34
|
var base64_exports = {};
|
|
@@ -2804,7 +2804,15 @@ var convex = (() => {
|
|
|
2804
2804
|
const optimisticUpdate = options.optimisticUpdate;
|
|
2805
2805
|
if (optimisticUpdate !== void 0) {
|
|
2806
2806
|
const wrappedUpdate = (localQueryStore) => {
|
|
2807
|
-
optimisticUpdate(
|
|
2807
|
+
const result = optimisticUpdate(
|
|
2808
|
+
localQueryStore,
|
|
2809
|
+
mutationArgs
|
|
2810
|
+
);
|
|
2811
|
+
if (result instanceof Promise) {
|
|
2812
|
+
this.logger.warn(
|
|
2813
|
+
"Optimistic update handler returned a Promise. Optimistic updates should be synchronous."
|
|
2814
|
+
);
|
|
2815
|
+
}
|
|
2808
2816
|
};
|
|
2809
2817
|
const changedQueryTokens = this.optimisticQueryResults.applyOptimisticUpdate(
|
|
2810
2818
|
wrappedUpdate,
|
|
@@ -3174,9 +3182,9 @@ var convex = (() => {
|
|
|
3174
3182
|
* @param options - A {@link MutationOptions} options object for the mutation.
|
|
3175
3183
|
* @returns A promise of the mutation's result.
|
|
3176
3184
|
*/
|
|
3177
|
-
async mutation(mutation, args) {
|
|
3185
|
+
async mutation(mutation, args, options) {
|
|
3178
3186
|
if (this.disabled) throw new Error("ConvexClient is disabled");
|
|
3179
|
-
return await this.client.mutation(getFunctionName(mutation), args);
|
|
3187
|
+
return await this.client.mutation(getFunctionName(mutation), args, options);
|
|
3180
3188
|
}
|
|
3181
3189
|
/**
|
|
3182
3190
|
* Execute an action function.
|