Skip to content

Commit 16484ac

Browse files
authored
Merge pull request #5 from hsndmr/v2
v2
2 parents c78b87c + 63fa538 commit 16484ac

91 files changed

Lines changed: 11746 additions & 24628 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "packages/reactotron-react-query@*"
9+
10+
jobs:
11+
publish:
12+
name: Publish reactotron-react-query to npm
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
registry-url: "https://registry.npmjs.org/"
24+
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v2
27+
with:
28+
version: 8
29+
30+
- name: Install dependencies
31+
run: pnpm install
32+
33+
- name: Copy root files into package
34+
run: |
35+
cp README.md CHANGELOG.md ./packages/reactotron-react-query/
36+
37+
- name: Build package
38+
run: pnpm --filter reactotron-react-query build
39+
40+
- name: Publish package
41+
run: pnpm --filter reactotron-react-query publish --access public
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test Reactotron React Query
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v2
26+
with:
27+
version: 8
28+
29+
- name: Install dependencies
30+
run: pnpm install
31+
32+
- name: Run tests
33+
run: pnpm --filter reactotron-react-query test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ test
66
src/**.js
77
coverage
88
*.log
9+
dist

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 120,
3+
"semi": false,
4+
"singleQuote": false,
5+
"trailingComma": "es5"
6+
}

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
"cSpell.enabled": true,
44
"editor.formatOnSave": true,
55
"typescript.tsdk": "node_modules/typescript/lib",
6-
"typescript.enablePromptUseWorkspaceTsdk": true
6+
"typescript.enablePromptUseWorkspaceTsdk": true,
7+
"jest.jestCommandLine": "pnpm exec jest",
8+
"jest.rootPath": ".",
9+
"jest.enableCodeLens": true,
10+
"jest.runAllTestsFirst": false
711
}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### 2.0.0 (2025-06-22)
6+
7+
- Migrated to @tanstack/react-query (v5+) — replaces support for the legacy react-query package.
8+
- Added mutation event tracking
9+
510
### 1.0.4 (2024-04-08)
611

712
- Updated reactotron-core-client version

README.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
![Screenshot](reactotron.png)
44

5+
[![npm](https://img.shields.io/npm/dm/reactotron-react-query)](https://www.npmjs.com/package/reactotron-react-query)
6+
57
Is there a plugin for Reactotron that allows for similar functionality to the React Query Devtools? Yes! This plugin helps you debug your React Query cache and queries in Reactotron.
68

79
## Installation
@@ -17,46 +19,43 @@ npm i reactotron-react-query --save-dev
1719
Create a file queryClient.ts
1820

1921
```typescript
20-
import { QueryClient } from '@tanstack/react-query';
21-
const queryClient = new QueryClient();
22+
import { QueryClient } from "@tanstack/react-query"
23+
const queryClient = new QueryClient()
2224

23-
export { queryClient };
25+
export { queryClient }
2426
```
2527

2628
Create a file reactotron.ts
2729

2830
```typescript
29-
import Reactotron from 'reactotron-react-native';
30-
import {
31-
QueryClientManager,
32-
reactotronReactQuery,
33-
} from 'reactotron-react-query';
34-
import { queryClient } from './queryClient';
31+
import Reactotron from "reactotron-react-native"
32+
import { QueryClientManager, reactotronReactQuery } from "reactotron-react-query"
33+
import { queryClient } from "./queryClient"
3534

3635
const queryClientManager = new QueryClientManager({
3736
// @ts-ignore
3837
queryClient,
39-
});
40-
41-
Reactotron.use(reactotronReactQuery(queryClientManager))
42-
.configure({
43-
onDisconnect: () => {
44-
queryClientManager.unsubscribe();
45-
},
46-
})
38+
})
39+
40+
Reactotron.configure({
41+
onDisconnect: () => {
42+
queryClientManager.unsubscribe()
43+
},
44+
})
45+
.use(reactotronReactQuery(queryClientManager))
4746
.useReactNative()
48-
.connect();
47+
.connect()
4948
```
5049

5150
Import the queryClient and reactotron in your App.jsx file.
5251

5352
```jsx
54-
import { StyleSheet, Text, View } from 'react-native';
55-
import { QueryClientProvider } from 'react-query';
56-
import { queryClient } from './queryClient';
53+
import { StyleSheet, Text, View } from "react-native"
54+
import { QueryClientProvider } from "react-query"
55+
import { queryClient } from "./queryClient"
5756

5857
if (__DEV__) {
59-
require('./reactotron.ts');
58+
require("./reactotron.ts")
6059
}
6160

6261
export default function App() {
@@ -66,17 +65,17 @@ export default function App() {
6665
<Text>Open up App.js to start working on your app!</Text>
6766
</View>
6867
</QueryClientProvider>
69-
);
68+
)
7069
}
7170

7271
const styles = StyleSheet.create({
7372
container: {
7473
flex: 1,
75-
backgroundColor: '#fff',
76-
alignItems: 'center',
77-
justifyContent: 'center',
74+
backgroundColor: "#fff",
75+
alignItems: "center",
76+
justifyContent: "center",
7877
},
79-
});
78+
})
8079
```
8180

8281
### How to invalidate queries
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ node_modules/
77
.expo/
88
dist/
99
web-build/
10+
expo-env.d.ts
1011

1112
# Native
13+
.kotlin/
1214
*.orig.*
1315
*.jks
1416
*.p8
@@ -33,3 +35,5 @@ yarn-error.*
3335

3436
# typescript
3537
*.tsbuildinfo
38+
39+
app-example

0 commit comments

Comments
 (0)