@evolu/react 10.2.0 → 10.3.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/dist/EvoluContext.d.ts +1 -1
- package/dist/EvoluContext.d.ts.map +1 -1
- package/dist/EvoluProvider.d.ts +1 -1
- package/dist/EvoluProvider.d.ts.map +1 -1
- package/dist/useEvolu.d.ts +1 -1
- package/dist/useEvolu.d.ts.map +1 -1
- package/dist/useOwner.d.ts +3 -16
- package/dist/useOwner.d.ts.map +1 -1
- package/dist/useOwner.js +3 -16
- package/dist/useQueries.d.ts +1 -1
- package/dist/useQueries.d.ts.map +1 -1
- package/dist/useQuery.d.ts +1 -1
- package/dist/useQuery.d.ts.map +1 -1
- package/dist/useQuerySubscription.d.ts +1 -1
- package/dist/useQuerySubscription.d.ts.map +1 -1
- package/dist/useQuerySubscription.js +1 -1
- package/dist/useSyncState.d.ts +1 -1
- package/dist/useSyncState.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/EvoluContext.ts +1 -1
- package/src/EvoluProvider.tsx +1 -1
- package/src/useEvolu.ts +1 -1
- package/src/useOwner.ts +3 -16
- package/src/useQueries.ts +1 -1
- package/src/useQuery.ts +1 -1
- package/src/useQuerySubscription.ts +1 -1
- package/src/useSyncState.ts +1 -1
package/dist/EvoluContext.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvoluContext.d.ts","sourceRoot":"","sources":["../src/EvoluContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EvoluContext.d.ts","sourceRoot":"","sources":["../src/EvoluContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGlD,eAAO,MAAM,YAAY,4CAAyC,CAAC"}
|
package/dist/EvoluProvider.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvoluProvider.d.ts","sourceRoot":"","sources":["../src/EvoluProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EvoluProvider.d.ts","sourceRoot":"","sources":["../src/EvoluProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,eAAO,MAAM,aAAa,GAAI,sBAG3B;IACD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CAC5B,KAAG,KAAK,CAAC,YAAqE,CAAC"}
|
package/dist/useEvolu.d.ts
CHANGED
package/dist/useEvolu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEvolu.d.ts","sourceRoot":"","sources":["../src/useEvolu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useEvolu.d.ts","sourceRoot":"","sources":["../src/useEvolu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAKlD;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,QAAO,KAQ3B,CAAC"}
|
package/dist/useOwner.d.ts
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { SyncOwner } from "@evolu/common";
|
|
2
2
|
/**
|
|
3
|
-
* React Hook for
|
|
3
|
+
* React Hook for Evolu `useOwner` method.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* ### Example
|
|
9
|
-
*
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import { useOwner } from "@evolu/react";
|
|
12
|
-
*
|
|
13
|
-
* function MyComponent({ shardOwner }: { shardOwner: SyncOwner | null }) {
|
|
14
|
-
* useOwner(shardOwner);
|
|
15
|
-
*
|
|
16
|
-
* // Component will sync with shardOwner while mounted
|
|
17
|
-
* return <div>Syncing with shard...</div>;
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
5
|
+
* Using an owner means syncing it with its transports, or the transports
|
|
6
|
+
* defined in Evolu config if the owner has no transports defined.
|
|
20
7
|
*/
|
|
21
8
|
export declare const useOwner: (owner: SyncOwner | null) => void;
|
|
22
9
|
//# sourceMappingURL=useOwner.d.ts.map
|
package/dist/useOwner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOwner.d.ts","sourceRoot":"","sources":["../src/useOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C
|
|
1
|
+
{"version":3,"file":"useOwner.d.ts","sourceRoot":"","sources":["../src/useOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,GAAG,IAAI,KAAG,IAOlD,CAAC"}
|
package/dist/useOwner.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { useEvolu } from "./useEvolu.js";
|
|
3
3
|
/**
|
|
4
|
-
* React Hook for
|
|
4
|
+
* React Hook for Evolu `useOwner` method.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* ### Example
|
|
10
|
-
*
|
|
11
|
-
* ```tsx
|
|
12
|
-
* import { useOwner } from "@evolu/react";
|
|
13
|
-
*
|
|
14
|
-
* function MyComponent({ shardOwner }: { shardOwner: SyncOwner | null }) {
|
|
15
|
-
* useOwner(shardOwner);
|
|
16
|
-
*
|
|
17
|
-
* // Component will sync with shardOwner while mounted
|
|
18
|
-
* return <div>Syncing with shard...</div>;
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
6
|
+
* Using an owner means syncing it with its transports, or the transports
|
|
7
|
+
* defined in Evolu config if the owner has no transports defined.
|
|
21
8
|
*/
|
|
22
9
|
export const useOwner = (owner) => {
|
|
23
10
|
const evolu = useEvolu();
|
package/dist/useQueries.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Queries, QueriesToQueryRows, QueriesToQueryRowsPromises, Row } from "@evolu/common/
|
|
1
|
+
import { Queries, QueriesToQueryRows, QueriesToQueryRowsPromises, Row } from "@evolu/common/local-first";
|
|
2
2
|
/**
|
|
3
3
|
* The same as {@link useQuery}, but for many queries.
|
|
4
4
|
*
|
package/dist/useQueries.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueries.d.ts","sourceRoot":"","sources":["../src/useQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,0BAA0B,EAC1B,GAAG,EACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"useQueries.d.ts","sourceRoot":"","sources":["../src/useQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,0BAA0B,EAC1B,GAAG,EACJ,MAAM,2BAA2B,CAAC;AAOnC;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,CAAC,SAAS,GAAG,EACb,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EACpB,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAErB,SAAS,CAAC,GAAG,CAAC,CAAC,EACf,UAAS,OAAO,CAAC;IACf,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAEvB,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,CACjB,GAAG,0BAA0B,CAAC,CAAC,CAAC,EAChC,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAClC,CAAC;CACH,CAAM,KACN,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,EAAE,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAkBtD,CAAC"}
|
package/dist/useQuery.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query, QueryRows, Row } from "@evolu/common/
|
|
1
|
+
import { Query, QueryRows, Row } from "@evolu/common/local-first";
|
|
2
2
|
/**
|
|
3
3
|
* Load and subscribe to the Query, and return an object with `rows` and `row`
|
|
4
4
|
* properties that are automatically updated when data changes.
|
package/dist/useQuery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuery.d.ts","sourceRoot":"","sources":["../src/useQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useQuery.d.ts","sourceRoot":"","sources":["../src/useQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAOlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,GAAG,EACpC,OAAO,KAAK,CAAC,CAAC,CAAC,EACf,UAAS,OAAO,CAAC;IACf,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;CACzC,CAAM,KACN,SAAS,CAAC,CAAC,CAWb,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query, QueryRows, Row } from "@evolu/common/
|
|
1
|
+
import { Query, QueryRows, Row } from "@evolu/common/local-first";
|
|
2
2
|
/** Subscribe to {@link Query} {@link QueryRows} changes. */
|
|
3
3
|
export declare const useQuerySubscription: <R extends Row>(query: Query<R>, options?: Partial<{
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuerySubscription.d.ts","sourceRoot":"","sources":["../src/useQuerySubscription.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"useQuerySubscription.d.ts","sourceRoot":"","sources":["../src/useQuerySubscription.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAa,MAAM,2BAA2B,CAAC;AAI7E,4DAA4D;AAC5D,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,GAAG,EAChD,OAAO,KAAK,CAAC,CAAC,CAAC,EACf,UAAS,OAAO,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB,CAAM,KACN,SAAS,CAAC,CAAC,CAsBb,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { constVoid } from "@evolu/common";
|
|
2
|
-
import { emptyRows } from "@evolu/common/
|
|
2
|
+
import { emptyRows } from "@evolu/common/local-first";
|
|
3
3
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
4
4
|
import { useEvolu } from "./useEvolu.js";
|
|
5
5
|
/** Subscribe to {@link Query} {@link QueryRows} changes. */
|
package/dist/useSyncState.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSyncState.d.ts","sourceRoot":"","sources":["../src/useSyncState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useSyncState.d.ts","sourceRoot":"","sources":["../src/useSyncState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,8CAA8C;AAC9C,eAAO,MAAM,YAAY,QAAO,SAQ/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/react",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.0",
|
|
4
4
|
"description": "Evolu for React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"shx": "^0.4.0",
|
|
37
37
|
"typescript": "^5.9.2",
|
|
38
38
|
"vitest": "^4.0.4",
|
|
39
|
-
"@evolu/
|
|
40
|
-
"@evolu/
|
|
39
|
+
"@evolu/common": "7.3.0",
|
|
40
|
+
"@evolu/tsconfig": "0.0.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@evolu/common": "^7.
|
|
43
|
+
"@evolu/common": "^7.3.0",
|
|
44
44
|
"react": ">=19"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
package/src/EvoluContext.ts
CHANGED
package/src/EvoluProvider.tsx
CHANGED
package/src/useEvolu.ts
CHANGED
package/src/useOwner.ts
CHANGED
|
@@ -3,23 +3,10 @@ import { useEffect } from "react";
|
|
|
3
3
|
import { useEvolu } from "./useEvolu.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* React Hook for
|
|
6
|
+
* React Hook for Evolu `useOwner` method.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* ### Example
|
|
12
|
-
*
|
|
13
|
-
* ```tsx
|
|
14
|
-
* import { useOwner } from "@evolu/react";
|
|
15
|
-
*
|
|
16
|
-
* function MyComponent({ shardOwner }: { shardOwner: SyncOwner | null }) {
|
|
17
|
-
* useOwner(shardOwner);
|
|
18
|
-
*
|
|
19
|
-
* // Component will sync with shardOwner while mounted
|
|
20
|
-
* return <div>Syncing with shard...</div>;
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
8
|
+
* Using an owner means syncing it with its transports, or the transports
|
|
9
|
+
* defined in Evolu config if the owner has no transports defined.
|
|
23
10
|
*/
|
|
24
11
|
export const useOwner = (owner: SyncOwner | null): void => {
|
|
25
12
|
const evolu = useEvolu();
|
package/src/useQueries.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
QueriesToQueryRows,
|
|
4
4
|
QueriesToQueryRowsPromises,
|
|
5
5
|
Row,
|
|
6
|
-
} from "@evolu/common/
|
|
6
|
+
} from "@evolu/common/local-first";
|
|
7
7
|
import { use, useRef } from "react";
|
|
8
8
|
import { useEvolu } from "./useEvolu.js";
|
|
9
9
|
import type { useQuery } from "./useQuery.js";
|
package/src/useQuery.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { constVoid } from "@evolu/common";
|
|
2
|
-
import { Query, QueryRows, Row, emptyRows } from "@evolu/common/
|
|
2
|
+
import { Query, QueryRows, Row, emptyRows } from "@evolu/common/local-first";
|
|
3
3
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
4
4
|
import { useEvolu } from "./useEvolu.js";
|
|
5
5
|
|
package/src/useSyncState.ts
CHANGED