@based/react 5.2.1 → 5.3.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.
package/dist/Ctx.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { BasedClient } from '@based/client';
3
2
  export declare const Ctx: import("react").Context<BasedClient>;
@@ -1,4 +1,4 @@
1
- import { BasedQuery } from '@based/client';
1
+ import { BasedClientQuery as BasedQuery } from '@based/client';
2
2
  export declare const lastCollected: {
3
3
  q: BasedQuery[];
4
4
  };
package/dist/ssr.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BasedQuery } from '@based/client';
1
+ import { BasedClientQuery as BasedQuery } from '@based/client';
2
2
  export declare const syncCacheScript: (queries: BasedQuery[]) => string;
3
3
  export declare const handleHeadComponents: (html: string) => string;
4
4
  export declare const render: (reactApp: React.ReactElement, head?: React.ReactElement, depth?: number) => Promise<{
@@ -1,4 +1,4 @@
1
- import { AuthState } from '@based/client';
1
+ import { ClientAuthState as AuthState } from '@based/client';
2
2
  /**
3
3
  Observe if a client is authenticated
4
4
 
@@ -1,4 +1,4 @@
1
- import { QueryMap } from '@based/client';
1
+ import { ClientQueryMap as QueryMap } from '@based/client';
2
2
  import { BasedError } from '@based/errors';
3
3
  export declare const useQueries: <T = any>(name?: string, payloads?: any[], opts?: {
4
4
  persistent: boolean;
@@ -17,11 +17,11 @@ export declare const useQueries: <T = any>(name?: string, payloads?: any[], opts
17
17
  })
18
18
  ```
19
19
  */
20
- export declare const useQuery: <N extends keyof QueryMap>(name: N, payload?: QueryMap[N]['payload'], opts?: {
20
+ export declare const useQuery: <N extends keyof QueryMap>(name: N, payload?: QueryMap[N]["payload"], opts?: {
21
21
  persistent: boolean;
22
22
  }) => {
23
23
  loading: boolean;
24
- data?: QueryMap[N]['result'];
24
+ data?: QueryMap[N]["result"];
25
25
  error?: BasedError;
26
26
  checksum?: number;
27
27
  };
@@ -3,7 +3,7 @@ type UseWindowState = {
3
3
  items: any[];
4
4
  checksum?: number;
5
5
  };
6
- export declare const useWindow: (name: string, getPayload: ({ offset, limit }) => any, opts: {
6
+ export declare const useWindow: (name: string, getPayload: ({ offset, limit }: any) => any, opts: {
7
7
  path: string[];
8
8
  pages: number[];
9
9
  size: number;
package/dist/useWindow.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect, useContext, useRef } from 'react';
2
2
  import { Ctx } from './Ctx.js';
3
- import { hash } from '@saulx/hash';
3
+ import { hash } from '@based/hash';
4
4
  export const useWindow = (name, getPayload, opts, dependencies) => {
5
5
  const [checksum, setCheckum] = useState(0);
6
6
  const cache = useRef();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/react",
3
- "version": "5.2.1",
3
+ "version": "5.3.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -10,7 +10,7 @@
10
10
  "watch-server": "nodemon ./test/based-server.js",
11
11
  "browser": "npx vite ./test/browser",
12
12
  "watch": "npm run build -- --watch",
13
- "clean": "rimraf {.turbo,dist,node_modules}"
13
+ "clean": "rm -rf ./dist ./node_modules"
14
14
  },
15
15
  "exports": {
16
16
  "./ssr": "./dist/ssr.js",
@@ -18,19 +18,18 @@
18
18
  },
19
19
  "sideEffects": false,
20
20
  "dependencies": {
21
- "@saulx/hash": "^2.0.0",
22
- "@based/errors": "^1.3.0"
21
+ "@based/errors": "1.5.1",
22
+ "@based/hash": "1.1.0"
23
23
  },
24
24
  "devDependencies": {
25
+ "@based/client": "8.2.3",
26
+ "@saulx/tsconfig": "^1.1.0",
25
27
  "@types/react": "^18.0.29",
26
- "rimraf": "^3.0.2",
27
- "typescript": "^5.2.2",
28
- "react-dom": "^18.2.0",
29
- "esbuild": "^0.24.0",
30
- "@based/client": "^6.0.1",
28
+ "esbuild": "^0.25.9",
31
29
  "nodemon": "^3.1.7",
32
- "vite": "^5.2.8",
33
- "@saulx/tsconfig": "^1.1.0"
30
+ "react-dom": "^18.2.0",
31
+ "typescript": "^5.2.2",
32
+ "vite": "^7.1.3"
34
33
  },
35
34
  "peerDependencies": {
36
35
  "@based/client": "*",