convex 1.24.0 → 1.24.1

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +31 -6
  2. package/dist/browser.bundle.js +6 -3
  3. package/dist/browser.bundle.js.map +2 -2
  4. package/dist/cjs/browser/http_client.js +1 -1
  5. package/dist/cjs/browser/http_client.js.map +2 -2
  6. package/dist/cjs/browser/logging.js +4 -0
  7. package/dist/cjs/browser/logging.js.map +2 -2
  8. package/dist/cjs/browser/sync/client.js +1 -1
  9. package/dist/cjs/browser/sync/client.js.map +2 -2
  10. package/dist/cjs/cli/codegen_templates/tsconfig.js +1 -1
  11. package/dist/cjs/cli/codegen_templates/tsconfig.js.map +1 -1
  12. package/dist/cjs/index.js +1 -1
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/react/client.js +1 -1
  15. package/dist/cjs/react/client.js.map +2 -2
  16. package/dist/cjs-types/browser/http_client.d.ts +1 -1
  17. package/dist/cjs-types/browser/http_client.d.ts.map +1 -1
  18. package/dist/cjs-types/browser/logging.d.ts +3 -0
  19. package/dist/cjs-types/browser/logging.d.ts.map +1 -1
  20. package/dist/cjs-types/browser/sync/client.d.ts +4 -4
  21. package/dist/cjs-types/browser/sync/client.d.ts.map +1 -1
  22. package/dist/cjs-types/index.d.ts +1 -1
  23. package/dist/cjs-types/react/client.d.ts.map +1 -1
  24. package/dist/cli.bundle.cjs +7 -4
  25. package/dist/cli.bundle.cjs.map +2 -2
  26. package/dist/esm/browser/http_client.js +6 -2
  27. package/dist/esm/browser/http_client.js.map +2 -2
  28. package/dist/esm/browser/logging.js +3 -0
  29. package/dist/esm/browser/logging.js.map +2 -2
  30. package/dist/esm/browser/sync/client.js +2 -1
  31. package/dist/esm/browser/sync/client.js.map +2 -2
  32. package/dist/esm/cli/codegen_templates/tsconfig.js +1 -1
  33. package/dist/esm/cli/codegen_templates/tsconfig.js.map +1 -1
  34. package/dist/esm/index.js +1 -1
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/react/client.js +5 -2
  37. package/dist/esm/react/client.js.map +2 -2
  38. package/dist/esm-types/browser/http_client.d.ts +1 -1
  39. package/dist/esm-types/browser/http_client.d.ts.map +1 -1
  40. package/dist/esm-types/browser/logging.d.ts +3 -0
  41. package/dist/esm-types/browser/logging.d.ts.map +1 -1
  42. package/dist/esm-types/browser/sync/client.d.ts +4 -4
  43. package/dist/esm-types/browser/sync/client.d.ts.map +1 -1
  44. package/dist/esm-types/index.d.ts +1 -1
  45. package/dist/esm-types/react/client.d.ts.map +1 -1
  46. package/dist/react.bundle.js +6 -3
  47. package/dist/react.bundle.js.map +2 -2
  48. package/package.json +4 -4
  49. package/src/browser/http_client.ts +16 -3
  50. package/src/browser/logging.ts +4 -0
  51. package/src/browser/sync/client.ts +10 -6
  52. package/src/cli/codegen_templates/tsconfig.ts +1 -1
  53. package/src/index.ts +1 -1
  54. package/src/react/client.ts +10 -3
package/CHANGELOG.md CHANGED
@@ -1,16 +1,41 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 1.24.0
4
4
 
5
- - The `npx convex login --login-flow paste` flag can be used to explicitly opt
6
- into the manual token paste login method.
7
-
8
- - Drop support for React 17 and remove use of `unstable_batchedUpdates` as react
5
+ - Drop support for React 17 and remove use of `unstable_batchedUpdates` as React
9
6
  18 introduced
10
7
  [Automatic batching](https://react.dev/blog/2022/03/29/react-v18#new-feature-automatic-batching)
11
8
 
9
+ If you use React 17 and choose to override the change in supported peer
10
+ dependencies (please don't), you may notice query updates are no longer
11
+ batched: it's possible for one Convex query update to occur on a different
12
+ React render than another causing single frames of discrepancies in UI or
13
+ worse, errors if you have code that relies on the client-side consistency like
14
+ client-side joins.
15
+
16
+ You may also notice nothing. Without batched updates some queries may be a few
17
+ milliseconds ahead of other queries, which is still much less than the
18
+ differences in other data fetching solutions, e.g. React Query or SWR, in
19
+ non-batched mode.
20
+
12
21
  - Remove dependency on `react-dom`, making it possible to use on "React Native
13
- only" projects.
22
+ only" projects without overriding any dependency resolution.
23
+
24
+ - New optimistic update helpers for paginated queries: three helpers
25
+ `insertAtTop`, `insertAtBottomIfLoaded`, and `insertAtPosition`.
26
+
27
+ - The `npx convex login --login-flow paste` flag can be used to explicitly opt
28
+ into the manual token paste login method.
29
+
30
+ - Fix MCP servers for self-hosted deployments: previously MCP CLI commands were
31
+ attempting to contact a cloud deployment (which didn't exist) in self-hosted
32
+ setups.
33
+
34
+ - New `compareValues` function exported from `convex/values` which matches
35
+ Convex values semantics as implemented in backends. This function should match
36
+ the Rust implementation in backend (and it property-tested in pursuit of
37
+ this!) but in the event of discrepancies the Rust implementation should be
38
+ considered authoritative.
14
39
 
15
40
  ## 1.23.0
16
41
 
@@ -28,7 +28,7 @@ var convex = (() => {
28
28
  });
29
29
 
30
30
  // src/index.ts
31
- var version = "1.24.0";
31
+ var version = "1.24.1";
32
32
 
33
33
  // src/values/base64.ts
34
34
  var base64_exports = {};
@@ -548,6 +548,9 @@ var convex = (() => {
548
548
  });
549
549
  return logger;
550
550
  }
551
+ function instantiateNoopLogger(options) {
552
+ return new Logger(options);
553
+ }
551
554
  function logForFunction(logger, type, source, udfPath, message) {
552
555
  const prefix = prefix_for_source(source);
553
556
  if (typeof message === "object") {
@@ -2367,7 +2370,7 @@ var convex = (() => {
2367
2370
  webSocketConstructor = webSocketConstructor || WebSocket;
2368
2371
  this.debug = options.reportDebugInfoToConvex ?? false;
2369
2372
  this.address = address;
2370
- this.logger = options.logger ?? instantiateDefaultLogger({ verbose: options.verbose ?? false });
2373
+ this.logger = options.logger === false ? instantiateNoopLogger({ verbose: options.verbose ?? false }) : options.logger !== true && options.logger ? options.logger : instantiateDefaultLogger({ verbose: options.verbose ?? false });
2371
2374
  const i = address.search("://");
2372
2375
  if (i === -1) {
2373
2376
  throw new Error("Provided address was not an absolute URL.");
@@ -3246,7 +3249,7 @@ var convex = (() => {
3246
3249
  if (opts.skipConvexDeploymentUrlCheck !== true) {
3247
3250
  validateDeploymentUrl(address);
3248
3251
  }
3249
- this.logger = opts.logger ?? instantiateDefaultLogger({ verbose: false });
3252
+ this.logger = options?.logger === false ? instantiateNoopLogger({ verbose: false }) : options?.logger !== true && options?.logger ? options.logger : instantiateDefaultLogger({ verbose: false });
3250
3253
  this.address = address;
3251
3254
  this.debug = true;
3252
3255
  }