@buoy-gg/react-query 1.7.7 → 2.1.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/lib/commonjs/index.js +619 -24
- package/lib/commonjs/preset.js +1 -1
- package/lib/commonjs/react-query/components/ReactQueryDevToolsModal.js +12 -0
- package/lib/commonjs/react-query/components/modals/MutationBrowserModal.js +10 -1
- package/lib/commonjs/react-query/components/modals/QueryBrowserModal.js +17 -15
- package/lib/commonjs/react-query/components/modals/ReactQueryModalHeader.js +14 -1
- package/lib/commonjs/react-query/hooks/useAllMutations.js +65 -15
- package/lib/commonjs/react-query/hooks/useWifiState.js +3 -3
- package/lib/commonjs/react-query/index.js +11 -0
- package/lib/commonjs/react-query/stores/index.js +48 -0
- package/lib/commonjs/react-query/stores/reactQueryEventStore.js +311 -0
- package/lib/commonjs/react-query/utils/modalStorageOperations.js +2 -2
- package/lib/module/index.js +113 -8
- package/lib/module/preset.js +2 -2
- package/lib/module/react-query/components/ReactQueryDevToolsModal.js +13 -1
- package/lib/module/react-query/components/modals/MutationBrowserModal.js +10 -1
- package/lib/module/react-query/components/modals/QueryBrowserModal.js +18 -16
- package/lib/module/react-query/components/modals/ReactQueryModalHeader.js +15 -2
- package/lib/module/react-query/hooks/useAllMutations.js +66 -16
- package/lib/module/react-query/hooks/useWifiState.js +4 -4
- package/lib/module/react-query/index.js +2 -1
- package/lib/module/react-query/stores/index.js +3 -0
- package/lib/module/react-query/stores/reactQueryEventStore.js +302 -0
- package/lib/module/react-query/utils/modalStorageOperations.js +3 -3
- package/lib/typescript/index.d.ts +61 -5
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/react-query/components/ReactQueryDevToolsModal.d.ts.map +1 -1
- package/lib/typescript/react-query/components/modals/MutationBrowserModal.d.ts.map +1 -1
- package/lib/typescript/react-query/components/modals/QueryBrowserModal.d.ts.map +1 -1
- package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts +2 -1
- package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts.map +1 -1
- package/lib/typescript/react-query/hooks/useAllMutations.d.ts +2 -2
- package/lib/typescript/react-query/hooks/useAllMutations.d.ts.map +1 -1
- package/lib/typescript/react-query/hooks/useWifiState.d.ts +1 -1
- package/lib/typescript/react-query/hooks/useWifiState.d.ts.map +1 -1
- package/lib/typescript/react-query/index.d.ts +1 -0
- package/lib/typescript/react-query/index.d.ts.map +1 -1
- package/lib/typescript/react-query/stores/index.d.ts +2 -0
- package/lib/typescript/react-query/stores/index.d.ts.map +1 -0
- package/lib/typescript/react-query/stores/reactQueryEventStore.d.ts +99 -0
- package/lib/typescript/react-query/stores/reactQueryEventStore.d.ts.map +1 -0
- package/package.json +17 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react-query/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react-query/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { reactQueryEventStore, setQueryClient, disconnectQueryClient, getReactQueryEvents, subscribeToReactQueryEvents, clearReactQueryEvents, isReactQueryConnected, type ReactQueryEvent, type ReactQueryEventType, } from "./reactQueryEventStore";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-query/stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Query Event Store
|
|
3
|
+
*
|
|
4
|
+
* Bridges React Query's cache subscription system to a simple pub/sub pattern
|
|
5
|
+
* that can be consumed by the unified Events DevTools.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* 1. In your app, call setQueryClient(queryClient) to connect
|
|
9
|
+
* 2. The store will emit events for query/mutation state changes
|
|
10
|
+
* 3. The Events DevTools subscribes to these events
|
|
11
|
+
*/
|
|
12
|
+
import type { QueryClient, Query, Mutation } from "@tanstack/react-query";
|
|
13
|
+
/**
|
|
14
|
+
* React Query event types for the unified timeline
|
|
15
|
+
*/
|
|
16
|
+
export type ReactQueryEventType = "query-fetch-start" | "query-fetch-success" | "query-fetch-error" | "query-invalidated" | "mutation-start" | "mutation-success" | "mutation-error";
|
|
17
|
+
/**
|
|
18
|
+
* Unified React Query event for the timeline
|
|
19
|
+
*/
|
|
20
|
+
export interface ReactQueryEvent {
|
|
21
|
+
id: string;
|
|
22
|
+
type: ReactQueryEventType;
|
|
23
|
+
timestamp: number;
|
|
24
|
+
queryKey?: unknown[];
|
|
25
|
+
queryHash?: string;
|
|
26
|
+
queryData?: unknown;
|
|
27
|
+
queryError?: unknown;
|
|
28
|
+
mutationId?: number;
|
|
29
|
+
mutationKey?: unknown[];
|
|
30
|
+
mutationVariables?: unknown;
|
|
31
|
+
mutationData?: unknown;
|
|
32
|
+
mutationError?: unknown;
|
|
33
|
+
duration?: number;
|
|
34
|
+
query?: Query;
|
|
35
|
+
mutation?: Mutation;
|
|
36
|
+
}
|
|
37
|
+
type ReactQueryEventListener = (events: ReactQueryEvent[]) => void;
|
|
38
|
+
declare class ReactQueryEventStore {
|
|
39
|
+
private events;
|
|
40
|
+
private listeners;
|
|
41
|
+
private queryClient;
|
|
42
|
+
private queryUnsubscribe;
|
|
43
|
+
private mutationUnsubscribe;
|
|
44
|
+
private maxEvents;
|
|
45
|
+
private fetchStartTimes;
|
|
46
|
+
private mutationStartTimes;
|
|
47
|
+
private lastQueryStates;
|
|
48
|
+
private lastMutationStates;
|
|
49
|
+
/**
|
|
50
|
+
* Connect a QueryClient to the store
|
|
51
|
+
* Call this in your app after creating the QueryClient
|
|
52
|
+
*/
|
|
53
|
+
setQueryClient(queryClient: QueryClient): void;
|
|
54
|
+
/**
|
|
55
|
+
* Disconnect from the QueryClient
|
|
56
|
+
*/
|
|
57
|
+
disconnect(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Handle query state updates and emit appropriate events
|
|
60
|
+
*/
|
|
61
|
+
private handleQueryUpdate;
|
|
62
|
+
/**
|
|
63
|
+
* Handle mutation state updates and emit appropriate events
|
|
64
|
+
*/
|
|
65
|
+
private handleMutationUpdate;
|
|
66
|
+
/**
|
|
67
|
+
* Add an event to the store
|
|
68
|
+
*/
|
|
69
|
+
private addEvent;
|
|
70
|
+
/**
|
|
71
|
+
* Get all events
|
|
72
|
+
*/
|
|
73
|
+
getEvents(): ReactQueryEvent[];
|
|
74
|
+
/**
|
|
75
|
+
* Subscribe to event changes
|
|
76
|
+
*/
|
|
77
|
+
subscribe(listener: ReactQueryEventListener): () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Notify all listeners
|
|
80
|
+
*/
|
|
81
|
+
private notifyListeners;
|
|
82
|
+
/**
|
|
83
|
+
* Clear all events
|
|
84
|
+
*/
|
|
85
|
+
clearEvents(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Check if connected to a QueryClient
|
|
88
|
+
*/
|
|
89
|
+
isConnected(): boolean;
|
|
90
|
+
}
|
|
91
|
+
export declare const reactQueryEventStore: ReactQueryEventStore;
|
|
92
|
+
export declare const setQueryClient: (queryClient: QueryClient) => void;
|
|
93
|
+
export declare const disconnectQueryClient: () => void;
|
|
94
|
+
export declare const getReactQueryEvents: () => ReactQueryEvent[];
|
|
95
|
+
export declare const subscribeToReactQueryEvents: (listener: ReactQueryEventListener) => () => void;
|
|
96
|
+
export declare const clearReactQueryEvents: () => void;
|
|
97
|
+
export declare const isReactQueryConnected: () => boolean;
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=reactQueryEventStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactQueryEventStore.d.ts","sourceRoot":"","sources":["../../../../src/react-query/stores/reactQueryEventStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG1E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,mBAAmB,GACnB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,KAAK,uBAAuB,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;AAOnE,cAAM,oBAAoB;IACxB,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,SAAS,CAA2C;IAC5D,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,SAAS,CAAO;IAGxB,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,kBAAkB,CAAkC;IAG5D,OAAO,CAAC,eAAe,CAAmE;IAC1F,OAAO,CAAC,kBAAkB,CAAkC;IAE5D;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAqB9C;;OAEG;IACH,UAAU,IAAI,IAAI;IAgBlB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA6FzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA4D5B;;OAEG;IACH,OAAO,CAAC,QAAQ;IAKhB;;OAEG;IACH,SAAS,IAAI,eAAe,EAAE;IAI9B;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,uBAAuB,GAAG,MAAM,IAAI;IASxD;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB;;OAEG;IACH,WAAW,IAAI,IAAI;IAKnB;;OAEG;IACH,WAAW,IAAI,OAAO;CAGvB;AAGD,eAAO,MAAM,oBAAoB,sBAA6B,CAAC;AAG/D,eAAO,MAAM,cAAc,GAAI,aAAa,WAAW,SACL,CAAC;AACnD,eAAO,MAAM,qBAAqB,YAA0C,CAAC;AAC7E,eAAO,MAAM,mBAAmB,yBAAyC,CAAC;AAC1E,eAAO,MAAM,2BAA2B,GAAI,UAAU,uBAAuB,WAzCvB,IA0CZ,CAAC;AAC3C,eAAO,MAAM,qBAAqB,YAA2C,CAAC;AAC9E,eAAO,MAAM,qBAAqB,eAA2C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/react-query",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "react-query package",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
8
8
|
"react-native": "lib/module/index.js",
|
|
9
9
|
"source": "src/index.tsx",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"react-native": "./lib/module/index.js",
|
|
13
|
+
"import": {
|
|
14
|
+
"default": "./lib/module/index.js",
|
|
15
|
+
"types": "./lib/typescript/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"default": "./lib/commonjs/index.js",
|
|
19
|
+
"types": "./lib/typescript/index.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
10
24
|
"files": [
|
|
11
25
|
"lib"
|
|
12
26
|
],
|
|
13
27
|
"sideEffects": false,
|
|
14
28
|
"dependencies": {
|
|
15
|
-
"@buoy-gg/floating-tools-core": "1.
|
|
16
|
-
"@buoy-gg/shared-ui": "1.
|
|
29
|
+
"@buoy-gg/floating-tools-core": "2.1.1",
|
|
30
|
+
"@buoy-gg/shared-ui": "2.1.1"
|
|
17
31
|
},
|
|
18
32
|
"peerDependencies": {
|
|
19
33
|
"@tanstack/react-query": ">=5.0.0",
|