@instantdb/core 0.22.133 → 0.22.134

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instantdb/core",
3
- "version": "0.22.133",
3
+ "version": "0.22.134",
4
4
  "description": "Instant's core local abstraction",
5
5
  "homepage": "https://github.com/instantdb/instant/tree/main/client/packages/core",
6
6
  "repository": {
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "mutative": "^1.0.10",
55
55
  "uuid": "^11.1.0",
56
- "@instantdb/version": "0.22.133"
56
+ "@instantdb/version": "0.22.134"
57
57
  },
58
58
  "scripts": {
59
59
  "test": "vitest",
package/src/index.ts CHANGED
@@ -20,6 +20,7 @@ import {
20
20
  validateTransactions,
21
21
  TransactionValidationError,
22
22
  } from './transactionValidation.ts';
23
+ import { setInstantWarningsEnabled } from './warningToggle.ts';
23
24
 
24
25
  import {
25
26
  StoreInterface,
@@ -921,6 +922,9 @@ export {
921
922
  // error
922
923
  InstantAPIError,
923
924
 
925
+ // warnings
926
+ setInstantWarningsEnabled,
927
+
924
928
  // cli
925
929
  i,
926
930
 
package/src/instaql.ts CHANGED
@@ -4,6 +4,7 @@ import { stringCompare } from './utils/strings.ts';
4
4
  import * as s from './store.ts';
5
5
  import { InstantDBAttr } from './attrTypes.ts';
6
6
  import { Cursor } from './queryTypes.ts';
7
+ import { warningEnabled } from './warningToggle.ts';
7
8
 
8
9
  type Pat = [string | any, string, string | any, string | number];
9
10
  type Pats = Array<Pat>;
@@ -815,7 +816,7 @@ function resolveObjects(
815
816
 
816
817
  const limit = form.$?.limit || form.$?.first || form.$?.last;
817
818
  if (limit != null) {
818
- if (level > 0) {
819
+ if (level > 0 && warningEnabled) {
819
820
  console.warn(
820
821
  'WARNING: Limits in child queries are only run client-side. Data returned from the server will not have a limit.',
821
822
  );
@@ -0,0 +1,5 @@
1
+ export let warningEnabled = true;
2
+
3
+ export const setInstantWarningsEnabled = (enabled: boolean) => {
4
+ warningEnabled = enabled;
5
+ };